Skip to content
This repository was archived by the owner on Mar 2, 2022. It is now read-only.

Commit e6fbc6d

Browse files
committed
Added symmetrical test for both SMono and SFlux .asJava and .asScala as a change on #69
(cherry picked from commit 5247c42)
1 parent 180b9d3 commit e6fbc6d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/test/scala/reactor/core/scala/publisher/SFluxTest.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,5 +2232,16 @@ class SFluxTest extends AnyFreeSpec with Matchers with TableDrivenPropertyChecks
22322232
".asJava should convert to java" in {
22332233
SFlux.just(1, 2, 3).asJava() shouldBe a[reactor.core.publisher.Flux[_]]
22342234
}
2235+
2236+
".asScala and .asJava should be" - {
2237+
val jFlux: JFlux[Int] = JFlux.just(1, 2, 3)
2238+
"compile" in {
2239+
//noinspection ScalaUnusedSymbol
2240+
"val x: JFlux[Int] = jFlux.asScala.asJava()" should compile
2241+
}
2242+
"symmetrical" in {
2243+
jFlux.asScala.asJava() should be theSameInstanceAs jFlux
2244+
}
2245+
}
22352246
}
22362247
}

src/test/scala/reactor/core/scala/publisher/SMonoTest.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,17 @@ class SMonoTest extends AnyFreeSpec with Matchers with TestSupport with Idiomati
366366
JMono.just(randomValue).asScala shouldBe an[SMono[_]]
367367
}
368368

369+
".asScala and .asJava should be" - {
370+
val jMono: JMono[Long] = JMono.just(randomValue)
371+
"compile" in {
372+
//noinspection ScalaUnusedSymbol
373+
"val x: JMono[Long] = jMono.asScala.asJava()" should compile
374+
}
375+
"symmetrical" in {
376+
jMono.asScala.asJava() should be theSameInstanceAs jMono
377+
}
378+
}
379+
369380
".block" - {
370381
"should block the mono to get the value" in {
371382
just(randomValue).block() shouldBe randomValue

0 commit comments

Comments
 (0)