Search in sources :

Example 11 with ArendeDraft

use of se.inera.intyg.webcert.persistence.arende.model.ArendeDraft in project webcert by sklintyg.

the class ArendeDraftServiceImplTest method testGetQuestionDraft.

@Test
public void testGetQuestionDraft() {
    final String intygId = "intygId";
    when(repo.findByIntygIdAndQuestionId(intygId, null)).thenReturn(buildArendeDraft(intygId, null, null, null));
    ArendeDraft res = arendeDraftService.getQuestionDraft(intygId);
    assertNotNull(res);
    assertEquals(intygId, res.getIntygId());
    verify(repo).findByIntygIdAndQuestionId(intygId, null);
    verifyNoMoreInteractions(repo);
}
Also used : ArendeDraft(se.inera.intyg.webcert.persistence.arende.model.ArendeDraft) Test(org.junit.Test)

Aggregations

ArendeDraft (se.inera.intyg.webcert.persistence.arende.model.ArendeDraft)11 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Map (java.util.Map)2 Objects (java.util.Objects)2 Collectors (java.util.stream.Collectors)2 Logger (org.slf4j.Logger)2 LoggerFactory (org.slf4j.LoggerFactory)2 Autowired (org.springframework.beans.factory.annotation.Autowired)2 AnsweredWithIntygUtil (se.inera.intyg.webcert.web.converter.util.AnsweredWithIntygUtil)2 FrageStallare (se.inera.intyg.webcert.web.service.fragasvar.dto.FrageStallare)2 AnsweredWithIntyg (se.inera.intyg.webcert.web.web.controller.api.dto.AnsweredWithIntyg)2 Preconditions (com.google.common.base.Preconditions)1 Strings (com.google.common.base.Strings)1 Throwables (com.google.common.base.Throwables)1 ImmutableList (com.google.common.collect.ImmutableList)1 LocalDateTime (java.time.LocalDateTime)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1