This is an automated email from the ASF dual-hosted git repository. apupier pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit ec1988c646d1d924116c76b3465b2d62038974a8 Author: Aurélien Pupier <apup...@redhat.com> AuthorDate: Fri Jul 25 10:34:13 2025 +0200 fix: update solr test to not use method removed from API by Solr 9.9 API removed with this commit https://github.com/apache/solr/commit/f1050ff766d6a0f30fe2784d70684faec346a70c#diff-18ac9cddf2673c790b338096b1dd7ede817c529b33242e7098c2abc115361168 Signed-off-by: Aurélien Pupier <apup...@redhat.com> --- .../solr/integration/SolrInsertAndDeleteTest.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrInsertAndDeleteTest.java b/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrInsertAndDeleteTest.java index c78a3e71d3b..47903af844e 100644 --- a/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrInsertAndDeleteTest.java +++ b/components/camel-solr/src/test/java/org/apache/camel/component/solr/integration/SolrInsertAndDeleteTest.java @@ -17,6 +17,8 @@ package org.apache.camel.component.solr.integration; import java.io.File; +import java.io.IOException; +import java.io.StringWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -115,11 +117,13 @@ public class SolrInsertAndDeleteTest extends SolrTestSupport { } @Test - public void testInsertSolrInputDocumentAsXMLWithoutAddRoot() { + public void testInsertSolrInputDocumentAsXMLWithoutAddRoot() throws IOException { SolrInputDocument doc = new SolrInputDocument(); doc.addField("id", "MA147LL/A"); - String docAsXml = ClientUtils.toXML(doc); + StringWriter writer = new StringWriter(); + ClientUtils.writeXML(doc, writer); + String docAsXml = writer.toString(); executeInsertFor(docAsXml); QueryResponse response = executeSolrQuery("id:MA147LL/A"); @@ -128,11 +132,14 @@ public class SolrInsertAndDeleteTest extends SolrTestSupport { } @Test - public void testInsertSolrInputDocumentAsXMLWithAddRoot() { + public void testInsertSolrInputDocumentAsXMLWithAddRoot() throws IOException { SolrInputDocument doc = new SolrInputDocument(); doc.addField("id", "MA147LL/A"); - String docAsXml = "<add>" + ClientUtils.toXML(doc) + "</add>"; + StringWriter writer = new StringWriter(); + ClientUtils.writeXML(doc, writer); + String content = writer.toString(); + String docAsXml = "<add>" + content + "</add>"; Map<String, Object> headers = Map.of(Exchange.CONTENT_TYPE, "text/xml"); executeInsertFor(docAsXml, headers);