@Test
public void deleteTest() {

    Mockito.when(scopeRepository.findByApiIdAndId(Mockito.anyLong(), Mockito.anyLong())).thenReturn(scope);
    scopeService.delete(scope.getApi().getId(), scope.getId());
    Mockito.verify(scopeRepository, Mockito.times(1)).findByApiIdAndId(Mockito.anyLong(), Mockito.anyLong());
}