public class org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate extends java.lang.Object
{
public final org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery context;
private org.apache.isis.core.security.authentication.manager.AuthenticationManager authMgr;
protected org.apache.wicket.request.Request mockRequest;
protected org.apache.isis.core.security.authentication.Authenticator mockAuthenticator;
protected org.apache.isis.core.runtime.context.IsisAppCommonContext mockCommonContext;
protected org.apache.isis.applib.services.iactnlayer.InteractionService mockInteractionService;
protected org.apache.isis.applib.services.user.ImpersonatedUserHolder mockImpersonatedUserHolder;
protected org.apache.isis.applib.services.iactnlayer.InteractionLayerTracker mockInteractionLayerTracker;
protected org.apache.isis.applib.services.registry.ServiceRegistry mockServiceRegistry;
protected org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis webSession;
public void <init>()
{
org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate v;
org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2$Mode v;
org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery v;
v := @this: org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate;
specialinvoke v.<java.lang.Object: void <init>()>();
v = <org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2$Mode: org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2$Mode INTERFACES_AND_CLASSES>;
v = staticinvoke <org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2: org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery createFor(org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2$Mode)>(v);
v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery context> = v;
return;
}
public void setUp() throws java.lang.Exception
{
org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate v;
org.apache.isis.core.security.authentication.manager.AuthenticationManager v;
org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery v;
java.util.List v, v;
org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate$1 v;
org.apache.isis.core.security.authentication.standard.RandomCodeGeneratorDefault v;
org.apache.isis.core.security.authentication.Authenticator v;
org.apache.isis.core.security._testing.InteractionService_forTesting v;
v := @this: org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate;
v = new org.apache.isis.core.security.authentication.manager.AuthenticationManager;
v = v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: org.apache.isis.core.security.authentication.Authenticator mockAuthenticator>;
v = staticinvoke <java.util.Collections: java.util.List singletonList(java.lang.Object)>(v);
v = new org.apache.isis.core.security._testing.InteractionService_forTesting;
specialinvoke v.<org.apache.isis.core.security._testing.InteractionService_forTesting: void <init>()>();
v = new org.apache.isis.core.security.authentication.standard.RandomCodeGeneratorDefault;
specialinvoke v.<org.apache.isis.core.security.authentication.standard.RandomCodeGeneratorDefault: void <init>()>();
v = staticinvoke <java.util.Collections: java.util.List emptyList()>();
specialinvoke v.<org.apache.isis.core.security.authentication.manager.AuthenticationManager: void <init>(java.util.List,org.apache.isis.applib.services.iactnlayer.InteractionService,org.apache.isis.core.security.authentication.standard.RandomCodeGenerator,java.util.List)>(v, v, v, v);
v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: org.apache.isis.core.security.authentication.manager.AuthenticationManager authMgr> = v;
v = v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery context>;
v = new org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate$1;
specialinvoke v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate$1: void <init>(org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate)>(v);
virtualinvoke v.<org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2: void checking(org.jmock.internal.ExpectationBuilder)>(v);
return;
}
protected void setupWebSession()
{
org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate v;
org.apache.wicket.request.Request v;
org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate$2 v;
v := @this: org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate;
v = new org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate$2;
v = v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: org.apache.wicket.request.Request mockRequest>;
specialinvoke v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate$2: void <init>(org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate,org.apache.wicket.request.Request)>(v, v);
v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis webSession> = v;
return;
}
public void delegatesToAuthenticationManagerAndCachesAuthSessionIfOk()
{
org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate v;
org.apache.isis.applib.services.iactnlayer.InteractionContext v;
org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery v;
org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate$3 v;
org.hamcrest.Matcher v, v, v, v;
java.lang.Boolean v, v;
boolean v;
org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis v, v;
v := @this: org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate;
v = v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery context>;
v = new org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate$3;
specialinvoke v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate$3: void <init>(org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate)>(v);
virtualinvoke v.<org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2: void checking(org.jmock.internal.ExpectationBuilder)>(v);
virtualinvoke v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: void setupWebSession()>();
v = v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis webSession>;
v = virtualinvoke v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis: boolean authenticate(java.lang.String,java.lang.String)>("jsmith", "secret");
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(v);
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(1);
v = staticinvoke <org.hamcrest.Matchers: org.hamcrest.Matcher is(java.lang.Object)>(v);
staticinvoke <org.hamcrest.MatcherAssert: void assertThat(java.lang.Object,org.hamcrest.Matcher)>(v, v);
v = v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis webSession>;
v = virtualinvoke v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis: org.apache.isis.applib.services.iactnlayer.InteractionContext getAuthentication()>();
v = staticinvoke <org.hamcrest.Matchers: org.hamcrest.Matcher nullValue()>();
v = staticinvoke <org.hamcrest.Matchers: org.hamcrest.Matcher not(org.hamcrest.Matcher)>(v);
v = staticinvoke <org.hamcrest.Matchers: org.hamcrest.Matcher is(org.hamcrest.Matcher)>(v);
staticinvoke <org.hamcrest.MatcherAssert: void assertThat(java.lang.Object,org.hamcrest.Matcher)>(v, v);
return;
}
public void delegatesToAuthenticationManagerAndHandlesIfNotAuthenticated()
{
org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate v;
org.apache.isis.applib.services.iactnlayer.InteractionContext v;
org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery v;
org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate$4 v;
org.hamcrest.Matcher v, v, v;
java.lang.Boolean v, v;
boolean v;
org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis v, v;
v := @this: org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate;
v = v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery context>;
v = new org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate$4;
specialinvoke v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate$4: void <init>(org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate)>(v);
virtualinvoke v.<org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2: void checking(org.jmock.internal.ExpectationBuilder)>(v);
virtualinvoke v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: void setupWebSession()>();
v = v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis webSession>;
v = virtualinvoke v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis: boolean authenticate(java.lang.String,java.lang.String)>("jsmith", "secret");
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(v);
v = staticinvoke <java.lang.Boolean: java.lang.Boolean valueOf(boolean)>(0);
v = staticinvoke <org.hamcrest.Matchers: org.hamcrest.Matcher is(java.lang.Object)>(v);
staticinvoke <org.hamcrest.MatcherAssert: void assertThat(java.lang.Object,org.hamcrest.Matcher)>(v, v);
v = v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis_Authenticate: org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis webSession>;
v = virtualinvoke v.<org.apache.isis.viewer.wicket.viewer.integration.AuthenticatedWebSessionForIsis: org.apache.isis.applib.services.iactnlayer.InteractionContext getAuthentication()>();
v = staticinvoke <org.hamcrest.Matchers: org.hamcrest.Matcher nullValue()>();
v = staticinvoke <org.hamcrest.Matchers: org.hamcrest.Matcher is(org.hamcrest.Matcher)>(v);
staticinvoke <org.hamcrest.MatcherAssert: void assertThat(java.lang.Object,org.hamcrest.Matcher)>(v, v);
return;
}
}