package at.gv.egovernment.moa.id.auth.modules.ehvd.test.utils; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.util.List; import org.junit.Assert; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.BlockJUnit4ClassRunner; import org.opensaml.saml2.core.Attribute; import org.opensaml.xml.ConfigurationException; import at.gv.egiz.eaaf.core.api.data.PVPAttributeDefinitions; import at.gv.egiz.eaaf.modules.pvp2.impl.builder.PVPAttributeBuilder; import at.gv.egiz.eaaf.modules.pvp2.impl.opensaml.initialize.EAAFDefaultSAML2Bootstrap; @RunWith(BlockJUnit4ClassRunner.class) public class AttributeBuilderRegistrationTest { @BeforeClass public static void classInitializer() throws ConfigurationException { EAAFDefaultSAML2Bootstrap.bootstrap(); } @Test public void checkRegistratedAttributeBuilder() { List supportedAttributes = PVPAttributeBuilder.buildSupportedEmptyAttributes(); assertFalse("Registered Attribute-Builder is empty", supportedAttributes.isEmpty()); assertTrue("No role attribute registrated", supportedAttributes.stream() .filter(el -> PVPAttributeDefinitions.ROLES_NAME.equals(el.getName())) .findFirst() .isPresent()); } }