@Test
public void checkHealthCheck_isHealthy() throws JsonProcessingException {
SortedMap<String,HealthCheck.Result> map = new TreeMap<>();
map.put("postgresql", HealthCheck.Result.healthy());
map.put("deadlocks", HealthCheck.Result.healthy());
when(healthCheckRegistry.runHealthChecks()).thenReturn(map);
Response response = resource.healthCheck();
assertThat(response.getStatus(), is(200));
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
String body = ow.writeValueAsString(response.getEntity());
JsonAssert.with(body)
.assertThat("$.*", hasSize(2))
.assertThat("$.postgresql.healthy", Is.is(true))
.assertThat("$.deadlocks.healthy", Is.is(true));
}
HealthCheckResourceTest.java 文件源码
java
阅读 33
收藏 0
点赞 0
评论 0
项目:pay-publicauth
作者:
评论列表
文章目录