use of org.apache.camel.catalog.connector.CamelConnectorCatalog in project camel by apache.
the class MavenArtifactProviderTest method testAddConnector.
@Test
public void testAddConnector() {
CamelCatalog camelCatalog = new DefaultCamelCatalog();
CamelConnectorCatalog camelConnectorCatalog = new DefaultCamelConnectorCatalog();
MavenArtifactProvider provider = new DefaultMavenArtifactProvider();
provider.setCacheDirectory("target/cache");
int before = camelCatalog.findComponentNames().size();
List<ConnectorDto> list = camelConnectorCatalog.findConnector("foo", false);
assertEquals(0, list.size());
Set<String> names = provider.addArtifactToCatalog(camelCatalog, camelConnectorCatalog, "org.apache.camel", "myfoo-connector", camelCatalog.getCatalogVersion());
assertTrue(names.contains("MyFoo"));
int after = camelCatalog.findComponentNames().size();
assertTrue("Should find 1 new component", after - before == 1);
list = camelConnectorCatalog.findConnector("foo", false);
assertEquals(1, list.size());
assertEquals("MyFoo", list.get(0).getName());
assertTrue(camelCatalog.findComponentNames().contains("my-foo"));
}
Aggregations