use of org.apache.activemq.artemis.tests.unit.core.config.impl.fakes.FakeConnectorService in project activemq-artemis by apache.
the class ConnectorsServiceTest method testConnectorsServiceUsesInjectedConnectorServiceFactory.
/**
* Test that the connectors added via the service registry are added to the connectorsService,
*
* @throws Exception
*/
@Test
public void testConnectorsServiceUsesInjectedConnectorServiceFactory() throws Exception {
ConnectorServiceConfiguration connectorServiceConfiguration = new ConnectorServiceConfiguration().setFactoryClassName(null).setParams(new HashMap<String, Object>()).setName("myfact");
// Creates a fake connector service factory that returns the fake connector service object
ConnectorService connectorService = new FakeConnectorService();
FakeConnectorServiceFactory connectorServiceFactory = new FakeConnectorServiceFactory();
serviceRegistry.addConnectorService(connectorServiceFactory, connectorServiceConfiguration);
ConnectorsService connectorsService = new ConnectorsService(configuration, null, null, null, serviceRegistry);
connectorsService.start();
assertTrue(connectorsService.getConnectors().size() == 1);
assertTrue(connectorsService.getConnectors().values().contains(connectorServiceFactory.getConnectorService()));
}
Aggregations