diff --git a/build.gradle b/build.gradle index d0d2a86..46d0346 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,5 @@ plugins { - id 'org.springframework.boot' version '3.5.14' - id 'io.spring.dependency-management' version '1.1.7' + id 'org.springframework.boot' version '4.0.6' id 'java' id "au.com.dius.pact" version "4.7.0" id "io.freefair.lombok" version "9.4.0" @@ -17,6 +16,7 @@ repositories { } dependencies { + implementation platform('org.springframework.boot:spring-boot-dependencies:4.0.6') implementation 'org.springframework.boot:spring-boot-starter-web' implementation "org.apache.httpcomponents:fluent-hc:4.5.14" implementation 'com.graphql-java:graphql-java:25.0' diff --git a/src/main/java/com/example/products/ProductClient.java b/src/main/java/com/example/products/ProductClient.java index 9ced746..269cb19 100644 --- a/src/main/java/com/example/products/ProductClient.java +++ b/src/main/java/com/example/products/ProductClient.java @@ -3,8 +3,7 @@ import org.apache.http.client.fluent.Request; import org.apache.http.entity.ContentType; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; +import tools.jackson.databind.ObjectMapper; import java.io.IOException; import java.net.URISyntaxException; @@ -34,14 +33,9 @@ public Product getProduct(String id) throws IOException, URISyntaxException { .bodyString(query, ContentType.APPLICATION_JSON) .addHeader("Accept", "application/json") .execute().handleResponse(httpResponse -> { - try { - ObjectMapper mapper = new ObjectMapper(); - Response response = mapper.readValue(httpResponse.getEntity().getContent(), Response.class); - return response.getData().getProduct(); - - } catch (JsonMappingException e) { - throw new IOException(e); - } + ObjectMapper mapper = new ObjectMapper(); + Response response = mapper.readValue(httpResponse.getEntity().getContent(), Response.class); + return response.getData().getProduct(); }); } } \ No newline at end of file