diff options
author | Thomas <> | 2022-08-16 10:56:54 +0200 |
---|---|---|
committer | Thomas <> | 2022-08-16 10:56:54 +0200 |
commit | ca50cb8dda0a24b5a4589db126bfab8d0d885b00 (patch) | |
tree | 0947baf07a77f6f0b2fa2368fc92f87510340770 /modules/eidas_proxy-sevice/src/test/java/at | |
parent | 0ae0c83da2f970bb8987f116286857e07b0c02b1 (diff) | |
download | National_eIDAS_Gateway-ca50cb8dda0a24b5a4589db126bfab8d0d885b00.tar.gz National_eIDAS_Gateway-ca50cb8dda0a24b5a4589db126bfab8d0d885b00.tar.bz2 National_eIDAS_Gateway-ca50cb8dda0a24b5a4589db126bfab8d0d885b00.zip |
feat(proxy): add support for custom eIDAS attribute-handler into ProxyEidasAttributeRegistry
This allow more sopisticated attribute-processing than simple mapping to IDA attributes
Diffstat (limited to 'modules/eidas_proxy-sevice/src/test/java/at')
-rw-r--r-- | modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/msproxyservice/test/services/ProxyEidasAttributeRegistryTest.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/msproxyservice/test/services/ProxyEidasAttributeRegistryTest.java b/modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/msproxyservice/test/services/ProxyEidasAttributeRegistryTest.java index 8d417c1a..fb7d257e 100644 --- a/modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/msproxyservice/test/services/ProxyEidasAttributeRegistryTest.java +++ b/modules/eidas_proxy-sevice/src/test/java/at/asitplus/eidas/specific/modules/msproxyservice/test/services/ProxyEidasAttributeRegistryTest.java @@ -127,6 +127,26 @@ public class ProxyEidasAttributeRegistryTest { } + @Test + public void specificAttributeHandler() { + assertFalse("find wrong attribute", + attrRegistry.mapEidasAttributeToAttributeHandler( + "http://eidas.europa.eu/attributes/jUnit/no/custom/handler").isPresent()); + + assertFalse("find wrong attribute", + attrRegistry.mapEidasAttributeToAttributeHandler( + "http://eidas.europa.eu/attributes/naturalperson/representative/DateOfBirth").isPresent()); + + + Optional<String> attr2 = attrRegistry.mapEidasAttributeToAttributeHandler( + "http://e-justice.europa.eu/attributes/naturalperson/eJusticeNaturalPersonRole"); + assertTrue("find wrong IDA mapping", attr2.isPresent()); + assertEquals("find wrong specific attribute-handler", + "at.asitplus.eidas.specific.modules.msproxyservice.handler.EJusticePersonRoleHandler", attr2.get()); + + } + + private void checkAttributeMapping(String eidasAttr, boolean withMandates, List<String> idaAttributes) { @NonNull Set<String> idaAttrResult = attrRegistry.getIdaAttributesForEidasAttribute(eidasAttr, withMandates); |