Search in sources :

Example 1 with SystemMessageSeverity

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);
}
Also used : SystemMessageSeverity(com.synopsys.integration.alert.common.enumeration.SystemMessageSeverity) AlertIntegrationTest(com.synopsys.integration.alert.util.AlertIntegrationTest) Test(org.junit.jupiter.api.Test)

Example 2 with SystemMessageSeverity

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());
}
Also used : SystemMessageSeverity(com.synopsys.integration.alert.common.enumeration.SystemMessageSeverity) AlertIntegrationTest(com.synopsys.integration.alert.util.AlertIntegrationTest) Test(org.junit.jupiter.api.Test)

Aggregations

SystemMessageSeverity (com.synopsys.integration.alert.common.enumeration.SystemMessageSeverity)2 AlertIntegrationTest (com.synopsys.integration.alert.util.AlertIntegrationTest)2 Test (org.junit.jupiter.api.Test)2