@Test public void testListAnswerDraft() { final String intygId = "intygId"; final String questionId = "questionId"; when(repo.findByIntygId(intygId)).thenReturn(Arrays.asList(buildArendeDraft(intygId, questionId, null, null))); List<ArendeDraft> res = arendeDraftService.listAnswerDrafts(intygId); assertNotNull(res); assertEquals(1, res.size()); assertEquals(intygId, res.get(0).getIntygId()); assertEquals(questionId, res.get(0).getQuestionId()); verify(repo).findByIntygId(intygId); verifyNoMoreInteractions(repo); }
@Override public List<ArendeDraft> listAnswerDrafts(String intygId) { return arendeDraftRepository.findByIntygId(intygId).stream().filter(d -> d.getQuestionId() != null).collect(Collectors.toList()); }
ArendeDraftServiceImpl implements ArendeDraftService { @Override public List<ArendeDraft> listAnswerDrafts(String intygId) { return arendeDraftRepository.findByIntygId(intygId).stream().filter(d -> d.getQuestionId() != null).collect(Collectors.toList()); } }
ArendeDraftServiceImpl implements ArendeDraftService { @Override public List<ArendeDraft> listAnswerDrafts(String intygId) { return arendeDraftRepository.findByIntygId(intygId).stream().filter(d -> d.getQuestionId() != null).collect(Collectors.toList()); }  }
ArendeDraftServiceImpl implements ArendeDraftService { @Override public List<ArendeDraft> listAnswerDrafts(String intygId) { return arendeDraftRepository.findByIntygId(intygId).stream().filter(d -> d.getQuestionId() != null).collect(Collectors.toList()); }  @Override boolean saveDraft(String intygId, String questionId, String text, String amne); @Override boolean delete(String intygId, String questionId); @Override List<ArendeDraft> listAnswerDrafts(String intygId); @Override ArendeDraft getQuestionDraft(String intygId); }
ArendeDraftServiceImpl implements ArendeDraftService { @Override public List<ArendeDraft> listAnswerDrafts(String intygId) { return arendeDraftRepository.findByIntygId(intygId).stream().filter(d -> d.getQuestionId() != null).collect(Collectors.toList()); }  @Override boolean saveDraft(String intygId, String questionId, String text, String amne); @Override boolean delete(String intygId, String questionId); @Override List<ArendeDraft> listAnswerDrafts(String intygId); @Override ArendeDraft getQuestionDraft(String intygId);  }