@Test public void testSecurityTokenGeneration() { context.checking(new Expectations() { { oneOf(actionContext).getPrincipal(); will(returnValue(principal)); oneOf(principal).getOpenSocialId(); will(returnValue("testosid")); oneOf(actionContext).getParams(); will(returnValue("consumerKey")); } }); SecurityTokenResponse results = sut.execute(actionContext); assertEquals(results.getSecurityToken().getContainer(), SECURITY_TOKEN_CONTAINER); assertEquals(results.getSecurityToken().getDomain(), SECURITY_TOKEN_DOMAIN); context.assertIsSatisfied(); }
@Override public SecurityTokenResponse execute(final PrincipalActionContext inActionContext) throws ExecutionException { String userId = inActionContext.getPrincipal().getOpenSocialId(); String consumerKey = (String) inActionContext.getParams(); return new SecurityTokenResponse(new OAuthSecurityToken(userId, null, consumerKey, domain, container, null, AuthenticationMode.OAUTH_CONSUMER_REQUEST.name())); }
GetSecurityTokenForConsumerRequestExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public SecurityTokenResponse execute(final PrincipalActionContext inActionContext) throws ExecutionException { String userId = inActionContext.getPrincipal().getOpenSocialId(); String consumerKey = (String) inActionContext.getParams(); return new SecurityTokenResponse(new OAuthSecurityToken(userId, null, consumerKey, domain, container, null, AuthenticationMode.OAUTH_CONSUMER_REQUEST.name())); } }
GetSecurityTokenForConsumerRequestExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public SecurityTokenResponse execute(final PrincipalActionContext inActionContext) throws ExecutionException { String userId = inActionContext.getPrincipal().getOpenSocialId(); String consumerKey = (String) inActionContext.getParams(); return new SecurityTokenResponse(new OAuthSecurityToken(userId, null, consumerKey, domain, container, null, AuthenticationMode.OAUTH_CONSUMER_REQUEST.name())); } GetSecurityTokenForConsumerRequestExecution(final String inDomain, final String inContainer); }
GetSecurityTokenForConsumerRequestExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public SecurityTokenResponse execute(final PrincipalActionContext inActionContext) throws ExecutionException { String userId = inActionContext.getPrincipal().getOpenSocialId(); String consumerKey = (String) inActionContext.getParams(); return new SecurityTokenResponse(new OAuthSecurityToken(userId, null, consumerKey, domain, container, null, AuthenticationMode.OAUTH_CONSUMER_REQUEST.name())); } GetSecurityTokenForConsumerRequestExecution(final String inDomain, final String inContainer); @Override SecurityTokenResponse execute(final PrincipalActionContext inActionContext); }
GetSecurityTokenForConsumerRequestExecution implements ExecutionStrategy<PrincipalActionContext> { @Override public SecurityTokenResponse execute(final PrincipalActionContext inActionContext) throws ExecutionException { String userId = inActionContext.getPrincipal().getOpenSocialId(); String consumerKey = (String) inActionContext.getParams(); return new SecurityTokenResponse(new OAuthSecurityToken(userId, null, consumerKey, domain, container, null, AuthenticationMode.OAUTH_CONSUMER_REQUEST.name())); } GetSecurityTokenForConsumerRequestExecution(final String inDomain, final String inContainer); @Override SecurityTokenResponse execute(final PrincipalActionContext inActionContext);  }