use of de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.Message in project spring-boot-admin by codecentric.
the class MicrosoftTeamsNotifierTest method test_getDeregisteredMessageForAppReturns_correctContent.
@Test
void test_getDeregisteredMessageForAppReturns_correctContent() {
Message message = notifier.getDeregisteredMessage(instance, notifier.createEvaluationContext(new InstanceDeregisteredEvent(instance.getId(), 1L), instance));
assertMessage(message, notifier.getDeRegisteredTitle(), notifier.getMessageSummary(), "Test App with id TestAppId has de-registered from Spring Boot Admin", BLUE);
}
use of de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.Message in project spring-boot-admin by codecentric.
the class MicrosoftTeamsNotifierTest method test_getStatusChangedMessage_parsesThemeColorFromSpelExpression.
@Test
void test_getStatusChangedMessage_parsesThemeColorFromSpelExpression() {
notifier.setThemeColor("#{event.type == 'STATUS_CHANGED' ? (event.statusInfo.status=='UP' ? 'green' : 'red') : 'blue'}");
Message message = notifier.getStatusChangedMessage(instance, notifier.createEvaluationContext(new InstanceStatusChangedEvent(instance.getId(), 1L, StatusInfo.ofUp()), instance));
assertThat(message.getThemeColor()).isEqualTo("green");
}
use of de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.Message in project spring-boot-admin by codecentric.
the class MicrosoftTeamsNotifierTest method test_getRegisteredMessageForAppReturns_correctContent.
@Test
void test_getRegisteredMessageForAppReturns_correctContent() {
Message message = notifier.getRegisteredMessage(instance, notifier.createEvaluationContext(new InstanceDeregisteredEvent(instance.getId(), 1L), instance));
assertMessage(message, notifier.getRegisteredTitle(), notifier.getMessageSummary(), "Test App with id TestAppId has registered with Spring Boot Admin", BLUE);
}
Aggregations