use of se.inera.intyg.webcert.web.service.monitoring.dto.HealthStatus in project webcert by sklintyg.
the class HealthCheckServiceImplTest method testCheckPrivatlakarportalNullResponse.
@Test
public void testCheckPrivatlakarportalNullResponse() {
when(privatlakarportalPingForConfiguration.pingForConfiguration(eq(PP_LOGICAL_ADDRESS), any(PingForConfigurationType.class))).thenReturn(null);
HealthStatus res = service.checkPrivatlakarportal();
assertNotNull(res);
assertFalse(res.isOk());
assertNotNull(res.getMeasurement());
}
use of se.inera.intyg.webcert.web.service.monitoring.dto.HealthStatus in project webcert by sklintyg.
the class HealthCheckServiceImplTest method testCheckNbrOfUsersException.
@Test
public void testCheckNbrOfUsersException() {
when(sessionRegistry.getAllPrincipals()).thenThrow(new RuntimeException());
HealthStatus res = service.checkNbrOfUsers();
assertNotNull(res);
assertFalse(res.isOk());
assertEquals(-1, res.getMeasurement());
}
use of se.inera.intyg.webcert.web.service.monitoring.dto.HealthStatus in project webcert by sklintyg.
the class HealthCheckServiceImplTest method testCheckPrivatlakarportalException.
@Test
public void testCheckPrivatlakarportalException() {
when(privatlakarportalPingForConfiguration.pingForConfiguration(eq(PP_LOGICAL_ADDRESS), any(PingForConfigurationType.class))).thenThrow(new WebServiceException());
HealthStatus res = service.checkPrivatlakarportal();
assertNotNull(res);
assertFalse(res.isOk());
assertNotNull(res.getMeasurement());
}
use of se.inera.intyg.webcert.web.service.monitoring.dto.HealthStatus in project webcert by sklintyg.
the class HealthCheckServiceImplTest method testCheckIntygstjanst.
@Test
public void testCheckIntygstjanst() {
when(intygstjanstPingForConfiguration.pingForConfiguration(eq(IT_LOGICAL_ADDRESS), any(PingForConfigurationType.class))).thenReturn(new PingForConfigurationResponseType());
HealthStatus res = service.checkIntygstjanst();
assertNotNull(res);
assertTrue(res.isOk());
assertNotNull(res.getMeasurement());
}
use of se.inera.intyg.webcert.web.service.monitoring.dto.HealthStatus in project webcert by sklintyg.
the class HealthCheckServiceImplTest method testCheckDBQueryException.
@Test
public void testCheckDBQueryException() {
HealthStatus res = service.checkDB();
assertNotNull(res);
assertFalse(res.isOk());
assertNotNull(res.getMeasurement());
}
Aggregations