@Test public void create() { RestResendClientFactory factory = new RestResendClientFactory(); assertThat(factory.communicationType()).isEqualTo(CommunicationType.REST); Config config = mock(Config.class); ServerConfig serverConfig = mock(ServerConfig.class); when(serverConfig.isSsl()).thenReturn(Boolean.FALSE); when(config.getP2PServerConfig()).thenReturn(serverConfig); ResendClient result = factory.create(config); assertThat(result).isNotNull(); }
public ResendClient create(final Config config) { final String resendWaitTime = new IntervalPropertyHelper(config.getP2PServerConfig().getProperties()).resendWaitTime(); final SSLContextFactory clientSSLContextFactory = ClientSSLContextFactory.create(); final ClientFactory clientFactory = new ClientFactory(clientSSLContextFactory); final Client client = clientFactory.buildFrom(config.getP2PServerConfig()); client.property("jersey.config.client.readTimeout", resendWaitTime); return new RestResendClient(client); }
RestResendClientFactory implements ResendClientFactory { public ResendClient create(final Config config) { final String resendWaitTime = new IntervalPropertyHelper(config.getP2PServerConfig().getProperties()).resendWaitTime(); final SSLContextFactory clientSSLContextFactory = ClientSSLContextFactory.create(); final ClientFactory clientFactory = new ClientFactory(clientSSLContextFactory); final Client client = clientFactory.buildFrom(config.getP2PServerConfig()); client.property("jersey.config.client.readTimeout", resendWaitTime); return new RestResendClient(client); } }
RestResendClientFactory implements ResendClientFactory { public ResendClient create(final Config config) { final String resendWaitTime = new IntervalPropertyHelper(config.getP2PServerConfig().getProperties()).resendWaitTime(); final SSLContextFactory clientSSLContextFactory = ClientSSLContextFactory.create(); final ClientFactory clientFactory = new ClientFactory(clientSSLContextFactory); final Client client = clientFactory.buildFrom(config.getP2PServerConfig()); client.property("jersey.config.client.readTimeout", resendWaitTime); return new RestResendClient(client); }  }
RestResendClientFactory implements ResendClientFactory { public ResendClient create(final Config config) { final String resendWaitTime = new IntervalPropertyHelper(config.getP2PServerConfig().getProperties()).resendWaitTime(); final SSLContextFactory clientSSLContextFactory = ClientSSLContextFactory.create(); final ClientFactory clientFactory = new ClientFactory(clientSSLContextFactory); final Client client = clientFactory.buildFrom(config.getP2PServerConfig()); client.property("jersey.config.client.readTimeout", resendWaitTime); return new RestResendClient(client); }  ResendClient create(final Config config); @Override CommunicationType communicationType(); }
RestResendClientFactory implements ResendClientFactory { public ResendClient create(final Config config) { final String resendWaitTime = new IntervalPropertyHelper(config.getP2PServerConfig().getProperties()).resendWaitTime(); final SSLContextFactory clientSSLContextFactory = ClientSSLContextFactory.create(); final ClientFactory clientFactory = new ClientFactory(clientSSLContextFactory); final Client client = clientFactory.buildFrom(config.getP2PServerConfig()); client.property("jersey.config.client.readTimeout", resendWaitTime); return new RestResendClient(client); }  ResendClient create(final Config config); @Override CommunicationType communicationType();  }