public void testRegisterContextAfterRequest() throws Exception {
EventContext ctx = new EventContextImpl();
RequestScopeContext scope = new RequestScopeContext(ctx);
scope.registerFactories(createConfigurations());
scope.start();
RequestScopeComponent comp1 = (RequestScopeComponent) scope.getContext("TestService1").getInstance(null);
Assert.assertNotNull(comp1);
scope.registerFactory(createConfiguration("NewTestService"));
RequestScopeComponent comp2 = (RequestScopeComponent) scope.getContext("NewTestService").getInstance(null);
Assert.assertNotNull(comp2);
Object id = new Object();
scope.onEvent(new RequestEnd(this,id));
scope.stop();
}