Commit 6ecb99e0 by Johannes Edmeier

Merge branch '1.3.x'

parents 7861033b 2bb88304
...@@ -77,11 +77,11 @@ public class SlackNotifier extends AbstractStatusChangeNotifier { ...@@ -77,11 +77,11 @@ public class SlackNotifier extends AbstractStatusChangeNotifier {
this.username = username; this.username = username;
} }
public void setMessage(Expression message) { public void setMessage(String message) {
this.message = message; this.message = parser.parseExpression(message, ParserContext.TEMPLATE_EXPRESSION);
} }
private Object createMessage(ClientApplicationStatusChangedEvent event) { protected Object createMessage(ClientApplicationStatusChangedEvent event) {
Map<String, Object> messageJson = new HashMap<>(); Map<String, Object> messageJson = new HashMap<>();
messageJson.put("username", username); messageJson.put("username", username);
if (icon != null) { if (icon != null) {
......
...@@ -14,9 +14,6 @@ import javax.annotation.Nullable; ...@@ -14,9 +14,6 @@ import javax.annotation.Nullable;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.springframework.expression.Expression;
import org.springframework.expression.ParserContext;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import de.codecentric.boot.admin.event.ClientApplicationStatusChangedEvent; import de.codecentric.boot.admin.event.ClientApplicationStatusChangedEvent;
...@@ -93,9 +90,7 @@ public class SlackNotifierTest { ...@@ -93,9 +90,7 @@ public class SlackNotifierTest {
StatusInfo infoDown = StatusInfo.ofDown(); StatusInfo infoDown = StatusInfo.ofDown();
StatusInfo infoUp = StatusInfo.ofUp(); StatusInfo infoUp = StatusInfo.ofUp();
Expression expression = new SpelExpressionParser().parseExpression(message, notifier.setMessage(message);
ParserContext.TEMPLATE_EXPRESSION);
notifier.setMessage(expression);
notifier.setChannel(channel); notifier.setChannel(channel);
notifier.setIcon(icon); notifier.setIcon(icon);
notifier.notify(getEvent(infoDown, infoUp)); notifier.notify(getEvent(infoDown, infoUp));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment