ProviderBuilder extends AbstractServiceBuilder<ProviderConfig, ProviderBuilder> { public ProviderConfig build() { ProviderConfig provider = new ProviderConfig(); super.build(provider); provider.setHost(host); provider.setPort(port); provider.setContextpath(contextpath); provider.setThreadpool(threadpool); provider.setThreads(threads); provider.setIothreads(iothreads); provider.setQueues(queues); provider.setAccepts(accepts); provider.setCodec(codec); provider.setPayload(payload); provider.setCharset(charset); provider.setBuffer(buffer); provider.setTransporter(transporter); provider.setExchanger(exchanger); provider.setDispatcher(dispatcher); provider.setNetworker(networker); provider.setServer(server); provider.setClient(client); provider.setTelnet(telnet); provider.setPrompt(prompt); provider.setStatus(status); provider.setWait(wait); provider.setDefault(isDefault); return provider; }  ProviderBuilder host(String host); ProviderBuilder port(Integer port); ProviderBuilder contextPath(String contextPath); ProviderBuilder threadPool(String threadPool); ProviderBuilder threads(Integer threads); ProviderBuilder ioThreads(Integer ioThreads); ProviderBuilder queues(Integer queues); ProviderBuilder accepts(Integer accepts); ProviderBuilder codec(String codec); ProviderBuilder charset(String charset); ProviderBuilder payload(Integer payload); ProviderBuilder buffer(Integer buffer); ProviderBuilder transporter(String transporter); ProviderBuilder exchanger(String exchanger); ProviderBuilder dispatcher(String dispatcher); ProviderBuilder networker(String networker); ProviderBuilder server(String server); ProviderBuilder client(String client); ProviderBuilder telnet(String telnet); ProviderBuilder prompt(String prompt); ProviderBuilder status(String status); ProviderBuilder wait(Integer wait); ProviderBuilder isDefault(Boolean isDefault); ProviderConfig build();  }
@Test void build() { ProviderBuilder builder = new ProviderBuilder(); builder.host("host").port(8080).contextPath("contextpath").threadPool("mockthreadpool") .threads(2).ioThreads(3).queues(4).accepts(5).codec("mockcodec") .charset("utf-8").payload(6).buffer(1024).transporter("mocktransporter").exchanger("mockexchanger") .dispatcher("mockdispatcher").networker("networker").server("server").client("client") .telnet("mocktelnethandler").prompt("prompt").status("mockstatuschecker").wait(Integer.valueOf(1000)) .isDefault(true).id("id").prefix("prefix"); ProviderConfig config = builder.build(); ProviderConfig config2 = builder.build(); Assertions.assertEquals(8080, config.getPort()); Assertions.assertEquals(2, config.getThreads()); Assertions.assertEquals(3, config.getIothreads()); Assertions.assertEquals(4, config.getQueues()); Assertions.assertEquals(5, config.getAccepts()); Assertions.assertEquals(6, config.getPayload()); Assertions.assertEquals(1024, config.getBuffer()); Assertions.assertEquals(1000, config.getWait()); Assertions.assertEquals("host", config.getHost()); Assertions.assertEquals("contextpath", config.getContextpath()); Assertions.assertEquals("mockthreadpool", config.getThreadpool()); Assertions.assertEquals("mockcodec", config.getCodec()); Assertions.assertEquals("utf-8", config.getCharset()); Assertions.assertEquals("mocktransporter", config.getTransporter()); Assertions.assertEquals("mockexchanger", config.getExchanger()); Assertions.assertEquals("mockdispatcher", config.getDispatcher()); Assertions.assertEquals("networker", config.getNetworker()); Assertions.assertEquals("server", config.getServer()); Assertions.assertEquals("client", config.getClient()); Assertions.assertEquals("mocktelnethandler", config.getTelnet()); Assertions.assertEquals("prompt", config.getPrompt()); Assertions.assertEquals("mockstatuschecker", config.getStatus()); Assertions.assertTrue(config.isDefault()); Assertions.assertEquals("id", config.getId()); Assertions.assertEquals("prefix", config.getPrefix()); Assertions.assertNotSame(config, config2); }