Skip to content

fill in missing test coverage for delete configset api#4407

Open
epugh wants to merge 1 commit intoapache:mainfrom
epugh:fill-in-delete-configset-api-test
Open

fill in missing test coverage for delete configset api#4407
epugh wants to merge 1 commit intoapache:mainfrom
epugh:fill-in-delete-configset-api-test

Conversation

@epugh
Copy link
Copy Markdown
Contributor

@epugh epugh commented May 8, 2026

Fill in the missing test coverage for delete configset api. Split out of #4203

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds unit test coverage for the DeleteConfigSet (v2) configsets delete API, primarily targeting input validation behavior without requiring ZooKeeper-backed deletion.

Changes:

  • Introduces a new DeleteConfigSetAPITest covering “missing configset name” scenarios.
  • Verifies BAD_REQUEST error codes and basic error-message content for invalid inputs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +71 to +92

@Test
public void testWhitespaceOnlyConfigSetNameThrowsBadRequest() {
final var api = new DeleteConfigSet(mockCoreContainer, null, null);
final var ex = assertThrows(SolrException.class, () -> api.deleteConfigSet(" "));

assertEquals(SolrException.ErrorCode.BAD_REQUEST.code, ex.code());
assertTrue(
"Error message should mention missing configset name",
ex.getMessage().contains("No configset name"));
}

@Test
public void testTabOnlyConfigSetNameThrowsBadRequest() {
final var api = new DeleteConfigSet(mockCoreContainer, null, null);
final var ex = assertThrows(SolrException.class, () -> api.deleteConfigSet("\t"));

assertEquals(SolrException.ErrorCode.BAD_REQUEST.code, ex.code());
assertTrue(
"Error message should mention missing configset name",
ex.getMessage().contains("No configset name"));
}
Comment on lines +83 to +92
@Test
public void testTabOnlyConfigSetNameThrowsBadRequest() {
final var api = new DeleteConfigSet(mockCoreContainer, null, null);
final var ex = assertThrows(SolrException.class, () -> api.deleteConfigSet("\t"));

assertEquals(SolrException.ErrorCode.BAD_REQUEST.code, ex.code());
assertTrue(
"Error message should mention missing configset name",
ex.getMessage().contains("No configset name"));
}
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.

2 participants