@Test public void setup_data_used() { OneInstallSetup setup = mock(OneInstallSetup.class); when(setup.getBaseURL()).thenReturn("http: when(setup.getPassword()).thenReturn("mypwd"); when(setup.getUserId()).thenReturn("myuser"); when(setup.isHavingUntrustedCertificate()).thenReturn(true); OneInstallSetupConfigBuilderStrategy strategyToTest = new OneInstallSetupConfigBuilderStrategy(setup); TestAdapterConfigBuilder configBuilder = new TestAdapterConfigBuilder(); strategyToTest.configure(configBuilder); TestAdapterConfig result = configBuilder.build(); assertEquals("myuser", result.getUser()); assertEquals("mypwd", result.getPasswordOrAPIToken()); assertNotNull(result.getPasswordOrAPITokenBase64Encoded()); assertEquals("http: assertTrue(result.isTrustAllCertificatesEnabled()); }
@Override public <B extends AbstractAdapterConfigBuilder<B, C>, C extends AdapterConfig> void configure(B configBuilder) { configBuilder. setTrustAllCertificates(setup.isHavingUntrustedCertificate()). setUser(setup.getUserId()). setPasswordOrAPIToken(setup.getPassword()). setProductBaseUrl(setup.getBaseURL()); }
OneInstallSetupConfigBuilderStrategy implements AdapterConfigurationStrategy { @Override public <B extends AbstractAdapterConfigBuilder<B, C>, C extends AdapterConfig> void configure(B configBuilder) { configBuilder. setTrustAllCertificates(setup.isHavingUntrustedCertificate()). setUser(setup.getUserId()). setPasswordOrAPIToken(setup.getPassword()). setProductBaseUrl(setup.getBaseURL()); } }
OneInstallSetupConfigBuilderStrategy implements AdapterConfigurationStrategy { @Override public <B extends AbstractAdapterConfigBuilder<B, C>, C extends AdapterConfig> void configure(B configBuilder) { configBuilder. setTrustAllCertificates(setup.isHavingUntrustedCertificate()). setUser(setup.getUserId()). setPasswordOrAPIToken(setup.getPassword()). setProductBaseUrl(setup.getBaseURL()); } OneInstallSetupConfigBuilderStrategy(OneInstallSetup setup); }
OneInstallSetupConfigBuilderStrategy implements AdapterConfigurationStrategy { @Override public <B extends AbstractAdapterConfigBuilder<B, C>, C extends AdapterConfig> void configure(B configBuilder) { configBuilder. setTrustAllCertificates(setup.isHavingUntrustedCertificate()). setUser(setup.getUserId()). setPasswordOrAPIToken(setup.getPassword()). setProductBaseUrl(setup.getBaseURL()); } OneInstallSetupConfigBuilderStrategy(OneInstallSetup setup); @Override void configure(B configBuilder); }
OneInstallSetupConfigBuilderStrategy implements AdapterConfigurationStrategy { @Override public <B extends AbstractAdapterConfigBuilder<B, C>, C extends AdapterConfig> void configure(B configBuilder) { configBuilder. setTrustAllCertificates(setup.isHavingUntrustedCertificate()). setUser(setup.getUserId()). setPasswordOrAPIToken(setup.getPassword()). setProductBaseUrl(setup.getBaseURL()); } OneInstallSetupConfigBuilderStrategy(OneInstallSetup setup); @Override void configure(B configBuilder);  }