[java-identity-provider COMMIT] in /trunk/idp-profile-api/src: main/java/net/shibboleth/idp/profile/AbstractProfileAc...
noreply at shibboleth.net
noreply at shibboleth.net
Thu Jan 2 16:33:36 EST 2014
Author: scantor
Date: Thu Jan 2 16:33:36 2014
New Revision: 5141
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5141&view=rev
Log:
Defer event/prev event cleanup to OpenSAML class. Add event choreography to unit test.
Modified:
trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java
trunk/idp-profile-api/src/test/java/net/shibboleth/idp/profile/AbstractProfileActionTest.java
Modified: trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java?rev=5141&r1=5140&r2=5141&view=diff
==============================================================================
--- trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java (original)
+++ trunk/idp-profile-api/src/main/java/net/shibboleth/idp/profile/AbstractProfileAction.java Thu Jan 2 16:33:36 2014
@@ -62,10 +62,10 @@
org.opensaml.profile.action.AbstractProfileAction<InboundMessageType, OutboundMessageType> implements Action {
/** Class logger. */
- private final Logger log = LoggerFactory.getLogger(AbstractProfileAction.class);
+ @Nonnull private final Logger log = LoggerFactory.getLogger(AbstractProfileAction.class);
/** Strategy used to lookup the {@link ProfileRequestContext} from a given WebFlow {@link RequestContext}. */
- private Function<RequestContext, ProfileRequestContext> profileContextLookupStrategy;
+ @Nonnull private Function<RequestContext, ProfileRequestContext> profileContextLookupStrategy;
/**
* Constructor.
@@ -74,10 +74,6 @@
* {@link WebflowRequestContextProfileRequestContextLookup}.
*/
public AbstractProfileAction() {
- super();
-
- setId(getClass().getName());
-
profileContextLookupStrategy = new WebflowRequestContextProfileRequestContextLookup();
}
@@ -105,6 +101,7 @@
}
/** {@inheritDoc} */
+ @Override
@Nonnull public Event execute(@Nonnull final RequestContext springRequestContext) throws ProfileException {
ComponentSupport.ifNotInitializedThrowUninitializedComponentException(this);
@@ -168,16 +165,17 @@
@Nonnull protected Event getResult(@Nonnull final ProfileAction action,
@Nonnull final ProfileRequestContext<InboundMessageType, OutboundMessageType> profileRequestContext) {
- // Check for an EventContext on output. Do not autocreate it.
- EventContext eventCtx = profileRequestContext.getSubcontext(EventContext.class, false);
+ // Check for an EventContext on output.
+ final EventContext eventCtx = profileRequestContext.getSubcontext(EventContext.class, false);
if (eventCtx != null) {
- profileRequestContext.removeSubcontext(eventCtx);
- if (eventCtx.getEvent() instanceof Event) {
+ final Object event = eventCtx.getEvent();
+
+ if (event instanceof Event) {
return (Event) eventCtx.getEvent();
- } else if (eventCtx.getEvent() instanceof String) {
+ } else if (event instanceof String) {
return ActionSupport.buildEvent(action, (String) eventCtx.getEvent());
- } else if (eventCtx.getEvent() instanceof AttributeMap) {
- AttributeMap map = (AttributeMap) eventCtx.getEvent();
+ } else if (event instanceof AttributeMap) {
+ final AttributeMap map = (AttributeMap) eventCtx.getEvent();
return ActionSupport.buildEvent(action, map.getString("eventId", EventIds.PROCEED_EVENT_ID), map);
} else {
return null;
@@ -187,4 +185,5 @@
return ActionSupport.buildProceedEvent(action);
}
}
+
}
Modified: trunk/idp-profile-api/src/test/java/net/shibboleth/idp/profile/AbstractProfileActionTest.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-api/src/test/java/net/shibboleth/idp/profile/AbstractProfileActionTest.java?rev=5141&r1=5140&r2=5141&view=diff
==============================================================================
--- trunk/idp-profile-api/src/test/java/net/shibboleth/idp/profile/AbstractProfileActionTest.java (original)
+++ trunk/idp-profile-api/src/test/java/net/shibboleth/idp/profile/AbstractProfileActionTest.java Thu Jan 2 16:33:36 2014
@@ -23,6 +23,7 @@
import net.shibboleth.utilities.java.support.logic.ConstraintViolationException;
import org.opensaml.profile.ProfileException;
+import org.opensaml.profile.context.PreviousEventContext;
import org.opensaml.profile.context.ProfileRequestContext;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;
@@ -33,8 +34,8 @@
public class AbstractProfileActionTest {
@Test public void testActionId() {
- MockIdentityProviderAction action = new MockIdentityProviderAction(null);
[... 142 lines stripped ...]
More information about the commits
mailing list