RequestScopeContext scope = new RequestScopeContext(ctx);
scope.registerFactories(createConfigurations());
scope.start();
// first request
RequestScopeComponentImpl comp1 = (RequestScopeComponentImpl) scope.getContext("TestService1").getInstance(null);
Assert.assertNotNull(comp1);
Object id = new Object();
scope.onEvent(new RequestEnd(this,id));
// second request
RequestScopeComponentImpl comp2 = (RequestScopeComponentImpl) scope.getContext("TestService1").getInstance(null);
Assert.assertNotNull(comp2);
Assert.assertNotSame(comp1, comp2);
Object id2 = new Object();
scope.onEvent(new RequestEnd(this,id2));