From a4d179661754e04c882c1686e3c83f1b458717df Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 11 Apr 2019 16:52:19 +0200 Subject: refactoring of AuthData builder --- .../idp/auth/TestAuthenticationDataBuilder.java | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'eaaf_core/src/test/java/at/gv/egiz') diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/TestAuthenticationDataBuilder.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/TestAuthenticationDataBuilder.java index 834c2d6e..c5610bc9 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/TestAuthenticationDataBuilder.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/TestAuthenticationDataBuilder.java @@ -6,6 +6,7 @@ import at.gv.egiz.eaaf.core.api.idp.ISPConfiguration; import at.gv.egiz.eaaf.core.api.idp.auth.data.IAuthProcessDataContainer; import at.gv.egiz.eaaf.core.exceptions.EAAFAuthenticationException; import at.gv.egiz.eaaf.core.exceptions.EAAFBuilderException; +import at.gv.egiz.eaaf.core.exceptions.EAAFException; import at.gv.egiz.eaaf.core.impl.data.Pair; import at.gv.egiz.eaaf.core.impl.idp.AuthenticationData; import at.gv.egiz.eaaf.core.impl.idp.auth.builder.AbstractAuthenticationDataBuilder; @@ -14,20 +15,32 @@ import at.gv.egiz.eaaf.core.impl.idp.auth.data.AuthProcessDataWrapper; public class TestAuthenticationDataBuilder extends AbstractAuthenticationDataBuilder { @Override - public IAuthData buildAuthenticationData(IRequest pendingReq) throws EAAFAuthenticationException { + protected IAuthData getAuthDataInstance(IRequest pendingReq) throws EAAFException { + throw new EAAFException("Not supported yet"); + } - AuthenticationData authData = new AuthenticationData(); + @Override + protected void buildServiceSpecificAuthenticationData(IAuthData authData, IRequest pendingReq) + throws EAAFException { + throw new EAAFException("Not supported yet"); + + } + + @Override + @Deprecated + protected IAuthData buildDeprecatedAuthData(IRequest pendingReq) throws EAAFException { + final AuthenticationData authData = new AuthenticationData(); try { - generateBasicAuthData(authData, pendingReq, pendingReq.getSessionData(AuthProcessDataWrapper.class)); + generateDeprecatedBasicAuthData(authData, pendingReq, pendingReq.getSessionData(AuthProcessDataWrapper.class)); - } catch (Exception e) { + } catch (final Exception e) { e.printStackTrace(); throw new EAAFAuthenticationException("AuthDataGeneration FAILED", null, e); } return authData; } - + @Override protected Pair getEncryptedbPKFromPVPAttribute(IAuthProcessDataContainer authProcessDataContainer, AuthenticationData authData, ISPConfiguration spConfig) throws EAAFBuilderException { @@ -42,4 +55,5 @@ public class TestAuthenticationDataBuilder extends AbstractAuthenticationDataBui return null; } + } -- cgit v1.2.3