Skip to content

Commit 4a86231

Browse files
committed
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 elastic#31948
1 parent 38e09a1 commit 4a86231

File tree

1 file changed

+1
-2
lines changed
  • x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/slack/message

1 file changed

+1
-2
lines changed

x-pack/plugin/watcher/src/test/java/org/elasticsearch/xpack/watcher/notification/slack/message/SlackMessageTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@ public void testTemplateParseSelfGenerated() throws Exception {
461461
assertThat(parsed, equalTo(template));
462462
}
463463

464-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31948")
465464
public void testTemplateRender() throws Exception {
466465
Settings settings = SlackMessageDefaultsTests.randomSettings();
467466
SlackMessageDefaults defaults = new SlackMessageDefaults(settings);
@@ -482,7 +481,7 @@ public void testTemplateRender() throws Exception {
482481
if (randomBoolean()) {
483482
templateBuilder.setText(randomAlphaOfLength(10));
484483
}
485-
if (randomBoolean()) {
484+
if (templateBuilder.text == null || randomBoolean()) {
486485
int count = randomIntBetween(0, 3);
487486
for (int i = 0; i < count; i++) {
488487
Attachment.Template.Builder attachmentBuilder = createRandomAttachmentTemplateBuilder();

0 commit comments

Comments
 (0)