From e21462d382424be56f4e88a54abd8d8110d3e421 Mon Sep 17 00:00:00 2001 From: Philippus Baalman Date: Fri, 8 Nov 2024 23:56:34 +0100 Subject: [PATCH] Remove unneeded `println`s (#3205) --- .../index/analyze/AnalyseRequestContentBuilderTest.scala | 8 -------- .../index/analyze/AnalyzeRequestHandlerTest.scala | 2 -- .../searches/queries/IntervalsQueryBuilderFnTest.scala | 2 -- .../CatsEffectTest.scala | 6 ------ .../CatsEffectTest.scala | 6 ------ .../elastic4s/requests/indexes/AnalyzeRequestTests.scala | 1 - 6 files changed, 25 deletions(-) diff --git a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/index/analyze/AnalyseRequestContentBuilderTest.scala b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/index/analyze/AnalyseRequestContentBuilderTest.scala index 057f9a0e8..49fb16af1 100644 --- a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/index/analyze/AnalyseRequestContentBuilderTest.scala +++ b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/index/analyze/AnalyseRequestContentBuilderTest.scala @@ -14,7 +14,6 @@ class AnalyseRequestContentBuilderTest extends AnyFunSuite with Matchers { AnalyzeRequest(Array("hello world")) .analyzer("smartcn") ) - println(content) content mustBe """{"text":["hello world"],"analyzer":"smartcn"}""".stripMargin } @@ -25,7 +24,6 @@ class AnalyseRequestContentBuilderTest extends AnyFunSuite with Matchers { .analyzer("smartcn") .explain(true) ) - println(content) content mustBe """{"text":["hello world"],"analyzer":"smartcn","explain":true}""".stripMargin } @@ -36,7 +34,6 @@ class AnalyseRequestContentBuilderTest extends AnyFunSuite with Matchers { .explain(true) .tokenizer("keyword") ) - println(content) content mustBe """{"text":["hello world"],"explain":true,"tokenizer":"keyword"}""".stripMargin } @@ -48,7 +45,6 @@ class AnalyseRequestContentBuilderTest extends AnyFunSuite with Matchers { .filters("lowercase") .charFilters("html_strip") ) - println(content) content mustBe """{"text":["hello world"],"tokenizer":"keyword","filter":["lowercase"],"char_filter":["html_strip"]}""".stripMargin } @@ -60,7 +56,6 @@ class AnalyseRequestContentBuilderTest extends AnyFunSuite with Matchers { .filters("lowercase","uppercase") .filters(StopAnalyzer("stop",List("a","is","this"))) ) - println(content) content mustBe """{"text":["hello world"],"tokenizer":"keyword","filter":["lowercase","uppercase",{"type":"stop","stopwords":["a","is","this"]}]}""".stripMargin } @@ -70,7 +65,6 @@ class AnalyseRequestContentBuilderTest extends AnyFunSuite with Matchers { AnalyzeRequest(Array("hello world")) .normalizer("my_normalizer") ) - println(content) content mustBe """{"text":["hello world"],"normalizer":"my_normalizer"}""".stripMargin } @@ -80,7 +74,6 @@ class AnalyseRequestContentBuilderTest extends AnyFunSuite with Matchers { AnalyzeRequest(Array("hello world")) .field("obj1.field1") ) - println(content) content mustBe """{"text":["hello world"],"field":"obj1.field1"}""".stripMargin } @@ -90,7 +83,6 @@ class AnalyseRequestContentBuilderTest extends AnyFunSuite with Matchers { AnalyzeRequest(Array("hello world")) .attributes("keyword") ) - println(content) content mustBe """{"text":["hello world"],"attributes":["keyword"]}""".stripMargin } diff --git a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/index/analyze/AnalyzeRequestHandlerTest.scala b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/index/analyze/AnalyzeRequestHandlerTest.scala index ce3a66a2d..41f394d8a 100644 --- a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/index/analyze/AnalyzeRequestHandlerTest.scala +++ b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/index/analyze/AnalyzeRequestHandlerTest.scala @@ -14,8 +14,6 @@ class AnalyzeRequestHandlerTest extends AnyFunSuite with Matchers with IndexHand .index("testIndex") val result = AnalyzeRequestHandler.build(analyzeRequest) - println(result) - result.method mustBe "GET" result.endpoint mustBe "/testIndex/_analyze" result.entity.foreach { diff --git a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/searches/queries/IntervalsQueryBuilderFnTest.scala b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/searches/queries/IntervalsQueryBuilderFnTest.scala index aa93ad399..fc0e1be39 100644 --- a/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/searches/queries/IntervalsQueryBuilderFnTest.scala +++ b/elastic4s-core/src/test/scala/com/sksamuel/elastic4s/requests/searches/queries/IntervalsQueryBuilderFnTest.scala @@ -65,7 +65,6 @@ class IntervalsQueryBuilderFnTest extends AnyFunSuite with Matchers with GivenWh When("Intervals query is built") val queryBody = queries.IntervalsQueryBuilderFn(query) - println(queryBody.string) Then("query should have right fields") queryBody.string should matchJson(intervalsWithFilterQuery) } @@ -103,7 +102,6 @@ class IntervalsQueryBuilderFnTest extends AnyFunSuite with Matchers with GivenWh When("Intervals query is built") val queryBody = queries.IntervalsQueryBuilderFn(query) - println(queryBody.string) Then("query should have right fields") queryBody.string should matchJson(intervalsWithScriptQuery) } diff --git a/elastic4s-effect-cats-2/src/test/scala/com.sksamuel.elastic4s.cats.effect/CatsEffectTest.scala b/elastic4s-effect-cats-2/src/test/scala/com.sksamuel.elastic4s.cats.effect/CatsEffectTest.scala index 0ab10951b..80a52966e 100644 --- a/elastic4s-effect-cats-2/src/test/scala/com.sksamuel.elastic4s.cats.effect/CatsEffectTest.scala +++ b/elastic4s-effect-cats-2/src/test/scala/com.sksamuel.elastic4s.cats.effect/CatsEffectTest.scala @@ -22,27 +22,21 @@ class CatsEffectTest extends AnyFlatSpec { "ElasticClient#execute" should "compile and infer effect type as `IO`" in { for { r1 <- client.execute(createIndex(index)) - _ <- IO(println(r1)) r2 <- client.execute(deleteIndex(index)) - _ <- IO(println(r2)) } yield (r1, r2) } it should "still compile with other Cats `Async` instances with explicit type annotations" in { for { r1 <- client.execute[CreateIndexRequest, CreateIndexResponse, OptionIO](createIndex(index)) - _ <- IO(println(r1)).to[OptionIO] r2 <- client.execute[DeleteIndexRequest, DeleteIndexResponse, OptionIO](deleteIndex(index)) - _ <- IO(println(r2)).to[OptionIO] } yield (r1, r2) } it should "still compile with `Future` with explicit type annotations" in { for { r1 <- client.execute[CreateIndexRequest, CreateIndexResponse, Future](createIndex(index)) - _ <- Future(println(r1)) r2 <- client.execute[DeleteIndexRequest, DeleteIndexResponse, Future](deleteIndex(index)) - _ <- Future(println(r2)) } yield (r1, r2) } } diff --git a/elastic4s-effect-cats/src/test/scala/com.sksamuel.elastic4s.cats.effect/CatsEffectTest.scala b/elastic4s-effect-cats/src/test/scala/com.sksamuel.elastic4s.cats.effect/CatsEffectTest.scala index 0ab10951b..80a52966e 100644 --- a/elastic4s-effect-cats/src/test/scala/com.sksamuel.elastic4s.cats.effect/CatsEffectTest.scala +++ b/elastic4s-effect-cats/src/test/scala/com.sksamuel.elastic4s.cats.effect/CatsEffectTest.scala @@ -22,27 +22,21 @@ class CatsEffectTest extends AnyFlatSpec { "ElasticClient#execute" should "compile and infer effect type as `IO`" in { for { r1 <- client.execute(createIndex(index)) - _ <- IO(println(r1)) r2 <- client.execute(deleteIndex(index)) - _ <- IO(println(r2)) } yield (r1, r2) } it should "still compile with other Cats `Async` instances with explicit type annotations" in { for { r1 <- client.execute[CreateIndexRequest, CreateIndexResponse, OptionIO](createIndex(index)) - _ <- IO(println(r1)).to[OptionIO] r2 <- client.execute[DeleteIndexRequest, DeleteIndexResponse, OptionIO](deleteIndex(index)) - _ <- IO(println(r2)).to[OptionIO] } yield (r1, r2) } it should "still compile with `Future` with explicit type annotations" in { for { r1 <- client.execute[CreateIndexRequest, CreateIndexResponse, Future](createIndex(index)) - _ <- Future(println(r1)) r2 <- client.execute[DeleteIndexRequest, DeleteIndexResponse, Future](deleteIndex(index)) - _ <- Future(println(r2)) } yield (r1, r2) } } diff --git a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/indexes/AnalyzeRequestTests.scala b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/indexes/AnalyzeRequestTests.scala index 91e68403d..84b413469 100644 --- a/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/indexes/AnalyzeRequestTests.scala +++ b/elastic4s-tests/src/test/scala/com/sksamuel/elastic4s/requests/indexes/AnalyzeRequestTests.scala @@ -66,7 +66,6 @@ class AnalyzeRequestTests extends AnyFlatSpec with Matchers with DockerTests { .tokenizer("letter") }.await.result - println(result) result shouldBe NoExplainAnalyzeResponse( List( AnalyseToken("hello", 0, 5, "word", 0),