@Test public void shouldSetValidAddress() throws UnknownHostException { given(mockFactory.getAddress()).willReturn(InetAddress.getByName("localhost")); AddressCustomizer customizer = new AddressCustomizer(mockFactory); customizer.apply(mockHttpServerOptions); verify(mockHttpServerOptions).setHost("127.0.0.1"); }
@Override public HttpServerOptions apply(HttpServerOptions options) { InetAddress address = factory.getAddress(); if (address != null && address.getHostAddress() != null) { options.setHost(address.getHostAddress()); } return options; }
AddressCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { InetAddress address = factory.getAddress(); if (address != null && address.getHostAddress() != null) { options.setHost(address.getHostAddress()); } return options; } }
AddressCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { InetAddress address = factory.getAddress(); if (address != null && address.getHostAddress() != null) { options.setHost(address.getHostAddress()); } return options; } AddressCustomizer(AbstractConfigurableWebServerFactory factory); }
AddressCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { InetAddress address = factory.getAddress(); if (address != null && address.getHostAddress() != null) { options.setHost(address.getHostAddress()); } return options; } AddressCustomizer(AbstractConfigurableWebServerFactory factory); @Override HttpServerOptions apply(HttpServerOptions options); }
AddressCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { InetAddress address = factory.getAddress(); if (address != null && address.getHostAddress() != null) { options.setHost(address.getHostAddress()); } return options; } AddressCustomizer(AbstractConfigurableWebServerFactory factory); @Override HttpServerOptions apply(HttpServerOptions options);  }