@Test @JUnitHttpServer(port=10342, https=false, webapps={ @Webapp(context="/fmpm", path="src/test/resources/test-webapp") }) public void testForwardAlarms() throws Exception { TestServlet.reset(); NCSNorthbounderConfig config = new NCSNorthbounderConfig(); config.setScheme("http"); config.setHost("localhost"); config.setPort(10342); config.setPath("/fmpm/restful/NotificationMessageRelay"); config.setMethod(HttpMethod.POST); NCSNorthbounder nb = new NCSNorthbounder(config); List<NorthboundAlarm> alarms = Arrays.asList(alarm(1), alarm(2), alarm(3), alarm(4)); nb.forwardAlarms(alarms); assertEquals(xml, TestServlet.getPosted()); }
@Override public void forwardAlarms(List<NorthboundAlarm> alarms) throws NorthbounderException { if (!m_config.isEnabled()) return; LogUtils.infof(this, "Forwarding %d alarms", alarms.size()); HttpEntity entity = createEntity(alarms); postAlarms(entity); }
NCSNorthbounder extends AbstractNorthbounder { @Override public void forwardAlarms(List<NorthboundAlarm> alarms) throws NorthbounderException { if (!m_config.isEnabled()) return; LogUtils.infof(this, "Forwarding %d alarms", alarms.size()); HttpEntity entity = createEntity(alarms); postAlarms(entity); } }
NCSNorthbounder extends AbstractNorthbounder { @Override public void forwardAlarms(List<NorthboundAlarm> alarms) throws NorthbounderException { if (!m_config.isEnabled()) return; LogUtils.infof(this, "Forwarding %d alarms", alarms.size()); HttpEntity entity = createEntity(alarms); postAlarms(entity); } NCSNorthbounder(NCSNorthbounderConfig config); }
NCSNorthbounder extends AbstractNorthbounder { @Override public void forwardAlarms(List<NorthboundAlarm> alarms) throws NorthbounderException { if (!m_config.isEnabled()) return; LogUtils.infof(this, "Forwarding %d alarms", alarms.size()); HttpEntity entity = createEntity(alarms); postAlarms(entity); } NCSNorthbounder(NCSNorthbounderConfig config); @Override boolean accepts(NorthboundAlarm alarm); @Override void forwardAlarms(List<NorthboundAlarm> alarms); NCSNorthbounderConfig getConfig(); void setConfig(NCSNorthbounderConfig config); }
NCSNorthbounder extends AbstractNorthbounder { @Override public void forwardAlarms(List<NorthboundAlarm> alarms) throws NorthbounderException { if (!m_config.isEnabled()) return; LogUtils.infof(this, "Forwarding %d alarms", alarms.size()); HttpEntity entity = createEntity(alarms); postAlarms(entity); } NCSNorthbounder(NCSNorthbounderConfig config); @Override boolean accepts(NorthboundAlarm alarm); @Override void forwardAlarms(List<NorthboundAlarm> alarms); NCSNorthbounderConfig getConfig(); void setConfig(NCSNorthbounderConfig config);  }