Browse Source

Polish "Add WebFlux Coroutines smoke test"

See gh-17701
pull/17742/head
Stephane Nicoll 6 years ago
parent
commit
78d2578c78
  1. 17
      spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/pom.xml
  2. 1
      spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/src/main/kotlin/smoketest/coroutines/CoroutinesController.kt
  3. 5
      spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/src/main/kotlin/smoketest/coroutines/SampleCoroutinesApplication.kt
  4. 3
      spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/src/test/kotlin/smoketest/coroutines/CoroutinesControllerTests.kt

17
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/pom.xml

@ -21,10 +21,7 @@ @@ -21,10 +21,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
@ -37,6 +34,11 @@ @@ -37,6 +34,11 @@
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-coroutines-reactor</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-kotlin</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
@ -71,13 +73,6 @@ @@ -71,13 +73,6 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>
</project>

1
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/src/main/kotlin/smoketest/coroutines/CoroutinesController.kt

@ -21,4 +21,5 @@ class CoroutinesController { @@ -21,4 +21,5 @@ class CoroutinesController {
delay(10)
emit("World")
}
}

5
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/src/main/kotlin/smoketest/coroutines/CoroutinesApplication.kt → spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/src/main/kotlin/smoketest/coroutines/SampleCoroutinesApplication.kt

@ -4,7 +4,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication @@ -4,7 +4,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
@SpringBootApplication
class CoroutinesApplication
class SampleCoroutinesApplication
fun main(args: Array<String>) {
runApplication<CoroutinesApplication>(*args)
runApplication<SampleCoroutinesApplication>(*args)
}

3
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/src/test/kotlin/smoketest/coroutines/CoroutinesApplicationTests.kt → spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/src/test/kotlin/smoketest/coroutines/CoroutinesControllerTests.kt

@ -9,7 +9,7 @@ import org.springframework.test.web.reactive.server.WebTestClient @@ -9,7 +9,7 @@ import org.springframework.test.web.reactive.server.WebTestClient
import org.springframework.test.web.reactive.server.expectBody
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
class CoroutinesApplicationTests(@Autowired private val webClient: WebTestClient) {
class CoroutinesControllerTests(@Autowired private val webClient: WebTestClient) {
@Test
fun testSuspendingFunction() {
@ -22,4 +22,5 @@ class CoroutinesApplicationTests(@Autowired private val webClient: WebTestClient @@ -22,4 +22,5 @@ class CoroutinesApplicationTests(@Autowired private val webClient: WebTestClient
webClient.get().uri("/flow").accept(MediaType.TEXT_PLAIN).exchange()
.expectBody<String>().isEqualTo("Hello World")
}
}
Loading…
Cancel
Save