Skip to content

Commit 9b81489

Browse files
author
Matt Raible
authored
Merge pull request #19 from oktadeveloper/spring-cloud-gateway-2.3
Upgrade Spring Cloud Gateway to Spring Boot 2.3.10
2 parents 13d96dc + 4312cff commit 9b81489

File tree

8 files changed

+135
-121
lines changed

8 files changed

+135
-121
lines changed
Lines changed: 100 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,109 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4-
<modelVersion>4.0.0</modelVersion>
5-
<parent>
6-
<groupId>org.springframework.boot</groupId>
7-
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>2.1.7.RELEASE</version>
9-
<relativePath/> <!-- lookup parent from repository -->
10-
</parent>
11-
<groupId>com.example</groupId>
12-
<artifactId>api-gateway</artifactId>
13-
<version>0.0.1-SNAPSHOT</version>
14-
<name>api-gateway</name>
15-
<description>Demo project for Spring Boot</description>
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>2.3.10.RELEASE</version>
9+
<relativePath/> <!-- lookup parent from repository -->
10+
</parent>
11+
<groupId>com.example</groupId>
12+
<artifactId>api-gateway</artifactId>
13+
<version>0.0.1-SNAPSHOT</version>
14+
<name>api-gateway</name>
15+
<description>Demo project for Spring Boot</description>
1616

17-
<properties>
18-
<java.version>11</java.version>
19-
<spring-cloud.version>Greenwich.SR2</spring-cloud.version>
20-
</properties>
17+
<properties>
18+
<java.version>11</java.version>
19+
<spring-cloud.version>Hoxton.SR10</spring-cloud.version>
20+
</properties>
2121

22-
<dependencies>
23-
<dependency>
24-
<groupId>org.springframework.boot</groupId>
25-
<artifactId>spring-boot-starter-actuator</artifactId>
26-
</dependency>
27-
<dependency>
28-
<groupId>org.springframework.boot</groupId>
29-
<artifactId>spring-boot-starter-webflux</artifactId>
30-
</dependency>
31-
<dependency>
32-
<groupId>org.springframework.cloud</groupId>
33-
<artifactId>spring-cloud-starter-gateway</artifactId>
34-
</dependency>
35-
<dependency>
36-
<groupId>org.springframework.cloud</groupId>
37-
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
38-
</dependency>
39-
<dependency>
40-
<groupId>org.springframework.cloud</groupId>
41-
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
42-
</dependency>
43-
<dependency>
44-
<groupId>org.springframework.cloud</groupId>
45-
<artifactId>spring-cloud-starter-openfeign</artifactId>
46-
</dependency>
47-
<dependency>
48-
<groupId>com.okta.spring</groupId>
49-
<artifactId>okta-spring-boot-starter</artifactId>
50-
<version>1.2.1</version>
51-
</dependency>
52-
<dependency>
53-
<groupId>org.springframework.cloud</groupId>
54-
<artifactId>spring-cloud-security</artifactId>
55-
</dependency>
56-
<dependency>
57-
<groupId>org.projectlombok</groupId>
58-
<artifactId>lombok</artifactId>
59-
<optional>true</optional>
60-
</dependency>
61-
<dependency>
62-
<groupId>org.springframework.boot</groupId>
63-
<artifactId>spring-boot-starter-test</artifactId>
64-
<scope>test</scope>
65-
</dependency>
66-
<dependency>
67-
<groupId>io.projectreactor</groupId>
68-
<artifactId>reactor-test</artifactId>
69-
<scope>test</scope>
70-
</dependency>
71-
</dependencies>
22+
<dependencies>
23+
<dependency>
24+
<groupId>org.springframework.boot</groupId>
25+
<artifactId>spring-boot-starter-actuator</artifactId>
26+
</dependency>
27+
<dependency>
28+
<groupId>org.springframework.boot</groupId>
29+
<artifactId>spring-boot-starter-webflux</artifactId>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.springframework.cloud</groupId>
33+
<artifactId>spring-cloud-starter-gateway</artifactId>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.springframework.cloud</groupId>
37+
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
38+
</dependency>
39+
<dependency>
40+
<groupId>org.springframework.cloud</groupId>
41+
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
42+
</dependency>
43+
<dependency>
44+
<groupId>org.springframework.cloud</groupId>
45+
<artifactId>spring-cloud-starter-openfeign</artifactId>
46+
</dependency>
47+
<dependency>
48+
<groupId>com.okta.spring</groupId>
49+
<artifactId>okta-spring-boot-starter</artifactId>
50+
<version>2.0.1</version>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.springframework.cloud</groupId>
54+
<artifactId>spring-cloud-security</artifactId>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.projectlombok</groupId>
58+
<artifactId>lombok</artifactId>
59+
<optional>true</optional>
60+
</dependency>
61+
<dependency>
62+
<groupId>org.springframework.boot</groupId>
63+
<artifactId>spring-boot-starter-test</artifactId>
64+
<scope>test</scope>
65+
<exclusions>
66+
<exclusion>
67+
<groupId>org.junit.vintage</groupId>
68+
<artifactId>junit-vintage-engine</artifactId>
69+
</exclusion>
70+
</exclusions>
71+
</dependency>
72+
<dependency>
73+
<groupId>io.projectreactor</groupId>
74+
<artifactId>reactor-test</artifactId>
75+
<scope>test</scope>
76+
</dependency>
77+
</dependencies>
7278

73-
<dependencyManagement>
74-
<dependencies>
75-
<dependency>
76-
<groupId>org.springframework.cloud</groupId>
77-
<artifactId>spring-cloud-dependencies</artifactId>
78-
<version>${spring-cloud.version}</version>
79-
<type>pom</type>
80-
<scope>import</scope>
81-
</dependency>
82-
</dependencies>
83-
</dependencyManagement>
79+
<dependencyManagement>
80+
<dependencies>
81+
<dependency>
82+
<groupId>org.springframework.cloud</groupId>
83+
<artifactId>spring-cloud-dependencies</artifactId>
84+
<version>${spring-cloud.version}</version>
85+
<type>pom</type>
86+
<scope>import</scope>
87+
</dependency>
88+
</dependencies>
89+
</dependencyManagement>
8490

85-
<build>
91+
<build>
8692
<defaultGoal>spring-boot:run</defaultGoal>
87-
<plugins>
88-
<plugin>
89-
<groupId>org.springframework.boot</groupId>
90-
<artifactId>spring-boot-maven-plugin</artifactId>
91-
</plugin>
92-
</plugins>
93-
</build>
93+
<plugins>
94+
<plugin>
95+
<groupId>org.springframework.boot</groupId>
96+
<artifactId>spring-boot-maven-plugin</artifactId>
97+
<configuration>
98+
<excludes>
99+
<exclude>
100+
<groupId>org.projectlombok</groupId>
101+
<artifactId>lombok</artifactId>
102+
</exclude>
103+
</excludes>
104+
</configuration>
105+
</plugin>
106+
</plugins>
107+
</build>
94108

95-
<pluginRepositories>
96-
<pluginRepository>
97-
<id>ossrh</id>
98-
<releases><enabled>false</enabled></releases>
99-
<snapshots><enabled>true</enabled></snapshots>
100-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
101-
</pluginRepository>
102-
</pluginRepositories>
103109
</project>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
spring.application.name=gateway
2-
okta.oauth2.issuer=https://dev-133320.okta.com/oauth2/default
3-
okta.oauth2.client-id=0oazig0adjD1PgAjO356
4-
okta.oauth2.client-secret=iNxF-y6iJACN2eeY8MO-bJ7IdhcSEjt1YXrrNfc0
2+
okta.oauth2.issuer=https://dev-9323263.okta.com/oauth2/default
3+
okta.oauth2.client-secret=_Wc7XBMmq4b7qKFuAf3ghDoNiCqTzFuyuCvCDYAu
4+
okta.oauth2.client-id=0oalr0fdaD2z4bCfl5d6
55

66
logging.level.root=WARN
77
logging.level.org.springframework=INFO

spring-cloud-gateway/api-gateway/src/test/java/com/example/apigateway/ApiGatewayApplicationTests.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package com.example.apigateway;
22

3-
import org.junit.Test;
4-
import org.junit.runner.RunWith;
3+
import org.junit.jupiter.api.Test;
54
import org.springframework.beans.factory.annotation.Autowired;
65
import org.springframework.boot.test.context.SpringBootTest;
76
import org.springframework.boot.test.mock.mockito.MockBean;
87
import org.springframework.http.HttpHeaders;
98
import org.springframework.security.oauth2.jwt.Jwt;
109
import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder;
11-
import org.springframework.test.context.junit4.SpringRunner;
1210
import org.springframework.test.web.reactive.server.WebTestClient;
1311
import reactor.core.publisher.Mono;
1412

@@ -19,7 +17,6 @@
1917
import static org.mockito.ArgumentMatchers.anyString;
2018
import static org.mockito.Mockito.when;
2119

22-
@RunWith(SpringRunner.class)
2320
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
2421
properties = {"spring.cloud.discovery.enabled = false"})
2522
public class ApiGatewayApplicationTests {

spring-cloud-gateway/car-service/pom.xml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>2.1.7.RELEASE</version>
8+
<version>2.3.10.RELEASE</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>com.example</groupId>
@@ -16,7 +16,7 @@
1616

1717
<properties>
1818
<java.version>11</java.version>
19-
<spring-cloud.version>Greenwich.SR2</spring-cloud.version>
19+
<spring-cloud.version>Hoxton.SR10</spring-cloud.version>
2020
</properties>
2121

2222
<dependencies>
@@ -39,7 +39,7 @@
3939
<dependency>
4040
<groupId>com.okta.spring</groupId>
4141
<artifactId>okta-spring-boot-starter</artifactId>
42-
<version>1.2.1</version>
42+
<version>2.0.1</version>
4343
</dependency>
4444
<dependency>
4545
<groupId>org.projectlombok</groupId>
@@ -50,6 +50,12 @@
5050
<groupId>org.springframework.boot</groupId>
5151
<artifactId>spring-boot-starter-test</artifactId>
5252
<scope>test</scope>
53+
<exclusions>
54+
<exclusion>
55+
<groupId>org.junit.vintage</groupId>
56+
<artifactId>junit-vintage-engine</artifactId>
57+
</exclusion>
58+
</exclusions>
5359
</dependency>
5460
<dependency>
5561
<groupId>de.flapdoodle.embed</groupId>
@@ -81,6 +87,14 @@
8187
<plugin>
8288
<groupId>org.springframework.boot</groupId>
8389
<artifactId>spring-boot-maven-plugin</artifactId>
90+
<configuration>
91+
<excludes>
92+
<exclude>
93+
<groupId>org.projectlombok</groupId>
94+
<artifactId>lombok</artifactId>
95+
</exclude>
96+
</excludes>
97+
</configuration>
8498
</plugin>
8599
</plugins>
86100
</build>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
spring.application.name=car-service
22
server.port=8081
33

4-
okta.oauth2.issuer=https://dev-133320.okta.com/oauth2/default
5-
okta.oauth2.client-id=0oazig0adjD1PgAjO356
6-
okta.oauth2.client-secret=iNxF-y6iJACN2eeY8MO-bJ7IdhcSEjt1YXrrNfc0
4+
okta.oauth2.issuer=https://dev-9323263.okta.com/oauth2/default
5+
okta.oauth2.client-secret=_Wc7XBMmq4b7qKFuAf3ghDoNiCqTzFuyuCvCDYAu
6+
okta.oauth2.client-id=0oalr0fdaD2z4bCfl5d6

spring-cloud-gateway/car-service/src/test/java/com/example/carservice/CarServiceApplicationTests.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
package com.example.carservice;
22

3-
import org.junit.Test;
4-
import org.junit.runner.RunWith;
3+
import org.junit.jupiter.api.Test;
54
import org.springframework.beans.factory.annotation.Autowired;
65
import org.springframework.boot.test.context.SpringBootTest;
76
import org.springframework.boot.test.mock.mockito.MockBean;
87
import org.springframework.http.HttpHeaders;
98
import org.springframework.http.MediaType;
109
import org.springframework.security.oauth2.jwt.Jwt;
1110
import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder;
12-
import org.springframework.test.context.junit4.SpringRunner;
1311
import org.springframework.test.web.reactive.server.WebTestClient;
1412
import reactor.core.publisher.Mono;
1513

@@ -22,7 +20,6 @@
2220
import static org.mockito.ArgumentMatchers.anyString;
2321
import static org.mockito.Mockito.when;
2422

25-
@RunWith(SpringRunner.class)
2623
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
2724
properties = {"spring.cloud.discovery.enabled = false"})
2825
public class CarServiceApplicationTests {

spring-cloud-gateway/discovery-service/pom.xml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.springframework.boot</groupId>
77
<artifactId>spring-boot-starter-parent</artifactId>
8-
<version>2.1.7.RELEASE</version>
8+
<version>2.3.10.RELEASE</version>
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>com.example</groupId>
@@ -16,22 +16,25 @@
1616

1717
<properties>
1818
<java.version>11</java.version>
19-
<spring-cloud.version>Greenwich.SR2</spring-cloud.version>
19+
<spring-cloud.version>Hoxton.SR10</spring-cloud.version>
2020
</properties>
2121

2222
<dependencies>
2323
<dependency>
2424
<groupId>org.springframework.cloud</groupId>
2525
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
2626
</dependency>
27-
<dependency>
28-
<groupId>org.glassfish.jaxb</groupId>
29-
<artifactId>jaxb-runtime</artifactId>
30-
</dependency>
27+
3128
<dependency>
3229
<groupId>org.springframework.boot</groupId>
3330
<artifactId>spring-boot-starter-test</artifactId>
3431
<scope>test</scope>
32+
<exclusions>
33+
<exclusion>
34+
<groupId>org.junit.vintage</groupId>
35+
<artifactId>junit-vintage-engine</artifactId>
36+
</exclusion>
37+
</exclusions>
3538
</dependency>
3639
</dependencies>
3740

spring-cloud-gateway/discovery-service/src/test/java/com/example/discoveryservice/EurekaServiceApplicationTests.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
package com.example.discoveryservice;
22

3-
import org.junit.Test;
4-
import org.junit.runner.RunWith;
3+
import org.junit.jupiter.api.Test;
54
import org.springframework.boot.test.context.SpringBootTest;
6-
import org.springframework.test.context.junit4.SpringRunner;
75

8-
@RunWith(SpringRunner.class)
96
@SpringBootTest
107
public class EurekaServiceApplicationTests {
118

0 commit comments

Comments
 (0)