InternalNetworkConfig { @Config("http-server.internal-networks") @ConfigDescription("Comma-separated list of CIDR blocks that are trusted for X-Forward-For:") public InternalNetworkConfig setInternalNetworks(CidrSet internalNetworks) { this.internalNetworks = internalNetworks; return this; }  CidrSet getInternalNetworks(); @Config("http-server.internal-networks") @ConfigDescription("Comma-separated list of CIDR blocks that are trusted for X-Forward-For:") InternalNetworkConfig setInternalNetworks(CidrSet internalNetworks);  }
@Test public void testDefaults() { ConfigAssertions.assertRecordedDefaults(ConfigAssertions.recordDefaults(InternalNetworkConfig.class) .setInternalNetworks(CidrSet.empty())); }
@Test public void testExplicitPropertyMappings() { Map<String, String> properties = ImmutableMap.<String, String>builder() .put("http-server.internal-networks", "8.8.0.0/16 , 9.0.0.0/8") .build(); InternalNetworkConfig expected = new InternalNetworkConfig() .setInternalNetworks(CidrSet.fromString("9.0.0.0/8").union(CidrSet.fromString("8.8.0.0/16"))); ConfigAssertions.assertFullMapping(properties, expected); }