Search in sources :

Example 1 with HighestSeverityAboveEntity

use of org.opennms.netmgt.bsm.persistence.api.functions.reduce.HighestSeverityAboveEntity in project opennms by OpenNMS.

the class AbstractBusinessServiceRestServiceIT method verifyHighestSeverityAboveReduceFunction.

@Test
public void verifyHighestSeverityAboveReduceFunction() throws Exception {
    BusinessServiceEntity entity = new BusinessServiceEntityBuilder().name("Dummy Service").reduceFunction(new HighestSeverityAboveEntity(Status.CRITICAL.ordinal())).toEntity();
    sendData(POST, getMediaType(), "/business-services", marshal(toRequestDto(entity)), 201);
    entity.setId(findEntityByName("Dummy Service").getId());
    verifyResponse(entity);
}
Also used : HighestSeverityAboveEntity(org.opennms.netmgt.bsm.persistence.api.functions.reduce.HighestSeverityAboveEntity) BusinessServiceEntity(org.opennms.netmgt.bsm.persistence.api.BusinessServiceEntity) BusinessServiceEntityBuilder(org.opennms.netmgt.bsm.test.BusinessServiceEntityBuilder) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 BusinessServiceEntity (org.opennms.netmgt.bsm.persistence.api.BusinessServiceEntity)1 HighestSeverityAboveEntity (org.opennms.netmgt.bsm.persistence.api.functions.reduce.HighestSeverityAboveEntity)1 BusinessServiceEntityBuilder (org.opennms.netmgt.bsm.test.BusinessServiceEntityBuilder)1