@Test public void testToServerDetails_missingBasePath() throws ConfigException { final ControlPointServerDetails serverDetails = validConfig.toBuilder().basePath(null).build().toServerDetails(); Assert.assertEquals("should not set base path", "/WebApi/api", serverDetails.getBasePath()); }
public ControlPointServerDetails toServerDetails() { final ControlPointServerDetails.ControlPointServerDetailsBuilder builder = ControlPointServerDetails.builder() .protocol(protocol.toLowerCase()) .host(host) .port(port) .username(credentials == null ? null : credentials.getUsername()) .password(credentials == null ? null : credentials.getPassword()); if (basePath != null) builder.basePath(basePath); return builder.build(); }
ControlPointServerConfig extends SimpleComponent<ControlPointServerConfig> implements PasswordsConfig<ControlPointServerConfig> { public ControlPointServerDetails toServerDetails() { final ControlPointServerDetails.ControlPointServerDetailsBuilder builder = ControlPointServerDetails.builder() .protocol(protocol.toLowerCase()) .host(host) .port(port) .username(credentials == null ? null : credentials.getUsername()) .password(credentials == null ? null : credentials.getPassword()); if (basePath != null) builder.basePath(basePath); return builder.build(); } }
ControlPointServerConfig extends SimpleComponent<ControlPointServerConfig> implements PasswordsConfig<ControlPointServerConfig> { public ControlPointServerDetails toServerDetails() { final ControlPointServerDetails.ControlPointServerDetailsBuilder builder = ControlPointServerDetails.builder() .protocol(protocol.toLowerCase()) .host(host) .port(port) .username(credentials == null ? null : credentials.getUsername()) .password(credentials == null ? null : credentials.getPassword()); if (basePath != null) builder.basePath(basePath); return builder.build(); }  }
ControlPointServerConfig extends SimpleComponent<ControlPointServerConfig> implements PasswordsConfig<ControlPointServerConfig> { public ControlPointServerDetails toServerDetails() { final ControlPointServerDetails.ControlPointServerDetailsBuilder builder = ControlPointServerDetails.builder() .protocol(protocol.toLowerCase()) .host(host) .port(port) .username(credentials == null ? null : credentials.getUsername()) .password(credentials == null ? null : credentials.getPassword()); if (basePath != null) builder.basePath(basePath); return builder.build(); }  @Override void basicValidate(final String component); @Override ControlPointServerConfig withoutPasswords(); @Override ControlPointServerConfig withEncryptedPasswords(final TextEncryptor encryptor); @Override ControlPointServerConfig withDecryptedPasswords(final TextEncryptor encryptor); ControlPointServerDetails toServerDetails(); }
ControlPointServerConfig extends SimpleComponent<ControlPointServerConfig> implements PasswordsConfig<ControlPointServerConfig> { public ControlPointServerDetails toServerDetails() { final ControlPointServerDetails.ControlPointServerDetailsBuilder builder = ControlPointServerDetails.builder() .protocol(protocol.toLowerCase()) .host(host) .port(port) .username(credentials == null ? null : credentials.getUsername()) .password(credentials == null ? null : credentials.getPassword()); if (basePath != null) builder.basePath(basePath); return builder.build(); }  @Override void basicValidate(final String component); @Override ControlPointServerConfig withoutPasswords(); @Override ControlPointServerConfig withEncryptedPasswords(final TextEncryptor encryptor); @Override ControlPointServerConfig withDecryptedPasswords(final TextEncryptor encryptor); ControlPointServerDetails toServerDetails();  }