From d17a1cdcebb46a6c9d360a6569319dd66021d346 Mon Sep 17 00:00:00 2001 From: Christine Poerschke Date: Mon, 14 Jun 2021 21:35:41 +0100 Subject: [PATCH] SOLR-14920: contrib/jaegertracer-configurator: apply & enforce 'spotless' code formatting (#162) --- gradle/validation/spotless.gradle | 1 - .../org/apache/solr/jaeger/package-info.java | 4 +--- .../solr/jaeger/TestJaegerConfigurator.java | 23 ++++++++----------- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/gradle/validation/spotless.gradle b/gradle/validation/spotless.gradle index cda4ba65ed40..34f93fcfe265 100644 --- a/gradle/validation/spotless.gradle +++ b/gradle/validation/spotless.gradle @@ -49,7 +49,6 @@ configure(project(":solr").subprojects) { prj -> case ":solr:contrib:clustering": case ":solr:contrib:extraction": case ":solr:contrib:gcs-repository": - case ":solr:contrib:jaegertracer-configurator": case ":solr:contrib:langid": case ":solr:contrib:ltr": case ":solr:contrib:prometheus-exporter": diff --git a/solr/contrib/jaegertracer-configurator/src/java/org/apache/solr/jaeger/package-info.java b/solr/contrib/jaegertracer-configurator/src/java/org/apache/solr/jaeger/package-info.java index 3562f362bf87..84a1337f1600 100644 --- a/solr/contrib/jaegertracer-configurator/src/java/org/apache/solr/jaeger/package-info.java +++ b/solr/contrib/jaegertracer-configurator/src/java/org/apache/solr/jaeger/package-info.java @@ -15,7 +15,5 @@ * limitations under the License. */ -/** - * Jaeger Tracer Configurator. - */ +/** Jaeger Tracer Configurator. */ package org.apache.solr.jaeger; diff --git a/solr/contrib/jaegertracer-configurator/src/test/org/apache/solr/jaeger/TestJaegerConfigurator.java b/solr/contrib/jaegertracer-configurator/src/test/org/apache/solr/jaeger/TestJaegerConfigurator.java index 9fc8d66de104..e15595acd4d5 100644 --- a/solr/contrib/jaegertracer-configurator/src/test/org/apache/solr/jaeger/TestJaegerConfigurator.java +++ b/solr/contrib/jaegertracer-configurator/src/test/org/apache/solr/jaeger/TestJaegerConfigurator.java @@ -17,10 +17,9 @@ package org.apache.solr.jaeger; -import java.util.concurrent.TimeUnit; - import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule; import io.opentracing.util.GlobalTracer; +import java.util.concurrent.TimeUnit; import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.request.CollectionAdminRequest; @@ -37,8 +36,7 @@ public class TestJaegerConfigurator extends SolrTestCaseJ4 { - @Rule - public TestRule solrTestRules = new SystemPropertiesRestoreRule(); + @Rule public TestRule solrTestRules = new SystemPropertiesRestoreRule(); @Before public void doBefore() { @@ -53,26 +51,23 @@ public void doBefore() { @Test public void testInjected() throws Exception { - MiniSolrCloudCluster cluster = new SolrCloudTestCase.Builder(2, createTempDir()) - .addConfig("config", TEST_PATH().resolve("collection1").resolve("conf")) - .withSolrXml(getFile("solr/solr.xml").toPath()) - .build(); + MiniSolrCloudCluster cluster = + new SolrCloudTestCase.Builder(2, createTempDir()) + .addConfig("config", TEST_PATH().resolve("collection1").resolve("conf")) + .withSolrXml(getFile("solr/solr.xml").toPath()) + .build(); try { TimeOut timeOut = new TimeOut(2, TimeUnit.MINUTES, TimeSource.NANO_TIME); timeOut.waitFor( "Waiting for GlobalTracer is registered", () -> GlobalTracer.get().toString().contains("JaegerTracer")); - //TODO add run Jaeger through Docker and verify spans available after run these commands + // TODO add run Jaeger through Docker and verify spans available after run these commands CollectionAdminRequest.createCollection("test", 2, 1).process(cluster.getSolrClient()); - new UpdateRequest() - .add("id", "1") - .add("id", "2") - .process(cluster.getSolrClient(), "test"); + new UpdateRequest().add("id", "1").add("id", "2").process(cluster.getSolrClient(), "test"); cluster.getSolrClient().query("test", new SolrQuery("*:*")); } finally { cluster.shutdown(); } - } }