@@ -131,13 +131,13 @@ public void verifyStringMessages() throws JMSException {
131131 public void verifyCipherMappingsConfig () throws JMSException {
132132 final MQSinkTask newConnectTask = new MQSinkTask ();
133133
134- // configure a sink task for string messages
134+ // configure a sink task for validating config
135135 final Map <String , String > connectorConfigProps = createDefaultConnectorProperties ();
136136 connectorConfigProps .put ("mq.message.builder" ,
137137 DEFAULT_MESSAGE_BUILDER );
138138
139139 connectorConfigProps .put ("mq.ssl.use.ibm.cipher.mappings" ,
140- "true" );
140+ "true" );
141141
142142 // start the task so that it connects to MQ
143143 newConnectTask .start (connectorConfigProps );
@@ -148,6 +148,19 @@ public void verifyCipherMappingsConfig() throws JMSException {
148148
149149 // stop the task
150150 newConnectTask .stop ();
151+
152+ // configure a sink task for validating config for failure case
153+ connectorConfigProps .put ("mq.message.builder" ,
154+ DEFAULT_MESSAGE_BUILDER );
155+
156+ connectorConfigProps .put ("mq.ssl.use.ibm.cipher.mappings" ,
157+ "hello" );
158+
159+ // Verify the exception messages
160+ final ConfigException exc = assertThrows (ConfigException .class , () -> {
161+ newConnectTask .start (connectorConfigProps );
162+ });
163+ assertEquals ("Invalid value hello for configuration mq.ssl.use.ibm.cipher.mappings: Expected value to be either true or false" , exc .getMessage ());
151164 }
152165
153166 @ Test
0 commit comments