}
@Test
public void replaceActivator() throws Exception {
InputStream config = Classes.getResourceAsStream("/switchyard-config-mock-01.xml", getClass());
SwitchYard sy = new SwitchYard(config);
// Remove the old activator if it exists
Iterator<Activator> activators = sy.getActivatorList().iterator();
while (activators.hasNext()) {
Activator activator = activators.next();
if (activator.canActivate("mock")) {
activators.remove();
}
}
// Add new activator
MockActivator mock = new MockActivator();
sy.getActivatorList().add(mock);
sy.start();
Assert.assertTrue(mock.activationCalled);
config.close();
}