mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish "Add WebFlux Coroutines smoke test"
See gh-17701
This commit is contained in:
parent
69f3fe7a9c
commit
78d2578c78
@ -21,10 +21,7 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-webflux</artifactId>
|
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.module</groupId>
|
|
||||||
<artifactId>jackson-module-kotlin</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jetbrains.kotlin</groupId>
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
<artifactId>kotlin-reflect</artifactId>
|
<artifactId>kotlin-reflect</artifactId>
|
||||||
@ -37,6 +34,11 @@
|
|||||||
<groupId>org.jetbrains.kotlinx</groupId>
|
<groupId>org.jetbrains.kotlinx</groupId>
|
||||||
<artifactId>kotlinx-coroutines-reactor</artifactId>
|
<artifactId>kotlinx-coroutines-reactor</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.module</groupId>
|
||||||
|
<artifactId>jackson-module-kotlin</artifactId>
|
||||||
|
</dependency>
|
||||||
<!-- Test -->
|
<!-- Test -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@ -71,13 +73,6 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<useSystemClassLoader>false</useSystemClassLoader>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
@ -21,4 +21,5 @@ class CoroutinesController {
|
|||||||
delay(10)
|
delay(10)
|
||||||
emit("World")
|
emit("World")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication
|
|||||||
import org.springframework.boot.runApplication
|
import org.springframework.boot.runApplication
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
class CoroutinesApplication
|
class SampleCoroutinesApplication
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
runApplication<CoroutinesApplication>(*args)
|
runApplication<SampleCoroutinesApplication>(*args)
|
||||||
|
|
||||||
}
|
}
|
@ -9,7 +9,7 @@ import org.springframework.test.web.reactive.server.WebTestClient
|
|||||||
import org.springframework.test.web.reactive.server.expectBody
|
import org.springframework.test.web.reactive.server.expectBody
|
||||||
|
|
||||||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
|
||||||
class CoroutinesApplicationTests(@Autowired private val webClient: WebTestClient) {
|
class CoroutinesControllerTests(@Autowired private val webClient: WebTestClient) {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testSuspendingFunction() {
|
fun testSuspendingFunction() {
|
||||||
@ -22,4 +22,5 @@ class CoroutinesApplicationTests(@Autowired private val webClient: WebTestClient
|
|||||||
webClient.get().uri("/flow").accept(MediaType.TEXT_PLAIN).exchange()
|
webClient.get().uri("/flow").accept(MediaType.TEXT_PLAIN).exchange()
|
||||||
.expectBody<String>().isEqualTo("Hello World")
|
.expectBody<String>().isEqualTo("Hello World")
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user