MetadataManagerConfigurer extends SecurityConfigurerAdapter<Void, ServiceProviderBuilder> { @Override public void init(ServiceProviderBuilder builder) throws Exception { resourceLoader = builder.getSharedObject(ResourceLoader.class); metadataManagerBean = builder.getSharedObject(MetadataManager.class); extendedDelegateConfig = builder.getSharedObject(SAMLSSOProperties.class).getExtendedDelegate(); localExtendedDelegateConfig = builder.getSharedObject(SAMLSSOProperties.class).getLocalExtendedDelegate(); managerConfig = builder.getSharedObject(SAMLSSOProperties.class).getMetadataManager(); idpConfig = builder.getSharedObject(SAMLSSOProperties.class).getIdp(); } MetadataManagerConfigurer(MetadataManager metadataManager);  MetadataManagerConfigurer(); @Override void init(ServiceProviderBuilder builder); @Override void configure(ServiceProviderBuilder builder); MetadataManagerConfigurer defaultIDP(String defaultIDP); MetadataManagerConfigurer hostedSPName(String hostedSPName); MetadataManagerConfigurer refreshCheckInterval(long refreshCheckInterval); MetadataManagerConfigurer metadataProvider(MetadataProvider provider); MetadataManagerConfigurer metadataProviders(MetadataProvider... providers); MetadataManagerConfigurer metadataLocations(String... providerLocation); MetadataManagerConfigurer localMetadataLocation(String providerLocation); MetadataManagerConfigurer metadataProviders(List<MetadataProvider> providers); MetadataManagerConfigurer metadataFilter(MetadataFilter filter); MetadataManagerConfigurer forceMetadataRevocationCheck(boolean forceMetadataRevocationCheck); MetadataManagerConfigurer metadataRequireSignature(boolean metadataRequireSignature); MetadataManagerConfigurer metadataTrustCheck(boolean metadataTrustCheck); MetadataManagerConfigurer metadataTrustedKeys(String... metadataTrustedKeys); MetadataManagerConfigurer requireValidMetadata(boolean requireValidMetadata); MetadataManagerConfigurer localMetadataFilter(MetadataFilter filter); MetadataManagerConfigurer localForceMetadataRevocationCheck(boolean forceMetadataRevocationCheck); MetadataManagerConfigurer localMetadataRequireSignature(boolean metadataRequireSignature); MetadataManagerConfigurer localMetadataTrustCheck(boolean metadataTrustCheck); MetadataManagerConfigurer localMetadataTrustedKeys(String... metadataTrustedKeys); MetadataManagerConfigurer localRequireValidMetadata(boolean requireValidMetadata);  }
@Test public void init() throws Exception { MetadataManagerConfigurer configurer = new MetadataManagerConfigurer(); configurer.init(builder); verify(builder).getSharedObject(eq(MetadataManager.class)); verify(builder, atLeastOnce()).getSharedObject(eq(SAMLSSOProperties.class)); verify(builder).getSharedObject(eq(ResourceLoader.class)); verify(properties).getMetadataManager(); verify(properties).getExtendedDelegate(); }