Skip to content

Commit

Permalink
upgrade health-service to Spring Boot 2.2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Artemas-Muzanenhamo committed Mar 24, 2024
1 parent 30531c2 commit 7dd89e2
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 57 deletions.
56 changes: 30 additions & 26 deletions health-service/build.gradle
Original file line number Diff line number Diff line change
@@ -1,48 +1,52 @@
plugins {
id 'java'
id 'maven'
id 'jacoco'
id 'org.springframework.boot' version '2.0.4.RELEASE'
id 'org.springframework.boot' version '2.2.9.RELEASE'
id 'io.spring.dependency-management' version '1.1.4'
}

group = 'com.gov.zw'
version = "${releaseVersion}"
description = 'health-service'
sourceCompatibility = 11
targetCompatibility = 11

apply plugin: 'io.spring.dependency-management'

repositories {
mavenCentral()
}

dependencies {
compile "org.springframework.boot:spring-boot-starter-webflux:${springVersion}"
compile "org.springframework.boot:spring-boot-starter-data-mongodb-reactive:${springVersion}"
implementation "org.springframework.boot:spring-boot-starter-webflux"
implementation "org.springframework.boot:spring-boot-starter-data-mongodb-reactive"
compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
compile "org.springframework.boot:spring-boot-autoconfigure-processor:${springVersion}"
compile "javax.xml.bind:jaxb-api:${javaXmlVersion}"
compile "org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:${springVersion}"
compile "org.springframework.cloud:spring-cloud-starter-netflix-ribbon:${springVersion}"
compile "org.springframework.cloud:spring-cloud-starter-openfeign:${springVersion}"
compile "org.springframework.boot:spring-boot-autoconfigure-processor:${springVersion}"
compile "org.springframework.cloud:spring-cloud-netflix-eureka-client:${springVersion}"
compile "org.mockito:mockito-junit-jupiter:${mockitoJunit5Version}"
compile "com.google.code.gson:gson:2.8.6"
runtime "org.springframework.boot:spring-boot-properties-migrator:${springVersion}"
testCompile "org.springframework.boot:spring-boot-starter-test:${springVersion}"
testCompile "io.projectreactor:reactor-test:${reactorTestVersion}"
testCompile "de.flapdoodle.embed:de.flapdoodle.embed.mongo:${mongoVersion}"
testCompile "au.com.dius:pact-jvm-consumer-junit5_2.12:${pactJunit5Version}"
testCompile "io.rest-assured:rest-assured:${restAssuredVersion}"
testCompile "org.junit.jupiter:junit-jupiter-engine:${junit5Version}"
implementation "org.springframework.boot:spring-boot-autoconfigure-processor"
implementation "org.springframework.cloud:spring-cloud-starter-netflix-eureka-client"
implementation "org.springframework.cloud:spring-cloud-starter-netflix-ribbon"
implementation "org.springframework.cloud:spring-cloud-starter-openfeign"
implementation "org.springframework.boot:spring-boot-autoconfigure-processor"
implementation "org.springframework.cloud:spring-cloud-netflix-eureka-client"
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "io.projectreactor:reactor-test:${reactorTestVersion}"
testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo:${mongoVersion}"
testImplementation "au.com.dius:pact-jvm-consumer-junit5_2.12:${pactJunit5Version}"
testImplementation 'com.jayway.restassured:rest-assured:2.9.0'
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}

test {
systemProperty 'pact.rootDir', "../pacts"
}

group = 'com.gov.zw'
version = "${releaseVersion}"
description = 'health-service'
sourceCompatibility = "${javaVersion}"

tasks.withType(JavaCompile) {
options.encoding = "${charset}"
options.encoding = 'UTF8'
}

bootRun {
Expand Down
28 changes: 4 additions & 24 deletions health-service/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
#Spring
springVersion=2.0.4.RELEASE
springTestVersion=5.1.8.RELEASE
springCloudVersion=Finchley.RELEASE
springCloudServicesVersion=2.0.3.RELEASE
springJdbcVersion=4.3.9.RELEASE
reactorTestVersion=3.1.7.RELEASE
springCloudVersion=Hoxton.RELEASE
reactorTestVersion=3.6.4
#Lombok
lombokVersion=1.18.8
#Junit5
junit5Version=5.4.2
lombokVersion=1.18.32
#Pact
pactJunit5Version=3.6.11
#RestAssured
restAssuredVersion=4.0.0
restAssuredVersion=2.9.0
#Embedded Mongo
mongoVersion=2.0.3
#HttpClient
httpClientVersion=4.5.9
#Gson
gsonVersion=2.8.5
#Java
javaVersion=1.8
javaXmlVersion=2.3.0
#Application
releaseVersion=1.0.1
#Encoding
charset=UTF-8
#Mockito
mockitoJunit5Version=3.0.0
#Json
jsonSmartVersion=2.3
#Rest Client Drive
restClientDriverVersion=2.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerResponse;

import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8;
import static org.springframework.http.MediaType.APPLICATION_JSON;
import static org.springframework.web.reactive.function.server.RequestPredicates.*;
import static org.springframework.web.reactive.function.server.RouterFunctions.route;

Expand All @@ -24,10 +24,10 @@ RouterFunction<ServerResponse> patientRoutes(PatientHandler patientHandler) {
GET(PATIENT_BY_ID_PATH),
patientHandler::getPatient
).andRoute(
PUT(PATIENTS_PATH).and(contentType(APPLICATION_JSON_UTF8).and(accept(APPLICATION_JSON_UTF8))),
PUT(PATIENTS_PATH).and(contentType(APPLICATION_JSON).and(accept(APPLICATION_JSON))),
patientHandler::addPatient
).andRoute(
POST(PATIENTS_PATH).and(contentType(APPLICATION_JSON_UTF8).and(accept(APPLICATION_JSON_UTF8))),
POST(PATIENTS_PATH).and(contentType(APPLICATION_JSON).and(accept(APPLICATION_JSON))),
patientHandler::updatePatient
).andRoute(
DELETE(PATIENT_BY_ID_PATH),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;

import java.util.HashMap;
import java.util.Map;

import static io.restassured.RestAssured.given;
import static com.jayway.restassured.RestAssured.given;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import static java.lang.String.format;
import static org.mockito.BDDMockito.given;
import static org.springframework.http.MediaType.APPLICATION_JSON_UTF8;
import static org.springframework.http.MediaType.APPLICATION_JSON;
import static reactor.core.publisher.Mono.just;

@ExtendWith(SpringExtension.class)
Expand Down Expand Up @@ -47,7 +47,7 @@ void getAllPatients() {
.uri(ALL_PATIENTS_URL)
.exchange()
.expectStatus().isOk()
.expectHeader().contentType(APPLICATION_JSON_UTF8)
.expectHeader().contentType(APPLICATION_JSON)
.expectBody()
.jsonPath("@.[0].name").isEqualTo(NAME)
.jsonPath("@.[0].surname").isEqualTo(SURNAME)
Expand Down

0 comments on commit 7dd89e2

Please sign in to comment.