Skip to content

Commit eaf5b3c

Browse files
committed
fixed the issue with play test after scala 3 upgrade
1 parent 6b5abfa commit eaf5b3c

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

play-scala/application-tests/test/com/baeldung/arrival/service/ArrivalDecoratorServiceUnitTest.scala

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ class ArrivalDecoratorServiceUnitTest extends MixedPlaySpec {
1717
)
1818
.build()
1919
) {
20-
private val testee = app.injector.instanceOf[ArrivalDecoratorService]
21-
private val arrival = Arrival(1L, "Athens", "Heathrow", "12345")
22-
assert(testee.decorate(arrival).short)
23-
assert(!testee.decorate(arrival).medium)
24-
assert(!testee.decorate(arrival).long)
20+
override def running() = {
21+
val testee = app.injector.instanceOf[ArrivalDecoratorService]
22+
val arrival = Arrival(1L, "Athens", "Heathrow", "12345")
23+
assert(testee.decorate(arrival).short)
24+
assert(!testee.decorate(arrival).medium)
25+
assert(!testee.decorate(arrival).long)
26+
}
2527
}
2628

2729
"mark as medium an arrival with plane name length = 5 with overridden configuration" in new App(
@@ -37,11 +39,13 @@ class ArrivalDecoratorServiceUnitTest extends MixedPlaySpec {
3739
)
3840
.build()
3941
) {
40-
private val testee = app.injector.instanceOf[ArrivalDecoratorService]
41-
private val arrival = Arrival(1L, "Athens", "Heathrow", "12345")
42-
assert(!testee.decorate(arrival).short)
43-
assert(testee.decorate(arrival).medium)
44-
assert(!testee.decorate(arrival).long)
42+
override def running() = {
43+
val testee = app.injector.instanceOf[ArrivalDecoratorService]
44+
val arrival = Arrival(1L, "Athens", "Heathrow", "12345")
45+
assert(!testee.decorate(arrival).short)
46+
assert(testee.decorate(arrival).medium)
47+
assert(!testee.decorate(arrival).long)
48+
}
4549
}
4650
}
4751

0 commit comments

Comments
 (0)