use of de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.Message in project spring-boot-admin by codecentric.
the class MicrosoftTeamsNotifierTest method test_getStatusChangedMessageWithExtraFormatArgumentReturns_activitySubtitlePatternWithAppName.
@Test
void test_getStatusChangedMessageWithExtraFormatArgumentReturns_activitySubtitlePatternWithAppName() {
notifier.setStatusActivitySubtitle("STATUS_ACTIVITY_PATTERN_#{instance.registration.name}");
Message message = notifier.getStatusChangedMessage(instance, notifier.createEvaluationContext(new InstanceDeregisteredEvent(instance.getId(), 1L), instance));
assertThat(message.getSections().get(0).getActivitySubtitle()).isEqualTo("STATUS_ACTIVITY_PATTERN_" + appName);
}
use of de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.Message in project spring-boot-admin by codecentric.
the class MicrosoftTeamsNotifierTest method test_getStatusChangedMessageForAppReturns_correctContent.
@Test
void test_getStatusChangedMessageForAppReturns_correctContent() {
Message message = notifier.getStatusChangedMessage(instance, notifier.createEvaluationContext(new InstanceStatusChangedEvent(instance.getId(), 1L, StatusInfo.ofDown()), instance));
assertMessage(message, notifier.getStatusChangedTitle(), notifier.getMessageSummary(), "Test App with id TestAppId changed status from UNKNOWN to DOWN", RED);
}
use of de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.Message in project spring-boot-admin by codecentric.
the class MicrosoftTeamsNotifierTest method test_getDeRegisterMessageWithExtraFormatArgumentReturns_activitySubtitlePatternWithAppName.
@Test
void test_getDeRegisterMessageWithExtraFormatArgumentReturns_activitySubtitlePatternWithAppName() {
notifier.setDeregisterActivitySubtitle("DEREGISTER_ACTIVITY_PATTERN_#{instance.registration.name}");
Message message = notifier.getDeregisteredMessage(instance, notifier.createEvaluationContext(new InstanceDeregisteredEvent(instance.getId(), 1L), instance));
assertThat(message.getSections().get(0).getActivitySubtitle()).isEqualTo("DEREGISTER_ACTIVITY_PATTERN_" + appName);
}
use of de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.Message in project spring-boot-admin by codecentric.
the class MicrosoftTeamsNotifierTest method test_getStatusChangedMessageForAppReturns_UP_to_DOWN.
@Test
void test_getStatusChangedMessageForAppReturns_UP_to_DOWN() {
notifier.updateLastStatus(new InstanceStatusChangedEvent(instance.getId(), 1L, StatusInfo.ofUp()));
Message message = notifier.getStatusChangedMessage(instance, notifier.createEvaluationContext(new InstanceStatusChangedEvent(instance.getId(), 1L, StatusInfo.ofDown()), instance));
assertMessage(message, notifier.getStatusChangedTitle(), notifier.getMessageSummary(), "Test App with id TestAppId changed status from UP to DOWN", RED);
}
use of de.codecentric.boot.admin.server.notify.MicrosoftTeamsNotifier.Message in project spring-boot-admin by codecentric.
the class MicrosoftTeamsNotifierTest method test_getRegisterMessageWithExtraFormatArgumentReturns_activitySubtitlePatternWithAppName.
@Test
void test_getRegisterMessageWithExtraFormatArgumentReturns_activitySubtitlePatternWithAppName() {
notifier.setRegisterActivitySubtitle("REGISTER_ACTIVITY_PATTERN_#{instance.registration.name}");
Message message = notifier.getRegisteredMessage(instance, notifier.createEvaluationContext(new InstanceDeregisteredEvent(instance.getId(), 1L), instance));
assertThat(message.getSections().get(0).getActivitySubtitle()).isEqualTo("REGISTER_ACTIVITY_PATTERN_" + appName);
}
Aggregations