diff --git a/conventions/src/main/kotlin/otel.scala-conventions.gradle.kts b/conventions/src/main/kotlin/otel.scala-conventions.gradle.kts index 7526753ca728..0dadb3225bed 100644 --- a/conventions/src/main/kotlin/otel.scala-conventions.gradle.kts +++ b/conventions/src/main/kotlin/otel.scala-conventions.gradle.kts @@ -6,7 +6,6 @@ plugins { dependencies { testImplementation("org.scala-lang:scala-library") - testImplementation("org.scala-lang.modules:scala-java8-compat_2.11") } tasks { diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index 98a200b84ae0..7d6d31348d79 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -116,7 +116,6 @@ val DEPENDENCIES = listOf( "org.spockframework:spock-core:2.2-M1-groovy-4.0", "org.spockframework:spock-junit4:2.2-M1-groovy-4.0", "org.scala-lang:scala-library:2.11.12", - "org.scala-lang.modules:scala-java8-compat_2.11:1.0.2", // Note that this is only referenced as "org.springframework.boot" in build files, not the artifact name. "org.springframework.boot:spring-boot-dependencies:2.3.1.RELEASE" ) diff --git a/instrumentation/akka/akka-actor-2.5/javaagent/src/test/scala/io/opentelemetry/instrumentation/akkaactor/AkkaActorTest.scala b/instrumentation/akka/akka-actor-2.5/javaagent/src/test/scala/io/opentelemetry/instrumentation/akkaactor/AkkaActorTest.scala index 1c7c308b6afe..1264367e9d97 100644 --- a/instrumentation/akka/akka-actor-2.5/javaagent/src/test/scala/io/opentelemetry/instrumentation/akkaactor/AkkaActorTest.scala +++ b/instrumentation/akka/akka-actor-2.5/javaagent/src/test/scala/io/opentelemetry/instrumentation/akkaactor/AkkaActorTest.scala @@ -16,6 +16,8 @@ import org.junit.jupiter.api.TestInstance import org.junit.jupiter.api.extension.RegisterExtension import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.ValueSource + +import java.util.function.Consumer import scala.compat.java8.FunctionConverters._ @TestInstance(TestInstance.Lifecycle.PER_CLASS) @@ -34,24 +36,26 @@ class AkkaActorTest { val assertions = (1 to count) .map(_ => - ((trace: TraceAssert) => { - trace.hasSpansSatisfyingExactly( - ((span: SpanDataAssert) => { - span - .hasName("parent") - .hasAttributes(Attributes.empty()) - () - }).asJava, - ((span: SpanDataAssert) => { - span - .hasName("Howdy, Akka") - .hasParent(trace.getSpan(0)) - .hasAttributes(Attributes.empty()) - () - }).asJava - ) - () - }).asJava + new Consumer[TraceAssert] { + override def accept(trace: TraceAssert): Unit = + trace.hasSpansSatisfyingExactly( + new Consumer[SpanDataAssert] { + override def accept(span: SpanDataAssert): Unit = { + span + .hasName("parent") + .hasAttributes(Attributes.empty()) + } + }, + new Consumer[SpanDataAssert] { + override def accept(span: SpanDataAssert): Unit = { + span + .hasName("Howdy, Akka") + .hasParent(trace.getSpan(0)) + .hasAttributes(Attributes.empty()) + } + } + ) + } ) .asJava @@ -68,24 +72,26 @@ class AkkaActorTest { val assertions = (1 to count) .map(_ => - ((trace: TraceAssert) => { - trace.hasSpansSatisfyingExactly( - ((span: SpanDataAssert) => { - span - .hasName("parent") - .hasAttributes(Attributes.empty()) - () - }).asJava, - ((span: SpanDataAssert) => { - span - .hasName("Howdy, Akka") - .hasParent(trace.getSpan(0)) - .hasAttributes(Attributes.empty()) - () - }).asJava - ) - () - }).asJava + new Consumer[TraceAssert] { + override def accept(trace: TraceAssert): Unit = + trace.hasSpansSatisfyingExactly( + new Consumer[SpanDataAssert] { + override def accept(span: SpanDataAssert): Unit = { + span + .hasName("parent") + .hasAttributes(Attributes.empty()) + } + }, + new Consumer[SpanDataAssert] { + override def accept(span: SpanDataAssert): Unit = { + span + .hasName("Howdy, Akka") + .hasParent(trace.getSpan(0)) + .hasAttributes(Attributes.empty()) + } + } + ) + } ) .asJava @@ -102,24 +108,26 @@ class AkkaActorTest { val assertions = (1 to count) .map(_ => - ((trace: TraceAssert) => { - trace.hasSpansSatisfyingExactly( - ((span: SpanDataAssert) => { - span - .hasName("parent") - .hasAttributes(Attributes.empty()) - () - }).asJava, - ((span: SpanDataAssert) => { - span - .hasName("Hello, Akka") - .hasParent(trace.getSpan(0)) - .hasAttributes(Attributes.empty()) - () - }).asJava - ) - () - }).asJava + new Consumer[TraceAssert] { + override def accept(trace: TraceAssert): Unit = + trace.hasSpansSatisfyingExactly( + new Consumer[SpanDataAssert] { + override def accept(span: SpanDataAssert): Unit = { + span + .hasName("parent") + .hasAttributes(Attributes.empty()) + } + }, + new Consumer[SpanDataAssert] { + override def accept(span: SpanDataAssert): Unit = { + span + .hasName("Hello, Akka") + .hasParent(trace.getSpan(0)) + .hasAttributes(Attributes.empty()) + } + } + ) + } ) .asJava diff --git a/instrumentation/akka/akka-actor-2.5/javaagent/src/test/scala/io/opentelemetry/instrumentation/akkaactor/AkkaActors.scala b/instrumentation/akka/akka-actor-2.5/javaagent/src/test/scala/io/opentelemetry/instrumentation/akkaactor/AkkaActors.scala index 1d0a7879c215..3350838b178b 100644 --- a/instrumentation/akka/akka-actor-2.5/javaagent/src/test/scala/io/opentelemetry/instrumentation/akkaactor/AkkaActors.scala +++ b/instrumentation/akka/akka-actor-2.5/javaagent/src/test/scala/io/opentelemetry/instrumentation/akkaactor/AkkaActors.scala @@ -113,7 +113,7 @@ class Greeter(message: String, receiverActor: ActorRef) extends Actor { } object Receiver { - def props: Props = Props[Receiver] + def props: Props = Props[Receiver]() final case class Greeting(greeting: String)