.withTimestamp(new DateTime())
.withFromType(AlertType.OK)
.withToType(AlertType.ERROR);
List<Alert> alerts = Arrays.asList(alert);
BodyCapture<JsonNode> bodyCapture = new JsonBodyCapture();
clientDriver.addExpectation(
onRequestTo("/v1/messages/chat/target")
.withMethod(ClientDriverRequest.Method.POST)
.capturingBodyIn(bodyCapture)
.withHeader("Content-Type", "application/json")
.withHeader("accept", "application/json"),
giveEmptyResponse());
notificationService.sendNotification(check, subscription, alerts);
JsonNode node = bodyCapture.getContent();
assertThat(node, hasJsonPath("$.content", containsString("test-check")));
assertThat(node, hasJsonPath("$.content", containsString("ERROR")));
assertThat(node, hasJsonPath("$.content", containsString(value.toString())));
assertThat(node, hasJsonPath("$.content", containsString("/#/checks/123")));