@Test public void shouldIgnoreInvalidAddress() { AddressCustomizer customizer = new AddressCustomizer(mockFactory); customizer.apply(mockHttpServerOptions); verify(mockHttpServerOptions, times(0)).setHost(anyString()); }
@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);  }