use of com.synopsys.integration.alert.common.enumeration.SystemMessageSeverity in project hub-alert by blackducksoftware.
the class SystemMessageAccessorTestIT method testRemoveSystemMessagesByType.
@Test
public void testRemoveSystemMessagesByType() {
List<SystemMessageEntity> expectedMessages = createSystemMessageList();
systemMessageRepository.saveAll(expectedMessages);
final SystemMessageSeverity systemMessageSeverity = SystemMessageSeverity.WARNING;
defaultSystemMessageUtility.addSystemMessage("message 1", systemMessageSeverity, SystemMessageType.ENCRYPTION_CONFIGURATION_ERROR);
defaultSystemMessageUtility.addSystemMessage("message 2", systemMessageSeverity, SystemMessageType.ENCRYPTION_CONFIGURATION_ERROR);
List<SystemMessageEntity> savedMessages = systemMessageRepository.findAll();
assertEquals(MESSAGE_COUNT + 2, savedMessages.size());
defaultSystemMessageUtility.removeSystemMessagesByType(SystemMessageType.ENCRYPTION_CONFIGURATION_ERROR);
List<SystemMessageEntity> actualMessageList = systemMessageRepository.findAll();
assertNotNull(actualMessageList);
assertEquals(MESSAGE_COUNT, actualMessageList.size());
assertEquals(expectedMessages, actualMessageList);
}
use of com.synopsys.integration.alert.common.enumeration.SystemMessageSeverity in project hub-alert by blackducksoftware.
the class SystemMessageAccessorTestIT method testAddSystemMessage.
@Test
public void testAddSystemMessage() {
final String content = "add message test content";
final SystemMessageSeverity systemMessageSeverity = SystemMessageSeverity.WARNING;
defaultSystemMessageUtility.addSystemMessage(content, systemMessageSeverity, SystemMessageType.ENCRYPTION_CONFIGURATION_ERROR);
List<SystemMessageEntity> actualMessageList = systemMessageRepository.findAll();
assertEquals(1, actualMessageList.size());
SystemMessageEntity actualMessage = actualMessageList.get(0);
assertEquals(content, actualMessage.getContent());
assertEquals(systemMessageSeverity.name(), actualMessage.getSeverity());
}
Aggregations