Skip to content

Commit

Permalink
Test: fix null failure in watcher test (#31968)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hub-cap authored Jul 11, 2018
1 parent 38e09a1 commit d76293f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down

0 comments on commit d76293f

Please sign in to comment.