ConfigMetadataProvider extends AbstractMetadataProvider implements ComparableProvider { @Override public XMLObject doGetMetadata() throws MetadataProviderException { InputStream stream = new ByteArrayInputStream(metadata.getBytes(StandardCharsets.UTF_8)); try { return unmarshallMetadata(stream); } catch (UnmarshallingException e) { log.error("Unable to unmarshall metadata", e); throw new MetadataProviderException(e); } } ConfigMetadataProvider(String zoneId, String alias, String metadata); byte[] fetchMetadata(); @Override XMLObject doGetMetadata(); @Override boolean equals(Object o); @Override int hashCode(); @Override String getAlias(); @Override String getZoneId();  }
@Test public void testDoGetMetadata() throws Exception { String metadataString = new Scanner(new File("../uaa/src/test/resources/idp.xml")).useDelimiter("\\Z").next(); ConfigMetadataProvider provider = new ConfigMetadataProvider(IdentityZone.getUaaZoneId(), "testalias", metadataString); ConfigMetadataProvider provider2 = new ConfigMetadataProvider(IdentityZone.getUaaZoneId(), "testalias", metadataString); DefaultBootstrap.bootstrap(); provider.setParserPool(new BasicParserPool()); XMLObject xmlObject = provider.doGetMetadata(); assertNotNull(xmlObject); assertEquals("http: assertEquals(provider, provider2); }