@Test public void testShouldReturnDraft() { final DraftResult expectedDraft = getDraftSearchResponse(); final DraftSearchCriteria searchCriteria = new DraftSearchCriteria(1L, "NOC", "default"); when(draftRepository.getDrafts(searchCriteria)) .thenReturn(getDraftSearchResponse()); final DraftResult actualDraft = draftService.getDrafts(searchCriteria); assertEquals(actualDraft, expectedDraft); assertEquals(1L, actualDraft.getDrafts().get(0).getId().longValue()); }
public DraftResult getDrafts(DraftSearchCriteria searchCriteria) { return draftRepository.getDrafts(searchCriteria); }
DraftService { public DraftResult getDrafts(DraftSearchCriteria searchCriteria) { return draftRepository.getDrafts(searchCriteria); } }
DraftService { public DraftResult getDrafts(DraftSearchCriteria searchCriteria) { return draftRepository.getDrafts(searchCriteria); } DraftService(DraftRepository draftRepository); }
DraftService { public DraftResult getDrafts(DraftSearchCriteria searchCriteria) { return draftRepository.getDrafts(searchCriteria); } DraftService(DraftRepository draftRepository); long save(NewDraft newDraft); DraftResult getDrafts(DraftSearchCriteria searchCriteria); void update(UpdateDraft updateDraft); void delete(List<Long> draftIdList); void delete(long draftId); }
DraftService { public DraftResult getDrafts(DraftSearchCriteria searchCriteria) { return draftRepository.getDrafts(searchCriteria); } DraftService(DraftRepository draftRepository); long save(NewDraft newDraft); DraftResult getDrafts(DraftSearchCriteria searchCriteria); void update(UpdateDraft updateDraft); void delete(List<Long> draftIdList); void delete(long draftId);  }