DefaultConfigurator implements ClientConfigurator { static void setAllowRestrictedHeadersProperty(String previousValue) { if (previousValue != null && !Boolean.valueOf(previousValue)) { throw new IllegalStateException( "Property " + SUN_NET_HTTP_ALLOW_RESTRICTED_HEADERS + " was explicitly " + "set to " + previousValue + "; the OCI SDK needs to set this property to true. Failing..."); } System.setProperty(SUN_NET_HTTP_ALLOW_RESTRICTED_HEADERS, "true"); } DefaultConfigurator();  DefaultConfigurator(List<ClientConfigDecorator> clientConfigDecorators); @Override void customizeBuilder(ClientBuilder builder); @Override void customizeClient(Client client);  }
@Test public void succeedIfPropertyNotSet() { DefaultConfigurator.setAllowRestrictedHeadersProperty(null); assertEquals( "true", System.getProperty(DefaultConfigurator.SUN_NET_HTTP_ALLOW_RESTRICTED_HEADERS)); }
@Test(expected = IllegalStateException.class) public void failIfPropertyFalse() { DefaultConfigurator.setAllowRestrictedHeadersProperty("false"); }
@Test public void succeedIfPropertyTrue() { DefaultConfigurator.setAllowRestrictedHeadersProperty("true"); assertEquals( "true", System.getProperty(DefaultConfigurator.SUN_NET_HTTP_ALLOW_RESTRICTED_HEADERS)); }