From ceff2cefdcd21f0ab7d43fa38463dd8e0995314f Mon Sep 17 00:00:00 2001 From: Sven Nissel Date: Mon, 9 May 2022 21:27:09 +0200 Subject: [PATCH] #630 newer scalar library for java 17 compatibility --- buildSrc/src/main/java/olv.java-conventions.gradle | 2 +- .../otros/logview/scala/SimpleTreePrinterTest.scala | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/buildSrc/src/main/java/olv.java-conventions.gradle b/buildSrc/src/main/java/olv.java-conventions.gradle index df04e5de..34a11bb5 100644 --- a/buildSrc/src/main/java/olv.java-conventions.gradle +++ b/buildSrc/src/main/java/olv.java-conventions.gradle @@ -65,7 +65,7 @@ dependencies { implementation 'ch.qos.logback:logback-core:1.1.3' implementation 'ch.qos.logback:logback-classic:1.1.3' implementation 'org.unix4j:unix4j-command:0.3' - implementation 'org.scala-lang:scala-library:2.12.4' + implementation 'org.scala-lang:scala-library:2.12.15' implementation 'org.scala-lang.modules:scala-parser-combinators_2.12:1.1.0' implementation 'io.dropwizard.metrics:metrics-core:3.2.2' implementation 'com.alibaba:fastjson:1.2.76' diff --git a/olv-formatter/src/test/scala/pl/otros/logview/scala/SimpleTreePrinterTest.scala b/olv-formatter/src/test/scala/pl/otros/logview/scala/SimpleTreePrinterTest.scala index 97d111b3..4aef973a 100644 --- a/olv-formatter/src/test/scala/pl/otros/logview/scala/SimpleTreePrinterTest.scala +++ b/olv-formatter/src/test/scala/pl/otros/logview/scala/SimpleTreePrinterTest.scala @@ -2,7 +2,7 @@ package pl.otros.logview.scala import org.junit.runner.RunWith import org.scalatest.junit.JUnitRunner -import org.scalatest.{Matchers, WordSpecLike} +import org.scalatest.{Assertion, Matchers, WordSpecLike} @RunWith(classOf[JUnitRunner]) class SimpleTreePrinterTest extends WordSpecLike with Matchers { @@ -10,7 +10,7 @@ class SimpleTreePrinterTest extends WordSpecLike with Matchers { "SimpleTreePrinter" should { "print empty list" in { val tree: Tree = ListValue(List.empty[Tree]) - val expected =""" *── List: """ + val expected = """ *── List: """ test(tree, expected) } @@ -35,7 +35,7 @@ class SimpleTreePrinterTest extends WordSpecLike with Matchers { "print empty set" in { val tree: Tree = SetValue(List.empty[Tree]) - val expected =""" *── Set: """ + val expected = """ *── Set: """ test(tree, expected) } @@ -60,7 +60,7 @@ class SimpleTreePrinterTest extends WordSpecLike with Matchers { "print empty Map" in { val tree: Tree = MapValue(Map.empty) - val expected =""" *── Map: """ + val expected = """ *── Map: """ test(tree, expected) } @@ -179,9 +179,9 @@ class SimpleTreePrinterTest extends WordSpecLike with Matchers { test(tree, expected) } - def test(tree: Tree, expected: String) = { + def test(tree: Tree, expected: String): Assertion = { val printed: String = new SimpleTreePrinter().printTree(tree) - val expectedWithoutEmptyLines = expected.lines.filter(_.trim.nonEmpty).mkString("\n") + val expectedWithoutEmptyLines = expected.linesIterator.filter(_.trim.nonEmpty).mkString("\n") printed shouldBe expectedWithoutEmptyLines }