use of org.opennms.netmgt.config.TrapdConfig in project opennms by OpenNMS.
the class TrapdConfigReloadIT method verifyReload.
@Test
public void verifyReload() throws Exception {
// Check that it has not yet been refreshed
TrapdConfig trapdConfig = getOsgiService(TrapdConfig.class);
Assert.assertEquals(true, trapdConfig.getSnmpV3Users().isEmpty());
// The setSnmpV3Users method must have been invoked
Thread.sleep(20000);
// Verify
Assert.assertEquals(1, trapdConfig.getSnmpV3Users().size());
}
use of org.opennms.netmgt.config.TrapdConfig in project opennms by OpenNMS.
the class TrapSinkModuleTest method testEqualsAndHashCode.
@Test
public void testEqualsAndHashCode() throws Exception {
SinkModule<Message, Message> mockModule = Mockito.mock(SinkModule.class);
Mockito.when(mockModule.getId()).thenReturn("id");
OnmsDistPoller distPollerMock = Mockito.mock(OnmsDistPoller.class);
TrapdConfig config = new TrapdConfigBean();
final TrapSinkModule module = new TrapSinkModule(config, distPollerMock);
Assert.assertEquals(module, module);
Assert.assertEquals(module.hashCode(), module.hashCode());
final TrapSinkModule other = new TrapSinkModule(config, distPollerMock);
Assert.assertEquals(module, other);
Assert.assertEquals(module.hashCode(), other.hashCode());
Assert.assertNotEquals(module, mockModule);
Assert.assertNotEquals(module.hashCode(), mockModule.hashCode());
}
Aggregations