@@ -42,18 +42,34 @@ public void shouldAssignPortForLocalHoverflyInstanceIfNotConfigured() {
4242 @ Test
4343 public void shouldThrowExceptionIfOnlySslKeyIsConfigured () {
4444
45- assertThatThrownBy (() -> localConfigs ().sslKeyPath ( "ssl/ca.key" ).build ())
45+ assertThatThrownBy (() -> localConfigs ().caCert ( "" , "ssl/ca.key" ).build ())
4646 .isInstanceOf (IllegalArgumentException .class )
47- .hasMessageContaining ("Both SSL key and certificate files are required to override the default Hoverfly SSL " );
47+ .hasMessageContaining ("Both ca cert and key files are required to override the default Hoverfly ca cert. " );
4848 }
4949
5050 @ Test
5151 public void shouldThrowExceptionIfOnlySslCertIsConfigured () {
5252
53- assertThatThrownBy (() -> localConfigs ().sslCertificatePath ("ssl/ca.crt" ).build ())
53+ assertThatThrownBy (() -> localConfigs ().caCert ("ssl/ca.crt" , " " ).build ())
5454 .isInstanceOf (IllegalArgumentException .class )
55- .hasMessageContaining ("Both SSL key and certificate files are required to override the default Hoverfly SSL" );
55+ .hasMessageContaining ("Both ca cert and key files are required to override the default Hoverfly ca cert." );
56+ }
57+
58+
59+ @ Test
60+ public void shouldThrowExceptionIfOnlyClientKeyIsConfigured () {
61+
62+ assertThatThrownBy (() -> localConfigs ().clientAuth ("" , "ssl/ca.key" ).build ())
63+ .isInstanceOf (IllegalArgumentException .class )
64+ .hasMessageContaining ("Both client cert and key files are required to enable mutual TLS authentication." );
65+ }
5666
67+ @ Test
68+ public void shouldThrowExceptionIfOnlyClientCertIsConfigured () {
69+
70+ assertThatThrownBy (() -> localConfigs ().clientAuth ("ssl/ca.crt" , "" ).build ())
71+ .isInstanceOf (IllegalArgumentException .class )
72+ .hasMessageContaining ("Both client cert and key files are required to enable mutual TLS authentication." );
5773 }
5874
5975 @ Test
0 commit comments