/** * {@link PostConstruct} test. * * @throws ManagerException */ @Test public void postConstructTest() throws ManagerException { // saving initial state final int currentValue = SampleServiceImpl.getPostConstructedAcount(); Manager.register(SampleService.class, SampleServiceFactory.class); Manager.warmUp(); Assert.assertEquals(currentValue + 2, SampleServiceImpl.getPostConstructedAcount()); }
/** * Test {@link Manager} warm up if there services with relations to each other in post-construct. * * @throws ManagerException */ @Test public void twoWayRelationsTest() throws ManagerException { Manager.register(ServiceOne.class, ServiceOneFactory.class); Manager.register(ServiceTwo.class, ServiceTwoFactory.class); Manager.warmUp(); }