Hello guys !!
I have a slight issue, easy to fix I am sure but I do not see it
I am using JUNIT to test some classes :
In testFake() I have a calling like that :Code:@RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "classpath:/applicationContext.xml", "classpath:/BapplicationContext.xml", "classpath:/applicationBusinessContext.xml" }) @TransactionConfiguration(transactionManager = "hibernateTransactionManager",defaultRollback = true) @Transactional(propagation = Propagation.NOT_SUPPORTED) public class ABServicesTest extends AbstractTransactionalJUnit4SpringContextTests { @Autowired private ABServices ABServices; @Test public void test123() { testFake(); }
But when it tries to retreive the bean , I have ContextLoader.getCurrentWebApplicationContext() = null.Code:public final class StaticUtils { private static final IAService A_SERVICE = (IAService)ContextLoader.getCurrentWebApplicationContext().getBean("iAService");
I need to inject the ContextLoader from the test context or instantiate a new ContextLoader ?
What do I have to do to initialize ContextLoader.getCurrentWebApplicationContext() ?
It seems trivial but I do not see it
Thanks



Reply With Quote
