Skip to content

Commit

Permalink
Fix akka actors testLatestDeps (#5589)
Browse files Browse the repository at this point in the history
* Fix akka actors testLatestDeps

* latest dep test scala version differs by module

* Don't bother with compat library since doesn't look good anyways
  • Loading branch information
anuraaga authored Mar 16, 2022
1 parent d2401e1 commit 4750833
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ plugins {

dependencies {
testImplementation("org.scala-lang:scala-library")
testImplementation("org.scala-lang.modules:scala-java8-compat_2.11")
}

tasks {
Expand Down
1 change: 0 additions & 1 deletion dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 4750833

Please sign in to comment.