Tests: Log HTTP requests/response for external hipchat tests

Relates elastic/x-pack-elasticsearch#1774

Original commit: elastic/x-pack-elasticsearch@bdd86236e2
This commit is contained in:
Alexander Reelsen 2017-06-20 10:47:42 +02:00
parent 27731eb523
commit 6e6629bd18
1 changed files with 2 additions and 0 deletions

View File

@ -199,6 +199,8 @@ public class HipChatServiceTests extends AbstractWatcherIntegrationTestCase {
private void assertSentMessagesAreValid(int expectedMessageSize, SentMessages messages) {
assertThat(messages.count(), is(expectedMessageSize));
for (SentMessages.SentMessage message : messages) {
logger.info("Request: [{}]", message.getRequest());
logger.info("Response: [{}]", message.getResponse());
assertThat("Expected no failures, but got [" + message.getFailureReason() + "]", message.successful(), is(true));
assertThat(message.getRequest(), notNullValue());
assertThat(message.getResponse(), notNullValue());