Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
3dfb6984
Commit
3dfb6984
authored
Jul 30, 2019
by
Sebastien Deleuze
Committed by
Stephane Nicoll
Jul 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add WebFlux Coroutines smoke test
See gh-17701
parent
1acf78fb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
143 additions
and
0 deletions
+143
-0
pom.xml
spring-boot-tests/spring-boot-smoke-tests/pom.xml
+1
-0
pom.xml
...e-tests/spring-boot-smoke-test-webflux-coroutines/pom.xml
+83
-0
CoroutinesApplication.kt
...main/kotlin/smoketest/coroutines/CoroutinesApplication.kt
+10
-0
CoroutinesController.kt
.../main/kotlin/smoketest/coroutines/CoroutinesController.kt
+24
-0
CoroutinesApplicationTests.kt
...kotlin/smoketest/coroutines/CoroutinesApplicationTests.kt
+25
-0
No files found.
spring-boot-tests/spring-boot-smoke-tests/pom.xml
View file @
3dfb6984
...
@@ -98,6 +98,7 @@
...
@@ -98,6 +98,7 @@
<module>
spring-boot-smoke-test-web-static
</module>
<module>
spring-boot-smoke-test-web-static
</module>
<module>
spring-boot-smoke-test-web-ui
</module>
<module>
spring-boot-smoke-test-web-ui
</module>
<module>
spring-boot-smoke-test-webflux
</module>
<module>
spring-boot-smoke-test-webflux
</module>
<module>
spring-boot-smoke-test-webflux-coroutines
</module>
<module>
spring-boot-smoke-test-websocket-jetty
</module>
<module>
spring-boot-smoke-test-websocket-jetty
</module>
<module>
spring-boot-smoke-test-websocket-tomcat
</module>
<module>
spring-boot-smoke-test-websocket-tomcat
</module>
<module>
spring-boot-smoke-test-websocket-undertow
</module>
<module>
spring-boot-smoke-test-websocket-undertow
</module>
...
...
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/pom.xml
0 → 100644
View file @
3dfb6984
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<!-- Your own application should inherit from spring-boot-starter-parent -->
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-smoke-tests
</artifactId>
<version>
${revision}
</version>
</parent>
<artifactId>
spring-boot-smoke-test-webflux-coroutines
</artifactId>
<name>
Spring Boot WebFlux Coroutines Smoke Test
</name>
<description>
Spring Boot WebFlux Coroutines Smoke Test
</description>
<properties>
<main.basedir>
${basedir}/../../..
</main.basedir>
<m2eclipse.wtp.contextRoot>
/
</m2eclipse.wtp.contextRoot>
</properties>
<dependencies>
<!-- Compile -->
<dependency>
<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>
</dependency>
<dependency>
<groupId>
org.jetbrains.kotlin
</groupId>
<artifactId>
kotlin-stdlib-jdk8
</artifactId>
</dependency>
<dependency>
<groupId>
org.jetbrains.kotlinx
</groupId>
<artifactId>
kotlinx-coroutines-reactor
</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>
${project.basedir}/src/main/kotlin
</sourceDirectory>
<testSourceDirectory>
${project.basedir}/src/test/kotlin
</testSourceDirectory>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
<plugin>
<groupId>
org.jetbrains.kotlin
</groupId>
<artifactId>
kotlin-maven-plugin
</artifactId>
<configuration>
<args>
<arg>
-Xjsr305=strict
</arg>
</args>
<compilerPlugins>
<plugin>
spring
</plugin>
</compilerPlugins>
</configuration>
<dependencies>
<dependency>
<groupId>
org.jetbrains.kotlin
</groupId>
<artifactId>
kotlin-maven-allopen
</artifactId>
<version>
${kotlin.version}
</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
<configuration>
<useSystemClassLoader>
false
</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>
</project>
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/src/main/kotlin/smoketest/coroutines/CoroutinesApplication.kt
0 → 100644
View file @
3dfb6984
package
smoketest.coroutines
import
org.springframework.boot.autoconfigure.SpringBootApplication
import
org.springframework.boot.runApplication
@SpringBootApplication
class
CoroutinesApplication
fun
main
(
args
:
Array
<
String
>)
{
runApplication
<
CoroutinesApplication
>(*
args
)
}
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/src/main/kotlin/smoketest/coroutines/CoroutinesController.kt
0 → 100644
View file @
3dfb6984
package
smoketest.coroutines
import
kotlinx.coroutines.delay
import
kotlinx.coroutines.flow.flow
import
org.springframework.web.bind.annotation.GetMapping
import
org.springframework.web.bind.annotation.RestController
@RestController
class
CoroutinesController
{
@GetMapping
(
"/suspending"
)
suspend
fun
suspendingFunction
():
String
{
delay
(
10
)
return
"Hello World"
}
@GetMapping
(
"/flow"
)
fun
flow
()
=
flow
{
delay
(
10
)
emit
(
"Hello "
)
delay
(
10
)
emit
(
"World"
)
}
}
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-webflux-coroutines/src/test/kotlin/smoketest/coroutines/CoroutinesApplicationTests.kt
0 → 100644
View file @
3dfb6984
package
smoketest.coroutines
import
org.junit.jupiter.api.Test
import
org.springframework.beans.factory.annotation.Autowired
import
org.springframework.boot.test.context.SpringBootTest
import
org.springframework.boot.test.context.SpringBootTest.*
import
org.springframework.http.MediaType
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
)
{
@Test
fun
testSuspendingFunction
()
{
webClient
.
get
().
uri
(
"/suspending"
).
accept
(
MediaType
.
TEXT_PLAIN
).
exchange
()
.
expectBody
<
String
>().
isEqualTo
(
"Hello World"
)
}
@Test
fun
testFlow
()
{
webClient
.
get
().
uri
(
"/flow"
).
accept
(
MediaType
.
TEXT_PLAIN
).
exchange
()
.
expectBody
<
String
>().
isEqualTo
(
"Hello World"
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment