use of se.inera.intyg.webcert.web.service.monitoring.dto.HealthStatus in project webcert by sklintyg.
the class HealthCheckServiceImplTest method testCheckSignatureQueueException.
@SuppressWarnings("unchecked")
@Test
public void testCheckSignatureQueueException() {
when(jmsCertificateSenderTemplate.browse(any(BrowserCallback.class))).thenThrow(new RuntimeException(""));
HealthStatus res = service.checkSignatureQueue();
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 testCheckJMS.
@Test
public void testCheckJMS() throws JMSException {
when(connectionFactory.createConnection()).thenReturn(mock(Connection.class));
HealthStatus res = service.checkJMS();
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 testCheckIntygstjanstException.
@Test
public void testCheckIntygstjanstException() {
when(intygstjanstPingForConfiguration.pingForConfiguration(eq(IT_LOGICAL_ADDRESS), any(PingForConfigurationType.class))).thenThrow(new WebServiceException());
HealthStatus res = service.checkIntygstjanst();
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 testCheckIntygstjanstNullResponse.
@Test
public void testCheckIntygstjanstNullResponse() {
when(intygstjanstPingForConfiguration.pingForConfiguration(eq(IT_LOGICAL_ADDRESS), any(PingForConfigurationType.class))).thenReturn(null);
HealthStatus res = service.checkIntygstjanst();
assertNotNull(res);
assertFalse(res.isOk());
assertNotNull(res.getMeasurement());
verify(intygstjanstPingForConfiguration).pingForConfiguration(eq(IT_LOGICAL_ADDRESS), any(PingForConfigurationType.class));
}
use of se.inera.intyg.webcert.web.service.monitoring.dto.HealthStatus in project webcert by sklintyg.
the class HealthCheckServiceImplTest method testCheckNbrOfUsers.
@Test
public void testCheckNbrOfUsers() {
when(sessionRegistry.getAllPrincipals()).thenReturn(Arrays.asList("principal1", "principal2"));
HealthStatus res = service.checkNbrOfUsers();
assertNotNull(res);
assertTrue(res.isOk());
assertEquals(2, res.getMeasurement());
}
Aggregations