AppService { public void delete(Long id) { App app = appRepository.findOne(id); HeimdallException.checkThrow(app == null, GLOBAL_RESOURCE_NOT_FOUND); amqpCacheService.dispatchClean(); appRepository.delete(app); }  @Transactional(readOnly = true) App find(Long id); @Transactional(readOnly = true) AppPage list(AppRequestDTO appDTO, PageableDTO pageableDTO); @Transactional(readOnly = true) List<App> list(AppRequestDTO appDTO); App save(AppPersist appDTO); App update(Long id, AppDTO appDTO); void delete(Long id); @Transactional App save(AppCallbackDTO reqBody);  }
@Test public void deleteAppTest() { Mockito.when(appRepository.findOne(Mockito.anyLong())).thenReturn(app); this.appService.delete(1L); Mockito.verify(this.appRepository, Mockito.times(1)).delete(app); }