Search in sources :

Example 11 with BusinessServiceSearchCriteriaBuilder

use of org.opennms.netmgt.bsm.service.BusinessServiceSearchCriteriaBuilder in project opennms by OpenNMS.

the class BusinessServiceCriteriaTest method testOrderBySeverityDescAndLimit.

@Test
public void testOrderBySeverityDescAndLimit() {
    BusinessServiceSearchCriteriaBuilder b = new BusinessServiceSearchCriteriaBuilder().order(BusinessServiceSearchCriteriaBuilder.Order.Severity).desc().limit(5);
    assertEquals(ImmutableList.<BusinessService>builder().add(bs7, bs6, bs5, bs4, bs3).build(), businessServiceManager.search(b));
}
Also used : BusinessServiceSearchCriteriaBuilder(org.opennms.netmgt.bsm.service.BusinessServiceSearchCriteriaBuilder) Test(org.junit.Test)

Aggregations

BusinessServiceSearchCriteriaBuilder (org.opennms.netmgt.bsm.service.BusinessServiceSearchCriteriaBuilder)11 Test (org.junit.Test)6 BusinessService (org.opennms.netmgt.bsm.service.model.BusinessService)4 List (java.util.List)2 Collectors (java.util.stream.Collectors)2 Query (org.opennms.features.status.api.Query)2 StatusEntity (org.opennms.features.status.api.StatusEntity)2 StatusEntityWrapper (org.opennms.features.status.api.StatusEntityWrapper)2 StatusSummary (org.opennms.features.status.api.StatusSummary)2 BusinessServiceManager (org.opennms.netmgt.bsm.service.BusinessServiceManager)2 Status (org.opennms.netmgt.bsm.service.model.Status)2 OnmsSeverity (org.opennms.netmgt.model.OnmsSeverity)2 QueryParameters (org.opennms.web.utils.QueryParameters)2 Autowired (org.springframework.beans.factory.annotation.Autowired)2 Service (org.springframework.stereotype.Service)2 HashMap (java.util.HashMap)1 ModelAndView (org.springframework.web.servlet.ModelAndView)1