From 1c684951c7d6f659dd31b521f4953ac90e04d73f Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 12 Aug 2020 17:08:03 +0200 Subject: remove deprecated flags and add one jUnit test for BpkAttributeBuilder --- .../gv/egiz/eaaf/core/impl/idp/AuthenticationData.java | 4 ---- .../idp/auth/attributes/BpkAttributeBuilderTest.java | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/AuthenticationData.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/AuthenticationData.java index 677e3c46..8cc367d2 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/AuthenticationData.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/AuthenticationData.java @@ -135,7 +135,6 @@ public class AuthenticationData implements IAuthData, Serializable { } @Override - @Deprecated public String getBpk() { return bpk; } @@ -145,7 +144,6 @@ public class AuthenticationData implements IAuthData, Serializable { * * @param bpk The bPK to set */ - @Deprecated public void setBpk(final String bpk) { this.bpk = bpk; } @@ -282,7 +280,6 @@ public class AuthenticationData implements IAuthData, Serializable { } @Override - @Deprecated public String getBpkType() { return bpkType; } @@ -292,7 +289,6 @@ public class AuthenticationData implements IAuthData, Serializable { * * @param bpkType bPK type */ - @Deprecated public void setBpkType(final String bpkType) { this.bpkType = BpkBuilder.normalizeBpkTargetIdentifierToCommonFormat(bpkType); diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/BpkAttributeBuilderTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/BpkAttributeBuilderTest.java index 1ad75abc..0619d4d6 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/BpkAttributeBuilderTest.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/attributes/BpkAttributeBuilderTest.java @@ -9,6 +9,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import at.gv.egiz.eaaf.core.api.data.EaafConstants; import at.gv.egiz.eaaf.core.api.idp.IAttributeBuilder; import at.gv.egiz.eaaf.core.api.idp.IAuthData; +import at.gv.egiz.eaaf.core.impl.idp.AuthenticationData; import at.gv.egiz.eaaf.core.impl.idp.builder.attributes.BpkAttributeBuilder; @RunWith(SpringJUnit4ClassRunner.class) @@ -16,6 +17,21 @@ import at.gv.egiz.eaaf.core.impl.idp.builder.attributes.BpkAttributeBuilder; public class BpkAttributeBuilderTest extends AbstractAttributeBuilderTest { private final IAttributeBuilder attrBuilde = new BpkAttributeBuilder(); + + @Test + public void organwalterBpkTest() throws Exception { + spConfigMap.put("target", "urn:publicid:gv.at:cdid+ZP-MH"); + + final IAuthData authData = buildAuthData(); + ((AuthenticationData) authData).setBpkType("urn:publicid:gv.at:cdid+OW"); + + final String value = attrBuilde.build(spConfig, authData, gen); + + Assert.assertEquals("Wrong bPK", + "OW:" + authData.getBpk(), + value); + + } @Test public void performTestBpk() throws Exception { -- cgit v1.2.3