epugh commented on code in PR #3708:
URL: https://github.com/apache/solr/pull/3708#discussion_r2634766341
##########
solr/core/src/test/org/apache/solr/update/processor/TolerantUpdateProcessorTest.java:
##########
@@ -379,12 +391,36 @@ public void testResponse() throws SAXException,
XPathExpressionException, IOExce
}
public String update(String chain, String xml) {
- DirectSolrConnection connection = new DirectSolrConnection(h.getCore());
- SolrRequestHandler handler = h.getCore().getRequestHandler("/update");
- ModifiableSolrParams params = new ModifiableSolrParams();
- params.add("update.chain", chain);
try {
- return connection.request(handler, params, xml);
+ // Use DirectXmlRequest to send raw XML through EmbeddedSolrServer
+ DirectXmlRequest xmlRequest = new DirectXmlRequest("/update", xml);
+
+ // Set the update chain parameter
+ ModifiableSolrParams params = new ModifiableSolrParams();
+ params.add("update.chain", chain);
+ params.add("wt", "xml");
+ xmlRequest.setParams(params);
+
+ // Process the request and get the response
+ NamedList<Object> response = server.request(xmlRequest);
Review Comment:
thanks for the tip. This is what we should have in our `CLAUDE.md` btw...
Really shortened up the code base. I'm going to ask Claude to look for this
pattern elsewhere...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]