Search in sources :

Example 11 with FragorOchSvar

use of se.inera.intyg.common.support.modules.support.api.notification.FragorOchSvar in project webcert by sklintyg.

the class FragorOchSvarCreatorTest method testPerformCountHan8.

@Test
public void testPerformCountHan8() {
    when(fragaSvarRepository.findFragaSvarStatusesForIntyg(INTYG_ID)).thenReturn(Collections.singletonList(new FragaSvarStatus(1L, FRAGESTALLARE_WEBCERT, null, Status.PENDING_EXTERNAL_ACTION)));
    FragorOchSvar fos = fsCreator.createFragorOchSvar(INTYG_ID);
    assertNotNull(fos);
    assertEquals(0, fos.getAntalFragor());
    assertEquals(0, fos.getAntalHanteradeFragor());
    assertEquals(0, fos.getAntalSvar());
    assertEquals(0, fos.getAntalHanteradeSvar());
    verify(fragaSvarRepository).findFragaSvarStatusesForIntyg(INTYG_ID);
    verifyNoMoreInteractions(fragaSvarRepository);
    verifyNoMoreInteractions(arendeRepository);
}
Also used : FragorOchSvar(se.inera.intyg.common.support.modules.support.api.notification.FragorOchSvar) FragaSvarStatus(se.inera.intyg.webcert.persistence.fragasvar.model.FragaSvarStatus) Test(org.junit.Test)

Example 12 with FragorOchSvar

use of se.inera.intyg.common.support.modules.support.api.notification.FragorOchSvar in project webcert by sklintyg.

the class FragorOchSvarCreatorImpl method createFragorOchSvar.

/*
     * (non-Javadoc)
     *
     * @see se.inera.intyg.webcert.web.service.notification.FragorOchSvarCreator#
     * createFragorOchSvar(java.lang.String)
     */
@Override
public FragorOchSvar createFragorOchSvar(String intygsId) {
    FragorOchSvar fs = performCount(fragaSvarRepository.findFragaSvarStatusesForIntyg(intygsId));
    LOG.debug("Created FragorOchSvar ({}) for intyg {}", fs.toString(), intygsId);
    return fs;
}
Also used : FragorOchSvar(se.inera.intyg.common.support.modules.support.api.notification.FragorOchSvar)

Aggregations

FragorOchSvar (se.inera.intyg.common.support.modules.support.api.notification.FragorOchSvar)12 Test (org.junit.Test)8 FragaSvarStatus (se.inera.intyg.webcert.persistence.fragasvar.model.FragaSvarStatus)8 NotificationMessage (se.inera.intyg.common.support.modules.support.api.notification.NotificationMessage)3 LocalDateTime (java.time.LocalDateTime)2 Fk7263EntryPoint (se.inera.intyg.common.fk7263.support.Fk7263EntryPoint)1 ArendeCount (se.inera.intyg.common.support.modules.support.api.notification.ArendeCount)1 Utkast (se.inera.intyg.webcert.persistence.utkast.model.Utkast)1