/** * Make sure we can get a valid metadata generator. * * @throws MetadataProviderException on exception */ @Test public void canGetMetadataGenerator() throws MetadataProviderException { final SAMLProperties properties = this.setupForMetadataGenerator(); final MetadataGenerator generator = this.config.metadataGenerator(); Assert.assertNotNull(generator); Assert.assertThat(generator.getEntityId(), Matchers.is(properties.getSp().getEntityId())); Assert.assertFalse(generator.isIncludeDiscoveryExtension()); }
private SAMLProperties setupForMetadataGenerator() { final SAMLProperties properties = this.setupForKeyManager(); final String entityId = UUID.randomUUID().toString(); final SAMLProperties.Sp sp = Mockito.mock(SAMLProperties.Sp.class); Mockito.when(sp.getEntityId()).thenReturn(entityId); Mockito.when(properties.getSp()).thenReturn(sp); return properties; }