Skip to content

Commit 3d84d6c

Browse files
committed
Fix Kotlin test module
1 parent 43236ec commit 3d84d6c

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228
<module>spring-cloud-function-adapters</module>
229229
<module>spring-cloud-function-integration</module>
230230
<!-- <module>spring-cloud-function-rsocket</module> -->
231-
<!-- <module>spring-cloud-function-kotlin</module> -->
231+
<module>spring-cloud-function-kotlin</module>
232232
<module>docs</module>
233233
</modules>
234234
</profile>

spring-cloud-function-kotlin/pom.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,21 @@
8686
<artifactId>spring-boot-configuration-processor</artifactId>
8787
<optional>true</optional>
8888
</dependency>
89+
<dependency>
90+
<groupId>org.springframework.boot</groupId>
91+
<artifactId>spring-boot-resttestclient</artifactId>
92+
<scope>test</scope>
93+
</dependency>
94+
95+
<dependency>
96+
<groupId>org.springframework.boot</groupId>
97+
<artifactId>spring-boot-webmvc-test</artifactId>
98+
<scope>test</scope>
99+
</dependency>
100+
<dependency>
101+
<groupId>org.springframework.boot</groupId>
102+
<artifactId>spring-boot-webtestclient</artifactId>
103+
</dependency>
89104
</dependencies>
90105

91106
<build>

spring-cloud-function-kotlin/src/test/kotlin/org/springframework/cloud/function/kotlin/web/HeadersToMessageSuspendTests.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ import org.assertj.core.api.Assertions
2121
import org.junit.jupiter.api.Test
2222
import org.springframework.beans.factory.annotation.Autowired
2323
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
24+
import org.springframework.boot.resttestclient.TestRestTemplate
25+
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate
2426
import org.springframework.boot.test.context.SpringBootTest
2527
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
26-
import org.springframework.boot.web.server.test.client.TestRestTemplate
2728
import org.springframework.cloud.function.web.RestApplication
2829
import org.springframework.context.annotation.Bean
2930
import org.springframework.http.MediaType
@@ -42,6 +43,7 @@ import java.net.URI
4243
properties = ["spring.cloud.function.web.path=/functions", "spring.main.web-application-type=reactive"]
4344
)
4445
@ContextConfiguration(classes = [RestApplication::class, HeadersToMessageSuspendTests.TestConfiguration::class])
46+
@AutoConfigureTestRestTemplate
4547
open class HeadersToMessageSuspendTests {
4648
@Autowired
4749
private val rest: TestRestTemplate? = null

spring-cloud-function-kotlin/src/test/kotlin/org/springframework/cloud/function/kotlin/web/HeadersToMessageTests.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ import org.assertj.core.api.Assertions
1919
import org.junit.jupiter.api.Test
2020
import org.springframework.beans.factory.annotation.Autowired
2121
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
22+
import org.springframework.boot.resttestclient.TestRestTemplate
23+
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate
2224
import org.springframework.boot.test.context.SpringBootTest
2325
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment
24-
import org.springframework.boot.web.server.test.client.TestRestTemplate
2526
import org.springframework.cloud.function.web.RestApplication
2627
import org.springframework.context.annotation.Bean
2728
import org.springframework.http.MediaType
@@ -42,6 +43,7 @@ import java.net.URI
4243
properties = ["spring.cloud.function.web.path=/functions", "spring.main.web-application-type=reactive"]
4344
)
4445
@ContextConfiguration(classes = [RestApplication::class, HeadersToMessageTests.TestConfiguration::class])
46+
@AutoConfigureTestRestTemplate
4547
open class HeadersToMessageTests {
4648
@Autowired
4749
private val rest: TestRestTemplate? = null

spring-cloud-function-web/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,6 @@
9999
<artifactId>spring-boot-resttestclient</artifactId>
100100
<scope>test</scope>
101101
</dependency>
102-
<!-- <dependency>-->
103-
<!-- <groupId>org.springframework.boot</groupId>-->
104-
<!-- <artifactId>spring-boot-starter-restclient</artifactId>-->
105-
<!-- <scope>test</scope>-->
106-
<!-- </dependency>-->
107102

108103
<dependency>
109104
<groupId>org.springframework.boot</groupId>

0 commit comments

Comments
 (0)