use of se.inera.intyg.webcert.web.service.monitoring.dto.HealthStatus in project webcert by sklintyg.
the class HealthCheckServiceImplTest method testCheckJMSException.
@Test
public void testCheckJMSException() throws JMSException {
when(connectionFactory.createConnection()).thenThrow(new JMSException(""));
HealthStatus res = service.checkJMS();
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 testCheckDB.
@Test
public void testCheckDB() {
Query query = mock(Query.class);
when(query.getSingleResult()).thenReturn(mock(Time.class));
when(entityManager.createNativeQuery(anyString())).thenReturn(query);
HealthStatus res = service.checkDB();
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 testCheckSignatureQueue.
@SuppressWarnings("unchecked")
@Test
public void testCheckSignatureQueue() {
final int queueDepth = 5;
when(jmsCertificateSenderTemplate.browse(any(BrowserCallback.class))).thenReturn(queueDepth);
HealthStatus res = service.checkSignatureQueue();
assertNotNull(res);
assertTrue(res.isOk());
assertEquals(queueDepth, res.getMeasurement());
}
use of se.inera.intyg.webcert.web.service.monitoring.dto.HealthStatus in project webcert by sklintyg.
the class HealthCheckServiceImplTest method testCheckDBTimestampNull.
@Test
public void testCheckDBTimestampNull() {
Query query = mock(Query.class);
when(entityManager.createNativeQuery(anyString())).thenReturn(query);
HealthStatus res = service.checkDB();
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 testCheckUptime.
@Test
public void testCheckUptime() {
HealthStatus res = service.checkUptime();
assertNotNull(res);
assertTrue(res.isOk());
assertNotNull(res.getMeasurement());
}
Aggregations