Search in sources :

Example 21 with EventAnticipator

use of org.opennms.netmgt.dao.mock.EventAnticipator in project opennms by OpenNMS.

the class RequisitionRestServiceIT method testImportNoRescan.

@Test
public void testImportNoRescan() throws Exception {
    createRequisition();
    EventAnticipator anticipator = m_eventProxy.getEventAnticipator();
    sendRequest(PUT, "/requisitions/test/import", parseParamData("rescanExisting=false"), 202);
    assertEquals(1, anticipator.getUnanticipatedEvents().size());
    final Event event = anticipator.getUnanticipatedEvents().iterator().next();
    final List<Parm> parms = event.getParmCollection();
    assertEquals(2, parms.size());
    assertEquals("false", parms.get(1).getValue().getContent());
}
Also used : Event(org.opennms.netmgt.xml.event.Event) Parm(org.opennms.netmgt.xml.event.Parm) EventAnticipator(org.opennms.netmgt.dao.mock.EventAnticipator) Test(org.junit.Test)

Aggregations

EventAnticipator (org.opennms.netmgt.dao.mock.EventAnticipator)21 Test (org.junit.Test)17 EventBuilder (org.opennms.netmgt.model.events.EventBuilder)11 Event (org.opennms.netmgt.xml.event.Event)8 OnmsNode (org.opennms.netmgt.model.OnmsNode)7 InetAddress (java.net.InetAddress)6 JUnitSnmpAgents (org.opennms.core.test.snmp.annotations.JUnitSnmpAgents)4 Date (java.util.Date)2 DiscoveryConfiguration (org.opennms.netmgt.config.discovery.DiscoveryConfiguration)2 IncludeRange (org.opennms.netmgt.config.discovery.IncludeRange)2 OnmsIpInterface (org.opennms.netmgt.model.OnmsIpInterface)2 Parm (org.opennms.netmgt.xml.event.Parm)2 File (java.io.File)1 FileWriter (java.io.FileWriter)1 BigInteger (java.math.BigInteger)1 DateFormat (java.text.DateFormat)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Before (org.junit.Before)1 JUnitSnmpAgent (org.opennms.core.test.snmp.annotations.JUnitSnmpAgent)1 DiscoveryConfigFactory (org.opennms.netmgt.config.DiscoveryConfigFactory)1