diff options
author | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2019-06-28 13:11:42 +0200 |
---|---|---|
committer | Thomas Lenz <thomas.lenz@egiz.gv.at> | 2019-06-28 13:11:42 +0200 |
commit | b5018668a538b7931feabb109ac176db53b02976 (patch) | |
tree | a61c896ba6804dd5f7c781c96bc8325a51c28f10 /eaaf_core/src/test/java | |
parent | 2f5e847f58464c0aba8221bf87b31de8fca53393 (diff) | |
download | EAAF-Components-b5018668a538b7931feabb109ac176db53b02976.tar.gz EAAF-Components-b5018668a538b7931feabb109ac176db53b02976.tar.bz2 EAAF-Components-b5018668a538b7931feabb109ac176db53b02976.zip |
add some mockups for testing
Diffstat (limited to 'eaaf_core/src/test/java')
3 files changed, 87 insertions, 6 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyAuthManager.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyAuthManager.java new file mode 100644 index 00000000..368a1915 --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/DummyAuthManager.java @@ -0,0 +1,26 @@ +package at.gv.egiz.eaaf.core.impl.idp.auth; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import at.gv.egiz.eaaf.core.api.IRequest; +import at.gv.egiz.eaaf.core.api.idp.process.ExecutionContext; +import at.gv.egiz.eaaf.core.api.idp.slo.ISLOInformationContainer; +import at.gv.egiz.eaaf.core.exceptions.EAAFException; +import at.gv.egiz.eaaf.core.impl.idp.controller.protocols.RequestImpl; + +public class DummyAuthManager extends AbstractAuthenticationManager { + + @Override + public ISLOInformationContainer performSingleLogOut(HttpServletRequest httpReq, HttpServletResponse httpResp, + IRequest pendingReq, String internalSSOId) throws EAAFException { + return null; + } + + @Override + protected void populateExecutionContext(ExecutionContext executionContext, RequestImpl pendingReq, + HttpServletRequest httpReq) throws EAAFException { + + } + +} 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 new file mode 100644 index 00000000..a50e92cb --- /dev/null +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/test/DummyProtocolAuthService.java @@ -0,0 +1,42 @@ +package at.gv.egiz.eaaf.core.impl.idp.module.test; + +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; +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; + +public class DummyProtocolAuthService implements IProtocolAuthenticationService { + + @Override + public void performAuthentication(HttpServletRequest req, HttpServletResponse resp, IRequest pendingReq) + throws IOException, EAAFException { + // TODO Auto-generated method stub + + } + + @Override + public void finalizeAuthentication(HttpServletRequest req, HttpServletResponse resp, IRequest pendingReq) + throws EAAFException, IOException { + // TODO Auto-generated method stub + + } + + @Override + public void buildProtocolSpecificErrorResponse(Throwable throwable, HttpServletRequest req, + HttpServletResponse resp, IRequest pendingReq) throws IOException, EAAFException { + // TODO Auto-generated method stub + + } + + @Override + public void handleErrorNoRedirect(Throwable throwable, HttpServletRequest req, HttpServletResponse resp, + boolean writeExceptionToStatisticLog) throws IOException, EAAFException { + // TODO Auto-generated method stub + + } + +} 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 25e2d6a1..b6679f2e 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 @@ -45,6 +45,8 @@ public class TestRequestImpl implements IRequest { private ISPConfiguration spConfig = null; private final Map<String, Object> storage = new HashMap<String, Object>(); private String transactionId = null; + private String pendingReqId = null; + private String authURL = null; /* (non-Javadoc) * @see at.gv.egovernment.moa.id.moduls.IRequest#requestedModule() @@ -130,8 +132,7 @@ public class TestRequestImpl implements IRequest { */ @Override public String getAuthURL() { - // TODO Auto-generated method stub - return null; + return this.authURL; } /* (non-Javadoc) @@ -139,8 +140,10 @@ public class TestRequestImpl implements IRequest { */ @Override public String getAuthURLWithOutSlash() { - // TODO Auto-generated method stub - return null; + if (this.authURL != null && this.authURL.endsWith("/")) + return this.authURL.substring(0, this.authURL.length()-1); + else + return this.authURL; } /* (non-Javadoc) @@ -227,8 +230,7 @@ public class TestRequestImpl implements IRequest { @Override public String getPendingRequestId() { - // TODO Auto-generated method stub - return null; + return this.pendingReqId; } @Override @@ -302,6 +304,17 @@ public class TestRequestImpl implements IRequest { public void setTransactionId(String transactionId) { this.transactionId = transactionId; } + + public void setPendingReqId(String pendingReqId) { + this.pendingReqId = pendingReqId; + } + + public void setAuthURL(String authURL) { + this.authURL = authURL; + } + + + |