dsmiley commented on code in PR #4778:
URL: https://github.com/apache/solr/pull/4778#discussion_r3940727894
##########
solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpSolrClientBadInputTest.java:
##########
@@ -50,58 +50,56 @@ public static void beforeTest() throws Exception {
@Test
public void testDeleteByIdReportsInvalidIdLists() throws Exception {
- try (SolrClient client = getHttpSolrClient(solrTestRule.getBaseUrl(),
ANY_COLLECTION)) {
- assertExceptionThrownWithMessageContaining(
- IllegalArgumentException.class,
- List.of("ids", "null"),
- () -> {
- client.deleteById(NULL_STR_LIST);
- });
- assertExceptionThrownWithMessageContaining(
- IllegalArgumentException.class,
- List.of("ids", "empty"),
- () -> {
- client.deleteById(EMPTY_STR_LIST);
- });
- assertExceptionThrownWithMessageContaining(
- IllegalArgumentException.class,
- List.of("ids", "null"),
- () -> {
- client.deleteById(NULL_STR_LIST, ANY_COMMIT_WITHIN_TIME);
- });
- assertExceptionThrownWithMessageContaining(
- IllegalArgumentException.class,
- List.of("ids", "empty"),
- () -> {
- client.deleteById(EMPTY_STR_LIST, ANY_COMMIT_WITHIN_TIME);
- });
- }
+ SolrClient client = solrTestRule.getSolrClient(ANY_COLLECTION);
+ assertExceptionThrownWithMessageContaining(
+ IllegalArgumentException.class,
+ List.of("ids", "null"),
+ () -> {
+ client.deleteById(NULL_STR_LIST);
+ });
+ assertExceptionThrownWithMessageContaining(
+ IllegalArgumentException.class,
+ List.of("ids", "empty"),
+ () -> {
+ client.deleteById(EMPTY_STR_LIST);
+ });
+ assertExceptionThrownWithMessageContaining(
+ IllegalArgumentException.class,
+ List.of("ids", "null"),
+ () -> {
+ client.deleteById(NULL_STR_LIST, ANY_COMMIT_WITHIN_TIME);
+ });
+ assertExceptionThrownWithMessageContaining(
+ IllegalArgumentException.class,
+ List.of("ids", "empty"),
+ () -> {
+ client.deleteById(EMPTY_STR_LIST, ANY_COMMIT_WITHIN_TIME);
+ });
- try (SolrClient client = getHttpSolrClient(solrTestRule.getBaseUrl())) {
Review Comment:
This change is an abuse of getAdminClient(). It's javadoc declares it's for
administrative actions. Instead, you're doing core specific requests on the
data (definitely not administrative).
Instead just call `getSolrClient` on it.
--
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]