Test: fix null failure in watcher test (#31968)

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
This commit is contained in:
Michael Basnight 2018-07-11 09:37:48 -05:00 committed by GitHub
parent 38e09a1508
commit d76293f990
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -461,7 +461,6 @@ public class SlackMessageTests extends ESTestCase {
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 class SlackMessageTests extends ESTestCase {
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();