From 4a8623113084b546c786122e9aba955a7f35b04c Mon Sep 17 00:00:00 2001 From: Michael Basnight Date: Wed, 11 Jul 2018 09:30:20 -0500 Subject: [PATCH] Test: fix null failure in watcher test A new commit was merged that does not allow a null attachement && text. This is valid for the slack API, as it does not allow this, but our unit tests did. This commit fixes the broken unit test. Closes #31948 --- .../watcher/notification/slack/message/SlackMessageTests.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessageTests.java b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessageTests.java index 740501eec4f51..83e2e9978391a 100644 --- a/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessageTests.java +++ b/x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessageTests.java @@ -461,7 +461,6 @@ public void testTemplateParseSelfGenerated() throws Exception { assertThat(parsed, equalTo(template)); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31948") public void testTemplateRender() throws Exception { Settings settings = SlackMessageDefaultsTests.randomSettings(); SlackMessageDefaults defaults = new SlackMessageDefaults(settings); @@ -482,7 +481,7 @@ public void testTemplateRender() throws Exception { if (randomBoolean()) { templateBuilder.setText(randomAlphaOfLength(10)); } - if (randomBoolean()) { + if (templateBuilder.text == null || randomBoolean()) { int count = randomIntBetween(0, 3); for (int i = 0; i < count; i++) { Attachment.Template.Builder attachmentBuilder = createRandomAttachmentTemplateBuilder();