@@ -101,13 +101,13 @@ private XmlProcessor createProcessor(Map<String, Object> config) throws Exceptio
101101 private XmlProcessor createProcessorWithValidation (Map <String , Object > config ) throws Exception {
102102 XmlProcessor .Factory factory = createFactory ();
103103 String processorTag = randomAlphaOfLength (10 );
104-
104+
105105 // Make a copy of the config to avoid modifying the original
106106 Map <String , Object > configCopy = new HashMap <>(config );
107-
107+
108108 // Create the processor (this should consume config parameters)
109109 XmlProcessor processor = factory .create (null , processorTag , null , configCopy , null );
110-
110+
111111 // Simulate the validation check from ConfigurationUtils.readProcessor()
112112 if (configCopy .isEmpty () == false ) {
113113 throw new ElasticsearchParseException (
@@ -116,7 +116,7 @@ private XmlProcessor createProcessorWithValidation(Map<String, Object> config) t
116116 Arrays .toString (configCopy .keySet ().toArray ())
117117 );
118118 }
119-
119+
120120 return processor ;
121121 }
122122
@@ -298,7 +298,11 @@ public void testCreateWithInvalidNamespacesConfig() throws Exception {
298298 Map <String , Object > config = createBaseConfig ();
299299 config .put ("namespaces" , "invalid_string" ); // Should be a map
300300
301- expectCreationFailure (config , ElasticsearchParseException .class , "[namespaces] property isn't a map, but of type [java.lang.String]" );
301+ expectCreationFailure (
302+ config ,
303+ ElasticsearchParseException .class ,
304+ "[namespaces] property isn't a map, but of type [java.lang.String]"
305+ );
302306 }
303307
304308 public void testCreateWithInvalidNamespaceURI () throws Exception {
@@ -416,19 +420,19 @@ public void testConfigurationParametersAreProperlyRemoved() throws Exception {
416420 // Test that demonstrates configuration validation works when using production-like validation
417421 // This test verifies that ConfigurationUtils.readOptionalMap() properly removes parameters from config
418422 // If any are left, the processor factory should throw an exception about unknown parameters
419-
423+
420424 Map <String , String > xpathConfig = createXPathConfig ("//test" , "test_field" );
421425 Map <String , Object > config = createConfigWithXPath (DEFAULT_FIELD , xpathConfig );
422-
426+
423427 // Add an intentionally unknown parameter to trigger the validation
424428 config .put ("unknown_parameter" , "should_fail" );
425-
429+
426430 // This should fail because "unknown_parameter" should remain in config after all valid params are removed
427431 ElasticsearchParseException exception = expectThrows (
428432 ElasticsearchParseException .class ,
429433 () -> createProcessorWithValidation (config )
430434 );
431-
435+
432436 assertThat (exception .getMessage (), containsString ("doesn't support one or more provided configuration parameters" ));
433437 assertThat (exception .getMessage (), containsString ("unknown_parameter" ));
434438 }
0 commit comments