Skip to content

Commit

Permalink
spring-petclinic#43 Upgrade to Spring Cloud 2021.0 and Spring Boot 2.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
arey committed Feb 6, 2022
1 parent b0b6c2b commit 64f079c
Show file tree
Hide file tree
Showing 19 changed files with 138 additions and 305 deletions.
33 changes: 1 addition & 32 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent***REMOVED***
<groupId***REMOVED***org.springframework.boot</groupId***REMOVED***
<artifactId***REMOVED***spring-boot-starter-parent</artifactId***REMOVED***
<version***REMOVED***2.3.1.RELEASE</version***REMOVED***
<version***REMOVED***2.6.3</version***REMOVED***
</parent***REMOVED***

<groupId***REMOVED***org.springframework.samples</groupId***REMOVED***
Expand Down Expand Up @@ -127,35 +127,4 @@
</profile***REMOVED***
</profiles***REMOVED***

<repositories***REMOVED***
<repository***REMOVED***
<id***REMOVED***spring-milestones</id***REMOVED***
<name***REMOVED***Spring Milestones</name***REMOVED***
<url***REMOVED***https://repo.spring.io/milestone</url***REMOVED***
<snapshots***REMOVED***
<enabled***REMOVED***false</enabled***REMOVED***
</snapshots***REMOVED***
</repository***REMOVED***
<repository***REMOVED***
<id***REMOVED***spring-snapshots</id***REMOVED***
<name***REMOVED***Spring Snapshots</name***REMOVED***
<url***REMOVED***https://repo.spring.io/snapshot</url***REMOVED***
<snapshots***REMOVED***
<enabled***REMOVED***true</enabled***REMOVED***
</snapshots***REMOVED***
</repository***REMOVED***

</repositories***REMOVED***

<pluginRepositories***REMOVED***
<pluginRepository***REMOVED***
<id***REMOVED***spring-milestones</id***REMOVED***
<name***REMOVED***Spring Milestones</name***REMOVED***
<url***REMOVED***https://repo.spring.io/milestone</url***REMOVED***
<snapshots***REMOVED***
<enabled***REMOVED***false</enabled***REMOVED***
</snapshots***REMOVED***
</pluginRepository***REMOVED***
</pluginRepositories***REMOVED***

</project***REMOVED***
29 changes: 6 additions & 23 deletions spring-petclinic-admin-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
<parent***REMOVED***
<groupId***REMOVED***org.springframework.boot</groupId***REMOVED***
<artifactId***REMOVED***spring-boot-starter-parent</artifactId***REMOVED***
<version***REMOVED***2.3.1.RELEASE</version***REMOVED***
<version***REMOVED***2.6.3</version***REMOVED***
<relativePath/***REMOVED***
</parent***REMOVED***
<properties***REMOVED***
<spring-boot-admin.version***REMOVED***2.2.2</spring-boot-admin.version***REMOVED***
<spring-cloud.version***REMOVED***Hoxton.SR6</spring-cloud.version***REMOVED***
<spring-boot.build-image.imageName***REMOVED***${REPOSITORY_PREFIX***REMOVED***/spring-petclinic-cloud-admin-server</spring-boot.build-image.imageName***REMOVED***
<spring-boot-admin.version***REMOVED***2.5.5</spring-boot-admin.version***REMOVED***
<spring-cloud.version***REMOVED***2021.0.0</spring-cloud.version***REMOVED***
<spring-cloud-services.version***REMOVED***3.3.0</spring-cloud-services.version***REMOVED***

<spring-boot.build-image.imageName***REMOVED***${REPOSITORY_PREFIX***REMOVED***/spring-petclinic-cloud-admin-server</spring-boot.build-image.imageName***REMOVED***
</properties***REMOVED***

<dependencies***REMOVED***
Expand Down Expand Up @@ -61,7 +62,7 @@
<dependency***REMOVED***
<groupId***REMOVED***io.pivotal.spring.cloud</groupId***REMOVED***
<artifactId***REMOVED***spring-cloud-services-dependencies</artifactId***REMOVED***
<version***REMOVED***3.1.2.RELEASE</version***REMOVED***
<version***REMOVED***${spring-cloud-services.version***REMOVED***</version***REMOVED***
<type***REMOVED***pom</type***REMOVED***
<scope***REMOVED***import</scope***REMOVED***
</dependency***REMOVED***
Expand All @@ -73,24 +74,6 @@
<type***REMOVED***pom</type***REMOVED***
<scope***REMOVED***import</scope***REMOVED***
</dependency***REMOVED***
<dependency***REMOVED***
<groupId***REMOVED***org.springframework.boot</groupId***REMOVED***
<artifactId***REMOVED***spring-boot-starter-test</artifactId***REMOVED***
<version***REMOVED***${spring-boot.version***REMOVED***</version***REMOVED***
<scope***REMOVED***test</scope***REMOVED***
<exclusions***REMOVED***
<exclusion***REMOVED***
<groupId***REMOVED***junit</groupId***REMOVED***
<artifactId***REMOVED***junit</artifactId***REMOVED***
</exclusion***REMOVED***
</exclusions***REMOVED***
</dependency***REMOVED***
<dependency***REMOVED***
<groupId***REMOVED***org.assertj</groupId***REMOVED***
<artifactId***REMOVED***assertj-core</artifactId***REMOVED***
<version***REMOVED***${assertj.version***REMOVED***</version***REMOVED***
<scope***REMOVED***test</scope***REMOVED***
</dependency***REMOVED***

</dependencies***REMOVED***
</dependencyManagement***REMOVED***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
name: admin-server
---
***REMOVED***
profiles: docker
***REMOVED***
***REMOVED***
on-profile: docker
***REMOVED***
***REMOVED***
uri: http://config-server:8888

59 changes: 11 additions & 48 deletions spring-petclinic-api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent***REMOVED***
<groupId***REMOVED***org.springframework.boot</groupId***REMOVED***
<artifactId***REMOVED***spring-boot-starter-parent</artifactId***REMOVED***
<version***REMOVED***2.3.1.RELEASE</version***REMOVED***
<version***REMOVED***2.6.3</version***REMOVED***
<relativePath/***REMOVED***
</parent***REMOVED***

Expand All @@ -20,9 +20,10 @@
<java.version***REMOVED***11</java.version***REMOVED***
<assertj.version***REMOVED***3.11.1</assertj.version***REMOVED***

<spring-boot.version***REMOVED***2.3.1.RELEASE</spring-boot.version***REMOVED***
<spring-cloud.version***REMOVED***Hoxton.SR6</spring-cloud.version***REMOVED***
<wavefront.version***REMOVED***2.0.1-SNAPSHOT</wavefront.version***REMOVED***
<spring-boot.version***REMOVED***2.6.3</spring-boot.version***REMOVED***
<spring-cloud.version***REMOVED***2021.0.0</spring-cloud.version***REMOVED***
<spring-cloud-services.version***REMOVED***3.3.0</spring-cloud-services.version***REMOVED***
<wavefront.version***REMOVED***2.2.2</wavefront.version***REMOVED***

<maven-surefire-plugin.version***REMOVED***2.22.0</maven-surefire-plugin.version***REMOVED***

Expand Down Expand Up @@ -73,6 +74,10 @@
</dependency***REMOVED***

<!-- Spring Cloud --***REMOVED***
<dependency***REMOVED***
<groupId***REMOVED***org.springframework.cloud</groupId***REMOVED***
<artifactId***REMOVED***spring-cloud-starter-bootstrap</artifactId***REMOVED***
</dependency***REMOVED***
<dependency***REMOVED***
<groupId***REMOVED***org.springframework.cloud</groupId***REMOVED***
<artifactId***REMOVED***spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId***REMOVED***
Expand Down Expand Up @@ -158,7 +163,7 @@
<dependency***REMOVED***
<groupId***REMOVED***io.pivotal.spring.cloud</groupId***REMOVED***
<artifactId***REMOVED***spring-cloud-services-dependencies</artifactId***REMOVED***
<version***REMOVED***3.1.2.RELEASE</version***REMOVED***
<version***REMOVED***${spring-cloud-services.version***REMOVED***</version***REMOVED***
<type***REMOVED***pom</type***REMOVED***
<scope***REMOVED***import</scope***REMOVED***
</dependency***REMOVED***
Expand All @@ -178,18 +183,6 @@
<type***REMOVED***pom</type***REMOVED***
<scope***REMOVED***import</scope***REMOVED***
</dependency***REMOVED***
<dependency***REMOVED***
<groupId***REMOVED***org.springframework.boot</groupId***REMOVED***
<artifactId***REMOVED***spring-boot-starter-test</artifactId***REMOVED***
<version***REMOVED***${spring-boot.version***REMOVED***</version***REMOVED***
<scope***REMOVED***test</scope***REMOVED***
<exclusions***REMOVED***
<exclusion***REMOVED***
<groupId***REMOVED***junit</groupId***REMOVED***
<artifactId***REMOVED***junit</artifactId***REMOVED***
</exclusion***REMOVED***
</exclusions***REMOVED***
</dependency***REMOVED***
<dependency***REMOVED***
<groupId***REMOVED***org.assertj</groupId***REMOVED***
<artifactId***REMOVED***assertj-core</artifactId***REMOVED***
Expand Down Expand Up @@ -342,40 +335,10 @@
<dependencies***REMOVED***
<dependency***REMOVED***
<groupId***REMOVED***org.springframework.cloud</groupId***REMOVED***
<artifactId***REMOVED***spring-cloud-starter-kubernetes-all</artifactId***REMOVED***
<artifactId***REMOVED***spring-cloud-starter-kubernetes-client-all</artifactId***REMOVED***
</dependency***REMOVED***
</dependencies***REMOVED***
</profile***REMOVED***
</profiles***REMOVED***
<repositories***REMOVED***
<repository***REMOVED***
<id***REMOVED***spring-milestones</id***REMOVED***
<name***REMOVED***Spring Milestones</name***REMOVED***
<url***REMOVED***https://repo.spring.io/milestone</url***REMOVED***
<snapshots***REMOVED***
<enabled***REMOVED***false</enabled***REMOVED***
</snapshots***REMOVED***
</repository***REMOVED***
<repository***REMOVED***
<id***REMOVED***spring-snapshots</id***REMOVED***
<name***REMOVED***Spring Snapshots</name***REMOVED***
<url***REMOVED***https://repo.spring.io/snapshot</url***REMOVED***
<snapshots***REMOVED***
<enabled***REMOVED***true</enabled***REMOVED***
</snapshots***REMOVED***
</repository***REMOVED***

</repositories***REMOVED***

<pluginRepositories***REMOVED***
<pluginRepository***REMOVED***
<id***REMOVED***spring-milestones</id***REMOVED***
<name***REMOVED***Spring Milestones</name***REMOVED***
<url***REMOVED***https://repo.spring.io/milestone</url***REMOVED***
<snapshots***REMOVED***
<enabled***REMOVED***false</enabled***REMOVED***
</snapshots***REMOVED***
</pluginRepository***REMOVED***
</pluginRepositories***REMOVED***

</project***REMOVED***
8 changes: 6 additions & 2 deletions spring-petclinic-api-gateway/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ management:
apiToken: ""
---
***REMOVED***
profiles: docker
***REMOVED***
***REMOVED***
on-profile: docker
***REMOVED***
***REMOVED***
uri: http://config-server:8888
---
***REMOVED***
profiles: kubernetes
***REMOVED***
***REMOVED***
on-profile: kubernetes
***REMOVED***
***REMOVED***
***REMOVED***
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
package org.springframework.samples.petclinic.api.boundary.web;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.reactive.WebFluxTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.cloud.circuitbreaker.resilience4j.ReactiveResilience4JAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.samples.petclinic.api.application.CustomersServiceClient;
import org.springframework.samples.petclinic.api.application.VisitsServiceClient;
import org.springframework.samples.petclinic.api.dto.OwnerDetails;
import org.springframework.samples.petclinic.api.dto.PetDetails;
import org.springframework.samples.petclinic.api.dto.VisitDetails;
import org.springframework.samples.petclinic.api.dto.Visits;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.reactive.server.WebTestClient;
import reactor.core.publisher.Mono;

import java.net.ConnectException;
import java.util.Collections;

@ExtendWith(SpringExtension.class)
@WebFluxTest(controllers = ApiGatewayController.class)
@Import({ReactiveResilience4JAutoConfiguration.class, InsecurityConfiguration.class***REMOVED***)
@Import({ReactiveResilience4JAutoConfiguration.class, CircuitBreakerConfiguration.class, InsecurityConfiguration.class***REMOVED***)
class ApiGatewayControllerTest {

@MockBean
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.springframework.samples.petclinic.api.boundary.web;

import io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry;
import io.github.resilience4j.timelimiter.TimeLimiterRegistry;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CircuitBreakerConfiguration {

@Bean
public CircuitBreakerRegistry circuitBreakerRegistry() {
return CircuitBreakerRegistry.ofDefaults();
***REMOVED***

@Bean
public TimeLimiterRegistry timeLimiterRegistry() {
return TimeLimiterRegistry.ofDefaults();
***REMOVED***
***REMOVED***
23 changes: 8 additions & 15 deletions spring-petclinic-config-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
<parent***REMOVED***
<groupId***REMOVED***org.springframework.boot</groupId***REMOVED***
<artifactId***REMOVED***spring-boot-starter-parent</artifactId***REMOVED***
<version***REMOVED***2.3.1.RELEASE</version***REMOVED***
<version***REMOVED***2.6.3</version***REMOVED***
<relativePath/***REMOVED***
</parent***REMOVED***

<properties***REMOVED***
<spring-boot.build-image.imageName***REMOVED***${REPOSITORY_PREFIX***REMOVED***/spring-petclinic-cloud-config-server</spring-boot.build-image.imageName***REMOVED***
<spring-cloud.version***REMOVED***Hoxton.SR6</spring-cloud.version***REMOVED***
<spring-cloud.version***REMOVED***2021.0.0</spring-cloud.version***REMOVED***
<spring-cloud-services.version***REMOVED***3.3.0</spring-cloud-services.version***REMOVED***
</properties***REMOVED***

<dependencies***REMOVED***
Expand All @@ -29,6 +30,10 @@
</dependency***REMOVED***

<!-- Spring Cloud --***REMOVED***
<dependency***REMOVED***
<groupId***REMOVED***org.springframework.cloud</groupId***REMOVED***
<artifactId***REMOVED***spring-cloud-starter-bootstrap</artifactId***REMOVED***
</dependency***REMOVED***
<dependency***REMOVED***
<groupId***REMOVED***org.springframework.cloud</groupId***REMOVED***
<artifactId***REMOVED***spring-cloud-config-server</artifactId***REMOVED***
Expand Down Expand Up @@ -57,7 +62,7 @@
<dependency***REMOVED***
<groupId***REMOVED***io.pivotal.spring.cloud</groupId***REMOVED***
<artifactId***REMOVED***spring-cloud-services-dependencies</artifactId***REMOVED***
<version***REMOVED***3.1.2.RELEASE</version***REMOVED***
<version***REMOVED***${spring-cloud-services.version***REMOVED***</version***REMOVED***
<type***REMOVED***pom</type***REMOVED***
<scope***REMOVED***import</scope***REMOVED***
</dependency***REMOVED***
Expand All @@ -69,18 +74,6 @@
<type***REMOVED***pom</type***REMOVED***
<scope***REMOVED***import</scope***REMOVED***
</dependency***REMOVED***
<dependency***REMOVED***
<groupId***REMOVED***org.springframework.boot</groupId***REMOVED***
<artifactId***REMOVED***spring-boot-starter-test</artifactId***REMOVED***
<version***REMOVED***${spring-boot.version***REMOVED***</version***REMOVED***
<scope***REMOVED***test</scope***REMOVED***
<exclusions***REMOVED***
<exclusion***REMOVED***
<groupId***REMOVED***junit</groupId***REMOVED***
<artifactId***REMOVED***junit</artifactId***REMOVED***
</exclusion***REMOVED***
</exclusions***REMOVED***
</dependency***REMOVED***
<dependency***REMOVED***
<groupId***REMOVED***org.assertj</groupId***REMOVED***
<artifactId***REMOVED***assertj-core</artifactId***REMOVED***
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ server.port: 8888
***REMOVED***
server:
git:
uri: https://github.com/spring-petclinic/spring-petclinic-microservices-config
uri: https://github.com/spring-petclinic/spring-petclinic-cloud-config
# Use the File System Backend to avoid git pulling. Enable "native" profile in the Config Server.
native:
searchLocations: file:///${GIT_REPO***REMOVED***
Expand Down
Loading

0 comments on commit 64f079c

Please sign in to comment.