Enable kotlin route DSL (#2825)
* Add kotlin-maven-plugin to server module * Add reactor-kotlin-extensions dependency * Enable RouteDslTests.kt * Enable kotlin compile and test case of kotlin route
This commit is contained in:
@@ -88,6 +88,11 @@
|
||||
<groupId>io.projectreactor.addons</groupId>
|
||||
<artifactId>reactor-extra</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.projectreactor.kotlin</groupId>
|
||||
<artifactId>reactor-kotlin-extensions</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||
<artifactId>jackson-dataformat-protobuf</artifactId>
|
||||
@@ -221,6 +226,40 @@
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<!-- Based on instructions here - https://kotlinlang.org/docs/reference/using-maven.html -->
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<configuration>
|
||||
<jvmTarget>17</jvmTarget>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirs>
|
||||
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
|
||||
<sourceDir>${project.basedir}/src/main/java</sourceDir>
|
||||
</sourceDirs>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-compile</id>
|
||||
<goals>
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirs>
|
||||
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
|
||||
<sourceDir>${project.basedir}/src/test/java</sourceDir>
|
||||
</sourceDirs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
@@ -271,50 +310,6 @@
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>javaLowerThan16</id>
|
||||
<activation>
|
||||
<jdk>(,16)</jdk>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<!-- Based on instructions here - https://kotlinlang.org/docs/reference/using-maven.html -->
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<configuration>
|
||||
<jvmTarget>1.8</jvmTarget>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirs>
|
||||
<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
|
||||
<sourceDir>${project.basedir}/src/main/java</sourceDir>
|
||||
</sourceDirs>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>test-compile</id>
|
||||
<goals>
|
||||
<goal>test-compile</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<sourceDirs>
|
||||
<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
|
||||
<sourceDir>${project.basedir}/src/test/java</sourceDir>
|
||||
</sourceDirs>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>java13plus</id>
|
||||
<activation>
|
||||
|
||||
@@ -101,7 +101,7 @@ import static org.junit.Assume.assumeThat;
|
||||
org.springframework.cloud.gateway.route.RouteTests.class,
|
||||
org.springframework.cloud.gateway.route.CachingRouteLocatorTests.class,
|
||||
org.springframework.cloud.gateway.route.RouteRefreshListenerTests.class,
|
||||
// org.springframework.cloud.gateway.route.builder.RouteDslTests.class,
|
||||
org.springframework.cloud.gateway.route.builder.RouteDslTests.class,
|
||||
org.springframework.cloud.gateway.route.builder.RouteBuilderTests.class,
|
||||
org.springframework.cloud.gateway.route.builder.GatewayFilterSpecTests.class,
|
||||
org.springframework.cloud.gateway.route.CachingRouteDefinitionLocatorTests.class,
|
||||
|
||||
@@ -24,13 +24,12 @@ import org.springframework.cloud.gateway.support.ServerWebExchangeUtils
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.mock.http.server.reactive.MockServerHttpRequest
|
||||
import org.springframework.mock.web.server.MockServerWebExchange
|
||||
import org.springframework.test.context.junit4.SpringRunner
|
||||
import org.springframework.web.server.ServerWebExchange
|
||||
import reactor.core.publisher.toMono
|
||||
import reactor.kotlin.core.publisher.toMono
|
||||
import reactor.test.StepVerifier
|
||||
import java.net.URI
|
||||
|
||||
@SpringBootTest(classes = arrayOf(Config::class))
|
||||
@SpringBootTest(classes = [Config::class])
|
||||
class RouteDslTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
Reference in New Issue
Block a user