File tree Expand file tree Collapse file tree 4 files changed +16
-4
lines changed
test/java/io/vertx/starter/service Expand file tree Collapse file tree 4 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ plugins {
1717<#else >
1818 kotlin ("jvm") version "1.7.21"
1919</#if >
20+ <#elseif language == "scala" >
21+ scala
2022<#else >
2123 java
2224</#if >
@@ -71,11 +73,18 @@ dependencies {
7173</#list >
7274<#if language == "kotlin" && vertxVersion?starts_with("4.") >
7375 implementation(kotlin("stdlib-jdk8"))
76+ <#elseif language == "scala" >
77+ implementation("org.scala-lang:scala3-library_3:3.5.2")
78+ implementation("io.vertx:vertx-lang-scala_3:${vertxVersion} ")
7479</#if >
7580<#if hasPgClient >
7681 implementation("com.ongres.scram:client:2.1")
7782</#if >
78- <#if hasVertxJUnit5 >
83+ <#if language == "scala" >
84+ testImplementation("io.vertx:vertx-lang-scala-test_3:${vertxVersion} ")
85+ testImplementation("org.scalatest:scalatest_3:3.2.19")
86+ testRuntimeOnly("org.scalatestplus:junit-5-11_3:3.2.19.0")
87+ <#elseif hasVertxJUnit5 >
7988 testImplementation("io.vertx:vertx-junit5")
8089 testImplementation("org.junit.jupiter:junit-jupiter:$junitJupiterVersion")
8190<#elseif hasVertxUnit >
@@ -111,7 +120,9 @@ tasks.withType<ShadowJar> {
111120}
112121
113122tasks.withType<Test > {
114- <#if hasVertxJUnit5 >
123+ <#if language == "scala" >
124+ useJUnitPlatform()
125+ <#elseif hasVertxJUnit5 >
115126 useJUnitPlatform()
116127<#elseif hasVertxUnit >
117128 useJUnit()
Original file line number Diff line number Diff line change @@ -25,4 +25,5 @@ class HttpVerticle extends ScalaVerticle:
2525 .putHeader("content-type", "text/plain")
2626 .end("Hello from Vert.x!"))
2727 .listen(8888)
28+ .onSuccess(_ => println("HTTP server started on port 8888"))
2829 .mapEmpty[Unit]()
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import org.scalatest.matchers.should.Matchers
1010import scala.language.implicitConversions
1111
1212
13- class MainVerticleSpec extends VerticleTesting[HttpVerticle], Matchers:
13+ class TestMainVerticle extends VerticleTesting[HttpVerticle], Matchers:
1414
1515 "HttpVerticle" should "bind to 8888 and answer with 'Hello from Vert.x!'" in {
1616 val httpClient = vertx.createHttpClient()
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ private void verifyMavenFiles() {
292292
293293 private void verifyMavenOutputFiles () throws IOException {
294294 try (Stream <Path > pathStream = Files .walk (workdir )) {
295- Optional <Path > testResult = pathStream .filter (p -> p .toString ().endsWith ("TestMainVerticle.txt " )).findFirst ();
295+ Optional <Path > testResult = pathStream .filter (p -> p .toString ().endsWith ("TestMainVerticle.xml " )).findFirst ();
296296 assertThat (testResult ).isPresent ().hasValueSatisfying (p -> assertThat (p ).isRegularFile ());
297297 assertThat (workdir .resolve ("target/demo-1.0.0-SNAPSHOT-fat.jar" )).isRegularFile ();
298298 }
You can’t perform that action at this time.
0 commit comments