@Test public void shouldSetValidPort() { given(mockFactory.getPort()).willReturn(1); PortCustomizer customizer = new PortCustomizer(mockFactory); customizer.apply(mockHttpServerOptions); verify(mockHttpServerOptions).setPort(1); }
@Override public HttpServerOptions apply(HttpServerOptions options) { if (factory.getPort() >= 0) { options.setPort(factory.getPort()); } return options; }
PortCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { if (factory.getPort() >= 0) { options.setPort(factory.getPort()); } return options; } }
PortCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { if (factory.getPort() >= 0) { options.setPort(factory.getPort()); } return options; } PortCustomizer(AbstractConfigurableWebServerFactory factory); }
PortCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { if (factory.getPort() >= 0) { options.setPort(factory.getPort()); } return options; } PortCustomizer(AbstractConfigurableWebServerFactory factory); @Override HttpServerOptions apply(HttpServerOptions options); }
PortCustomizer implements HttpServerOptionsCustomizer { @Override public HttpServerOptions apply(HttpServerOptions options) { if (factory.getPort() >= 0) { options.setPort(factory.getPort()); } return options; } PortCustomizer(AbstractConfigurableWebServerFactory factory); @Override HttpServerOptions apply(HttpServerOptions options);  }