risdenk commented on code in PR #953:
URL: https://github.com/apache/solr/pull/953#discussion_r998708897
##########
solr/core/src/test/org/apache/solr/handler/ReplicationTestHelper.java:
##########
@@ -202,15 +199,16 @@ public static NamedList<Object> getDetails(SolrClient s)
throws Exception {
@SuppressWarnings("unchecked")
NamedList<Object> details = (NamedList<Object>) res.get("details");
- assertNotNull("null details", details);
+ SolrTestCaseJ4.assertNotNull("null details", details);
return details;
}
public static void assertReplicationResponseSucceeded(NamedList<?> response)
{
- assertNotNull("null response from server", response);
- assertNotNull("Expected replication response to have 'status' field",
response.get("status"));
- assertEquals("OK", response.get("status"));
+ SolrTestCaseJ4.assertNotNull("null response from server", response);
Review Comment:
I'll take a look to see what can be done here.
##########
solr/core/src/test/org/apache/solr/update/SoftAutoCommitTest.java:
##########
@@ -637,6 +636,6 @@ public void clear() {
}
public void assertSaneOffers() {
- assertEquals("Failure of MockEventListener" + fail.toString(), 0,
fail.length());
+ SolrTestCaseJ4.assertEquals("Failure of MockEventListener" +
fail.toString(), 0, fail.length());
Review Comment:
because this is in `MockEventListener` and doesn't extend anything with that
method. This uses `SolrTestCaseJ4` since it is the correct class in the chain
that was already imported. `SolrTestCaseJ4` ends up inheriting from Assert
anyway.
##########
solr/core/src/test/org/apache/solr/handler/V2ClusterAPIMappingTest.java:
##########
@@ -48,7 +47,7 @@
import org.mockito.ArgumentCaptor;
/** Unit tests for the v2 to v1 API mappings found in {@link ClusterAPI} */
-public class V2ClusterAPIMappingTest {
+public class V2ClusterAPIMappingTest extends SolrTestCaseJ4 {
Review Comment:
`import static org.apache.solr.SolrTestCaseJ4.assumeWorkingMockito;` was
there so this class was already relying on stuff from SolrTestCaseJ4 so used
SolrTestCaseJ4.
##########
solr/core/src/test/org/apache/solr/response/TestRetrieveFieldsOptimizer.java:
##########
@@ -616,7 +615,7 @@ List<String> getValsForField() {
break;
default:
- fail("Found no case for field " + name + " type " + type);
+ SolrTestCaseJ4.fail("Found no case for field " + name + " type " +
type);
Review Comment:
because this is in `RetrieveField` and doesn't extend anything with that
method. This uses `SolrTestCaseJ4` since it is the correct class in the chain
that was already imported. `SolrTestCaseJ4` ends up inheriting from Assert
anyway.
##########
solr/core/src/test/org/apache/solr/handler/V2UpdateAPIMappingTest.java:
##########
@@ -39,7 +38,7 @@
import org.junit.Test;
/** Unit tests for the v2 to v1 mapping logic in {@link UpdateAPI} */
-public class V2UpdateAPIMappingTest {
+public class V2UpdateAPIMappingTest extends SolrTestCaseJ4 {
Review Comment:
`import static org.apache.solr.SolrTestCaseJ4.assumeWorkingMockito;` was
there so this class was already relying on stuff from SolrTestCaseJ4 so used
SolrTestCaseJ4.
##########
solr/core/src/test/org/apache/solr/handler/admin/api/V2NodeAPIMappingTest.java:
##########
@@ -55,7 +53,7 @@
import org.mockito.ArgumentCaptor;
/** Unit tests for the v2 to v1 mapping for /node/ APIs. */
-public class V2NodeAPIMappingTest {
+public class V2NodeAPIMappingTest extends SolrTestCaseJ4 {
Review Comment:
`import static org.apache.solr.SolrTestCaseJ4.assumeWorkingMockito;` was
there so this class was already relying on stuff from SolrTestCaseJ4 so used
SolrTestCaseJ4.
##########
solr/core/src/test/org/apache/solr/parser/SolrQueryParserBaseTest.java:
##########
@@ -26,19 +24,17 @@
import java.util.List;
import org.apache.lucene.queryparser.charstream.CharStream;
import org.apache.lucene.search.Query;
+import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrException;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.search.QParser;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.mockito.Mockito;
-@RunWith(MockitoJUnitRunner.class)
-public class SolrQueryParserBaseTest {
+public class SolrQueryParserBaseTest extends SolrTestCaseJ4 {
Review Comment:
`import static org.apache.solr.SolrTestCaseJ4.assumeWorkingMockito;` was
there so this class was already relying on stuff from SolrTestCaseJ4 so used
SolrTestCaseJ4.
the `super.setUp()` is checked by Lucene to ensure that things are properly
inherited if overrode.
--
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]