@Test
public void message_invokesWebhook() throws Exception {

    // Given a running notifier
    notifier.onApplicationEvent(mock(ApplicationReadyEvent.class));
    // ... and a webhook that responds
    webhook.enqueue(new MockResponse());
    // When a mapped metric is sent in json to the kafka topic
    String json = notifierConfig.objectMapper().writeValueAsString(newMappedMetricData());
    kafka.helper().produceStrings(notifierConfig.getKafkaTopic(), json);
    // Then, the notifier POSTs the json from the message into the webhook
    RecordedRequest webhookRequest = webhook.takeRequest();
    Assertions.assertThat(webhookRequest.getMethod())
            .isEqualTo("POST");
    Assertions.assertThat(webhookRequest.getBody().readUtf8())
            .isEqualTo(json);
}