@@ -114,6 +114,42 @@ void sslPropertiesWhenTrustStoreLocationAndCertificatesSetShouldThrowException()
114114 .isThrownBy (properties ::buildConsumerProperties );
115115 }
116116
117+ @ Test
118+ void sslPropertiesWhenKeyStoreLocationAndBundleSetShouldThrowException () {
119+ KafkaProperties properties = new KafkaProperties ();
120+ properties .getSsl ().setBundle ("myBundle" );
121+ properties .getSsl ().setKeyStoreLocation (new ClassPathResource ("ksLoc" ));
122+ assertThatExceptionOfType (MutuallyExclusiveConfigurationPropertiesException .class )
123+ .isThrownBy (properties ::buildConsumerProperties );
124+ }
125+
126+ @ Test
127+ void sslPropertiesWhenKeyStoreKeyAndBundleSetShouldThrowException () {
128+ KafkaProperties properties = new KafkaProperties ();
129+ properties .getSsl ().setBundle ("myBundle" );
130+ properties .getSsl ().setKeyStoreKey ("-----BEGIN" );
131+ assertThatExceptionOfType (MutuallyExclusiveConfigurationPropertiesException .class )
132+ .isThrownBy (properties ::buildConsumerProperties );
133+ }
134+
135+ @ Test
136+ void sslPropertiesWhenTrustStoreLocationAndBundleSetShouldThrowException () {
137+ KafkaProperties properties = new KafkaProperties ();
138+ properties .getSsl ().setBundle ("myBundle" );
139+ properties .getSsl ().setTrustStoreLocation (new ClassPathResource ("tsLoc" ));
140+ assertThatExceptionOfType (MutuallyExclusiveConfigurationPropertiesException .class )
141+ .isThrownBy (properties ::buildConsumerProperties );
142+ }
143+
144+ @ Test
145+ void sslPropertiesWhenTrustStoreCertificatesAndBundleSetShouldThrowException () {
146+ KafkaProperties properties = new KafkaProperties ();
147+ properties .getSsl ().setBundle ("myBundle" );
148+ properties .getSsl ().setTrustStoreCertificates ("-----BEGIN" );
149+ assertThatExceptionOfType (MutuallyExclusiveConfigurationPropertiesException .class )
150+ .isThrownBy (properties ::buildConsumerProperties );
151+ }
152+
117153 @ Test
118154 void cleanupConfigDefaultValuesAreConsistent () {
119155 CleanupConfig cleanupConfig = new CleanupConfig ();
0 commit comments