Skip to content

Commit

Permalink
Merge pull request spring-petclinic#119 from arey/feature/Greenwich
Browse files Browse the repository at this point in the history
Upgrade to Spring Cloud Greenwhich and Spring Boot 2.1 spring-petclinic#118
  • Loading branch information
arey authored Mar 22, 2019
2 parents 65f2c97 + 40bea02 commit 3682d1b
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 61 deletions.
12 changes: 6 additions & 6 deletions docker/grafana/dashboards/grafana-petclinic-dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
"tableColumn": "",
"targets": [
{
"expr": "sum(petclinic_owner_seconds_count{method=\"PUT\", status=\"200\"})",
"expr": "sum(petclinic_owner_seconds_count{method=\"PUT\", status=\"204\"})",
"format": "time_series",
"instant": true,
"intervalFactor": 1,
Expand Down Expand Up @@ -446,7 +446,7 @@
"tableColumn": "",
"targets": [
{
"expr": "sum(petclinic_pet_seconds_count{method=\"POST\", status=\"204\"})",
"expr": "sum(petclinic_pet_seconds_count{method=\"POST\", status=\"201\"})",
"format": "time_series",
"instant": true,
"intervalFactor": 1,
Expand Down Expand Up @@ -528,7 +528,7 @@
"tableColumn": "Value",
"targets": [
{
"expr": "sum(petclinic_visit_seconds_count{method=\"POST\", status=\"204\"})",
"expr": "sum(petclinic_visit_seconds_count{method=\"POST\", status=\"201\"})",
"format": "time_series",
"instant": true,
"intervalFactor": 1,
Expand Down Expand Up @@ -598,21 +598,21 @@
"refId": "A"
},
{
"expr": "sum(petclinic_pet_seconds_count{method=\"POST\", status=\"204\"})",
"expr": "sum(petclinic_pet_seconds_count{method=\"POST\", status=\"201\"})",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "pet create",
"refId": "B"
},
{
"expr": "sum(petclinic_visit_seconds_count{method=\"POST\", status=\"204\"})",
"expr": "sum(petclinic_visit_seconds_count{method=\"POST\", status=\"201\"})",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "visit create",
"refId": "C"
},
{
"expr": "sum(petclinic_owner_seconds_count{method=\"PUT\", status=\"200\"})",
"expr": "sum(petclinic_owner_seconds_count{method=\"PUT\", status=\"204\"})",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "owner update",
Expand Down
17 changes: 5 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.6.RELEASE</version>
<version>2.1.1.RELEASE</version>
</parent>

<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>2.0.6</version>
<version>2.1.2</version>
<name>${project.artifactId}</name>
<packaging>pom</packaging>

Expand All @@ -30,9 +30,9 @@
<java.version>1.8</java.version>
<assertj.version>3.11.1</assertj.version>

<spring-boot.version>2.0.4.RELEASE</spring-boot.version>
<spring-cloud.version>Finchley.SR2</spring-cloud.version>
<sleuth.version>2.0.0.RC2</sleuth.version>
<spring-boot.version>2.1.2.RELEASE</spring-boot.version>
<spring-cloud.version>Greenwich.RELEASE</spring-cloud.version>
<micrometer.version>1.0.5</micrometer.version>

<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>

Expand All @@ -45,13 +45,6 @@

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-dependencies</artifactId>
<type>pom</type>
<scope>import</scope>
<version>${sleuth.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions spring-petclinic-admin-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>2.0.6</version>
<version>2.1.2</version>
</parent>

<properties>
<spring-boot-admin.version>2.0.3</spring-boot-admin.version>
<spring-boot-admin.version>2.1.2</spring-boot-admin.version>
<docker.image.exposed.port>9090</docker.image.exposed.port>
<docker.image.dockerfile.dir>${basedir}/../docker</docker.image.dockerfile.dir>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion spring-petclinic-api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>2.0.6</version>
<version>2.1.2</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,21 @@
*/
package org.springframework.samples.petclinic.api.dto;

import lombok.NoArgsConstructor;
import lombok.Value;

/**
* @author Maciej Szarlinski
*/
@Value
@NoArgsConstructor
public class VisitDetails {

private int id;
private Integer id = null;

private int petId;
private Integer petId = null;

private String date;
private String date = null;

private String description;
private String description = null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,17 @@
package org.springframework.samples.petclinic.api.dto;

import java.util.List;

import lombok.NoArgsConstructor;
import lombok.Value;

/**
* @author Maciej Szarlinski
*/
@Value
@NoArgsConstructor
public class Visits {
private List<VisitDetails> items;

private List<VisitDetails> items = null;

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package org.springframework.samples.petclinic.api;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@ActiveProfiles("test")
@SpringBootTest
class ApiGatewayApplicationTests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.http.MediaType;
import org.springframework.samples.petclinic.api.dto.VisitDetails;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
import org.springframework.test.web.client.MockRestServiceServer;
import org.springframework.web.client.RestTemplate;

Expand All @@ -25,10 +21,9 @@
import static org.springframework.test.web.client.response.MockRestResponseCreators.withServerError;
import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;

@ExtendWith(SpringExtension.class)
@EnableCircuitBreaker
@EnableAspectJAutoProxy
@ContextConfiguration(classes = {VisitsServiceClient.class})
@SpringJUnitConfig(classes = {VisitsServiceClient.class, RestTemplate.class})
class VisitsServiceClientTest {

private static final Integer PET_ID = 1;
Expand All @@ -41,21 +36,11 @@ class VisitsServiceClientTest {

private MockRestServiceServer mockServer;

@Configuration
static class Config {
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
}


@BeforeEach
public void setUp() {
mockServer = MockRestServiceServer.createServer(restTemplate);
}


@Test
public void getVisitsForPets_withAvailableVisitsService() {
mockServer.expect(requestTo("http://visits-service/pets/visits?petId=1"))
Expand Down
2 changes: 1 addition & 1 deletion spring-petclinic-config-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>2.0.6</version>
<version>2.1.2</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
package org.springframework.samples.petclinic.config;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@SpringBootTest
class PetclinicConfigServerApplicationTests {

Expand Down
2 changes: 1 addition & 1 deletion spring-petclinic-customers-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>2.0.6</version>
<version>2.1.2</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion spring-petclinic-discovery-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>2.0.6</version>
<version>2.1.2</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
package org.springframework.samples.petclinic.discovery;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@SpringBootTest
class DiscoveryServerApplicationTests {

Expand Down
2 changes: 1 addition & 1 deletion spring-petclinic-hystrix-dashboard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>spring-petclinic-microservices</artifactId>
<groupId>org.springframework.samples</groupId>
<version>2.0.6</version>
<version>2.1.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package org.springframework.samples.petclinic.dashboard;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit.jupiter.SpringExtension;

@ExtendWith(SpringExtension.class)
@SpringBootTest
class HystrixDashboardApplicationTests {

Expand Down
2 changes: 1 addition & 1 deletion spring-petclinic-vets-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>2.0.6</version>
<version>2.1.2</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion spring-petclinic-visits-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.springframework.samples</groupId>
<artifactId>spring-petclinic-microservices</artifactId>
<version>2.0.6</version>
<version>2.1.2</version>
</parent>

<properties>
Expand Down

0 comments on commit 3682d1b

Please sign in to comment.