diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2020-04-01 23:17:27 +0200 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2020-04-01 23:17:27 +0200 |
commit | a19b85723223dbefff7f34a59421c2d2edf3261f (patch) | |
tree | 1de017b7eaa12038a8c23663520fab1780dfc1b2 /eaaf_core/src/test/java/at/gv | |
parent | a6539d2b881f1567d77fbc87e3676ffb9ffb9dcb (diff) | |
download | EAAF-Components-a19b85723223dbefff7f34a59421c2d2edf3261f.tar.gz EAAF-Components-a19b85723223dbefff7f34a59421c2d2edf3261f.tar.bz2 EAAF-Components-a19b85723223dbefff7f34a59421c2d2edf3261f.zip |
update process-engine support HTTP POST and GET error forwarting.
This is needed for processes in IFrames
Diffstat (limited to 'eaaf_core/src/test/java/at/gv')
3 files changed, 45 insertions, 5 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiBuilderConfigurationFactory.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiBuilderConfigurationFactory.java index be71a29c..570c3dd2 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiBuilderConfigurationFactory.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiBuilderConfigurationFactory.java @@ -11,13 +11,20 @@ import at.gv.egiz.eaaf.core.api.gui.IVelocityGuiBuilderConfiguration; public class DummyGuiBuilderConfigurationFactory implements IGuiBuilderConfigurationFactory { private IGuiBuilderConfiguration errorGuiConfig; + private IGuiBuilderConfiguration parentHopGuiConfig; private IVelocityGuiBuilderConfiguration velocityBuilderConfig; @Override public IGuiBuilderConfiguration getDefaultErrorGui(String authUrl) { return errorGuiConfig; } - + + @Override + public IGuiBuilderConfiguration getDefaultIFrameParentHopGui(IRequest pendingReq, String endpoint, + String errorKey) { + return parentHopGuiConfig; + } + @Override public IVelocityGuiBuilderConfiguration getSpSpecificSaml2PostConfiguration(IRequest pendingReq, String viewName, URI configRootContextDir) throws MalformedURLException { @@ -28,9 +35,12 @@ public class DummyGuiBuilderConfigurationFactory implements IGuiBuilderConfigura this.errorGuiConfig = errorGuiConfig; } + public void setDefaultIFrameParentHopGui(IGuiBuilderConfiguration guiConfig) { + this.parentHopGuiConfig = guiConfig; + } + public void setVelocityBuilderConfig(IVelocityGuiBuilderConfiguration velocityBuilderConfig) { this.velocityBuilderConfig = velocityBuilderConfig; } - } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java index 300a390d..4b07bea9 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java @@ -8,6 +8,9 @@ import javax.servlet.http.HttpServletResponse; import at.gv.egiz.eaaf.core.api.IRequest; import at.gv.egiz.eaaf.core.api.idp.auth.services.IProtocolAuthenticationService; import at.gv.egiz.eaaf.core.exceptions.EaafException; +import at.gv.egiz.eaaf.core.exceptions.GuiBuildException; +import at.gv.egiz.eaaf.core.impl.data.Pair; +import lombok.Getter; public class DummyProtocolAuthService implements IProtocolAuthenticationService { @@ -16,6 +19,9 @@ public class DummyProtocolAuthService implements IProtocolAuthenticationService private HttpServletResponse httpResp; private Throwable exception; private boolean writeToStatisticLog; + + @Getter + private String errorKey; @Override public void performAuthentication(final HttpServletRequest req, final HttpServletResponse resp, @@ -57,6 +63,18 @@ public class DummyProtocolAuthService implements IProtocolAuthenticationService } + @Override + public void forwardToErrorHandler(Pair<IRequest, Throwable> errorToHandle, String errorKey, + HttpServletRequest req, HttpServletResponse resp) throws GuiBuildException { + this.httpReq = req; + this.httpResp = resp; + this.pendingReq = errorToHandle.getFirst(); + this.exception = errorToHandle.getSecond(); + this.errorKey = errorKey; + + + } + public IRequest getPendingReq() { return pendingReq; } diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java index 8f8f8114..b3f733d1 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/TestRequestImpl.java @@ -24,13 +24,13 @@ import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Map; +import org.apache.commons.lang3.StringUtils; + import at.gv.egiz.eaaf.core.api.IRequest; import at.gv.egiz.eaaf.core.api.idp.ISpConfiguration; import at.gv.egiz.eaaf.core.exceptions.EaafStorageException; import at.gv.egiz.eaaf.core.impl.idp.auth.data.AuthProcessDataWrapper; -import org.apache.commons.lang3.StringUtils; - /** * Test pending-request for jUnit tests. * @@ -49,8 +49,9 @@ public class TestRequestImpl implements IRequest { private boolean authenticated; private boolean needAuthentication = false; private boolean stoppedByUser; + private boolean currentlyInIframe = false; private String piiTransactionId; - + /* * (non-Javadoc) * @@ -388,4 +389,15 @@ public class TestRequestImpl implements IRequest { this.needAuthentication = needAuthentication; } + @Override + public boolean isProcessInIframe() { + return this.currentlyInIframe; + } + + @Override + public void setProcessInFrame(boolean flag) { + this.currentlyInIframe = flag; + + } + } |