Skip to content

Commit

Permalink
Add tests for coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
TarasSpashchenko committed Jun 19, 2024
1 parent 738a601 commit 4b81c3b
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,24 @@ void buildTargetHttpClient_positive_tlsDisabled() {
assertThat(client).isNotNull();
}

@Test
void buildTargetHttpClient_positive_tlsEnabledWithPublicCa() {
var client = getHttpClientBuilder(
TlsProperties.of(true, null, null, null));
assertThat(client).isNotNull();
}

@Test
void buildTargetHttpClient_positive_tlsEnabled() {
var client = getHttpClientBuilder(getEnabledTlsProperties());
assertThat(client).isNotNull();
}

@Test
void buildTargetHttpClient_positive_negative() {
assertThrows(SslInitializationException.class, () -> getHttpClientBuilder(getInvalidTlsProperties()));
}

private static TlsProperties getEnabledTlsProperties() {
return TlsProperties.of(true, "classpath:certificates/test.truststore.jks", "secretpassword", "JKS");
}
Expand Down

0 comments on commit 4b81c3b

Please sign in to comment.