use of com.hotels.styx.api.extension.service.Certificate in project styx by ExpediaGroup.
the class TlsSettingsTest method isImmutable.
@Test
public void isImmutable() throws Exception {
List<String> protocols = new ArrayList<String>() {
{
add("TLSv1");
}
};
List<String> cipherSuites = new ArrayList<String>() {
{
add("x");
}
};
Certificate[] certificates = new Certificate[] { certificate("x", "x") };
TlsSettings tlsSettings = new TlsSettings.Builder().additionalCerts(certificates).protocols(protocols).cipherSuites(cipherSuites).build();
protocols.add("TLSv1.2");
cipherSuites.add("y");
certificates[0] = certificate("y", "y");
assertThat(tlsSettings.protocols(), equalTo(List.of("TLSv1")));
assertThat(tlsSettings.cipherSuites(), equalTo(List.of("x")));
assertThat(tlsSettings.additionalCerts(), equalTo(Set.of(certificate("x", "x"))));
}
Aggregations