Skip to content

SOLR-18188: RestTestHarness overhaul, add URLUtil.buildURI#4270

Open
dsmiley wants to merge 2 commits intoapache:mainfrom
dsmiley:SOLR-18188-restTestHarness
Open

SOLR-18188: RestTestHarness overhaul, add URLUtil.buildURI#4270
dsmiley wants to merge 2 commits intoapache:mainfrom
dsmiley:SOLR-18188-restTestHarness

Conversation

@dsmiley
Copy link
Copy Markdown
Contributor

@dsmiley dsmiley commented Apr 7, 2026

Refactors RestTestHarness to be immutable and use Jetty HttpClient directly instead of Apache HttpClient. Introduces URLUtil.buildURI helper, used by RestTestHarness and a backup test.

I recommend starting viewing this from URLUtil, then test-framework, and then tests generally.

https://issues.apache.org/jira/browse/SOLR-18188

This was split off from #4266 so already got some review.

…til.buildURI

Refactors RestTestHarness to be immutable and use Jetty HttpClient directly
instead of Apache HttpClient. Introduces URLUtil.buildURI helper. Updates all
callers across test-framework, core, solrj, ltr, and language-models modules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Creates a REST client useful for HTTP operations. It closes when this {@link JettySolrRunner}
* is stopped.
*/
public RestTestHarness getRestClient(String collection) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose this name "getRestClient" as I think it's a better characterization of what RestTestHarness is.

* calling getJetty().stop()/start() directly.
*/
protected static void restartJetty() throws Exception {
getJetty().stop();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish I could prevent subclasses from reaching into Jetty to start/stop it, forcing them to use this method. Ah well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant