@Test(groups = "unit", testName = "UpdateProviderMetadataFromPropertiesTest")
public class UpdateProviderMetadataFromPropertiesTest {
@Test
public void testProviderMetadataWithUpdatedEndpointUpdatesAndRetainsAllDefaultPropertiesExceptEndpoint() {
ProviderMetadata md = AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(
IntegrationTestClient.class, IntegrationTestAsyncClient.class, "http://localhost");
Properties props = new Properties();
props.putAll(md.getDefaultProperties());
props.setProperty(Constants.PROPERTY_ENDPOINT, "http://nonlocal");
ProviderMetadata newMd = new UpdateProviderMetadataFromProperties(md).apply(props);
assertEquals(newMd.getEndpoint(), "http://nonlocal");
assertEquals(newMd.getDefaultProperties(), md.getDefaultProperties());
}