use of io.crnk.internal.boot.cdi.model.ProjectRepository in project crnk-framework by crnk-project.
the class CdiServiceDiscoveryTest method testFactory.
@Test
public void testFactory() {
DefaultServiceDiscoveryFactory factory = new DefaultServiceDiscoveryFactory();
ServiceDiscovery instance = factory.getInstance();
Assert.assertNotNull(instance);
Assert.assertEquals(CdiServiceDiscovery.class, instance.getClass());
List<?> repositories = instance.getInstancesByType(Repository.class);
Assert.assertEquals(1, repositories.size());
Assert.assertTrue(repositories.get(0) instanceof ProjectRepository);
repositories = instance.getInstancesByAnnotation(JsonApiResourceRepository.class);
Assert.assertEquals(1, repositories.size());
Assert.assertTrue(repositories.get(0) instanceof TaskRepository);
}
Aggregations