TlsConfiguration { public static Builder builder() { return new Builder(); } @VisibleForTesting  TlsConfiguration(String keystoreFilePath, String keystorePassword, String truststoreFilePath, String truststorePassword); static Builder builder(); String getKeystoreFilePath(); String getKeystorePassword(); String getTruststoreFilePath(); String getTruststorePassword(); @Override final boolean equals(Object o); @Override final int hashCode();  }
@Test public void buildShouldThrowWhenNotEnabled() { expectedException.expect(IllegalStateException.class); TlsConfiguration.builder().build(); }
@Test public void buildShouldThrowWhenEnableWithoutKeystore() { expectedException.expect(IllegalStateException.class); TlsConfiguration.builder().build(); }
@Test public void selfSignedShouldThrowOnNullKeyStorePath() { expectedException.expect(NullPointerException.class); TlsConfiguration.builder() .selfSigned(null, "abc"); }
@Test public void selfSignedShouldThrowOnNullKeyStorePassword() { expectedException.expect(NullPointerException.class); TlsConfiguration.builder() .selfSigned("abc", null); }
@Test public void buildShouldWorkOnSelfSignedHttps() { assertThat( TlsConfiguration.builder() .selfSigned("abcd", "efgh") .build()) .isEqualTo(new TlsConfiguration("abcd", "efgh", null, null)); }
@Test public void buildShouldWorkOnTrustedHttps() { assertThat( TlsConfiguration.builder() .raw("a", "b", "c", "d") .build()) .isEqualTo(new TlsConfiguration("a", "b", "c", "d")); }