@Test public void testCreateAsync() throws JsonProcessingException { List<Nominee> expectedNominees = seedHelper.getNominees(); doReturn(Arrays.asList(1L)).when(nomineeRepository).generateSequences(anyInt()); List<Nominee> actualNominees = nomineeService.createAsync(seedHelper.getNomineeRequest()); verify(nomineeRepository).generateSequences(anyInt()); verify(nomineeRepository).save(anyListOf(Nominee.class)); assertEquals(expectedNominees, actualNominees); }
public List<Nominee> createAsync(NomineeRequest nomineeRequest) throws JsonProcessingException { populateDataForSave(nomineeRequest.getNominees(), nomineeRequest.getRequestInfo()); create(nomineeRequest); return nomineeRequest.getNominees(); }
NomineeService { public List<Nominee> createAsync(NomineeRequest nomineeRequest) throws JsonProcessingException { populateDataForSave(nomineeRequest.getNominees(), nomineeRequest.getRequestInfo()); create(nomineeRequest); return nomineeRequest.getNominees(); } }
NomineeService { public List<Nominee> createAsync(NomineeRequest nomineeRequest) throws JsonProcessingException { populateDataForSave(nomineeRequest.getNominees(), nomineeRequest.getRequestInfo()); create(nomineeRequest); return nomineeRequest.getNominees(); }  }
NomineeService { public List<Nominee> createAsync(NomineeRequest nomineeRequest) throws JsonProcessingException { populateDataForSave(nomineeRequest.getNominees(), nomineeRequest.getRequestInfo()); create(nomineeRequest); return nomineeRequest.getNominees(); }  List<Nominee> getNominees(NomineeGetRequest nomineeGetRequest, RequestInfo requestInfo); List<Nominee> createAsync(NomineeRequest nomineeRequest); @Transactional void create(NomineeRequest nomineeRequest); List<Nominee> updateAsync(NomineeRequest nomineeRequest); @Transactional void update(NomineeRequest nomineeRequest); }
NomineeService { public List<Nominee> createAsync(NomineeRequest nomineeRequest) throws JsonProcessingException { populateDataForSave(nomineeRequest.getNominees(), nomineeRequest.getRequestInfo()); create(nomineeRequest); return nomineeRequest.getNominees(); }  List<Nominee> getNominees(NomineeGetRequest nomineeGetRequest, RequestInfo requestInfo); List<Nominee> createAsync(NomineeRequest nomineeRequest); @Transactional void create(NomineeRequest nomineeRequest); List<Nominee> updateAsync(NomineeRequest nomineeRequest); @Transactional void update(NomineeRequest nomineeRequest);  }