Skip to content

Migrate RenameCoreAPI from homegrown @EndPoint/@Command to JAX-RS; use SolrJettyTestRule in tests#4172

Open
epugh wants to merge 4 commits intoapache:mainfrom
epugh:copilot/migrate-rename-core-api
Open

Migrate RenameCoreAPI from homegrown @EndPoint/@Command to JAX-RS; use SolrJettyTestRule in tests#4172
epugh wants to merge 4 commits intoapache:mainfrom
epugh:copilot/migrate-rename-core-api

Conversation

@epugh
Copy link
Contributor

@epugh epugh commented Feb 28, 2026

RenameCoreAPI.java was the last remnant of the old @EndPoint/@Command V2 API style for core renaming. The JAX-RS implementation (RenameCore.java, RenameCoreApi.java, RenameCoreRequestBody.java) already existed and was fully wired into CoreAdminHandler.getJerseyResources() and CoreAdminOperation.RENAME_OP — the old class was dead production code only referenced in a mock-based test.

Changes

  • Deleted RenameCoreAPI.java — superseded by RenameCore.java
  • Updated V2CoreAPIMappingTest — removed RenameCoreAPI registration and its mock-based testRenameCoreAllParams test
  • Added RenameCoreAPITest — unit tests for RenameCore using SolrJettyTestRule (no mocks, no initCore), following the pattern of ShowFileRequestHandlerTest

Tests cover: same-name early return, missing request body, and missing to parameter.

Copilot AI and others added 4 commits February 28, 2026 13:34
…ate tests

Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
Co-authored-by: epugh <22395+epugh@users.noreply.github.com>
@epugh
Copy link
Contributor Author

epugh commented Feb 28, 2026

I've done a bit of work in my own epugh/solr branch with copilot on this before opening here. Tests pass.

solrTestRule.startSolr(createTempDir());
solrTestRule.newCollection(DEFAULT_TEST_CORENAME).withConfigSet(ExternalPaths.DEFAULT_CONFIGSET).create();
}

Copy link
Contributor

Choose a reason for hiding this comment

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

code above seems fine... but the setup and tests below are low-level, reaching directly into Solr instead of using SolrClient. Why?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants