use of io.crnk.core.module.discovery.DefaultServiceDiscoveryFactory 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);
}
use of io.crnk.core.module.discovery.DefaultServiceDiscoveryFactory in project crnk-framework by crnk-project.
the class CdiTransactionRunnerTest method setup.
@Before
public void setup() {
DefaultServiceDiscoveryFactory factory = new DefaultServiceDiscoveryFactory();
ServiceDiscovery instance = factory.getInstance();
List<TransactionRunner> runners = instance.getInstancesByType(TransactionRunner.class);
Assert.assertEquals(1, runners.size());
runner = runners.get(0);
}
Aggregations