From 5ef462d13879f3f8a819ed50f9dd0a2ba3cb31bb Mon Sep 17 00:00:00 2001 From: Julian Ladisch Date: Tue, 3 Sep 2024 16:32:54 +0200 Subject: [PATCH] MODNCIP-71: Upgrade dependencies for Ramsons https://folio-org.atlassian.net/browse/MODNCIP-71 --- pom.xml | 51 ++++++++----------- src/test/java/org/folio/ncip/LookupUser.java | 24 +++------ .../java/org/folio/ncip/MainVerticleTest.java | 31 ++++------- src/test/java/org/folio/ncip/RequestItem.java | 10 ---- 4 files changed, 39 insertions(+), 77 deletions(-) diff --git a/pom.xml b/pom.xml index 4f67b98..33bc02d 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ - 4.4.6 + 4.5.9 UTF-8 UTF-8 17 @@ -44,18 +44,18 @@ org.apache.httpcomponents httpclient - 4.5.13 + 4.5.14 commons-codec commons-codec - 1.16.0 + 1.17.1 - net.sf.dozer - dozer - 5.3.2 + com.github.dozermapper + dozer-core + 7.0.0 commons-beanutils @@ -66,7 +66,7 @@ com.sun.xml.bind jaxb-impl - 2.3.1 + 2.3.9 org.extensiblecatalog.ncip.v2 @@ -133,49 +133,44 @@ org.slf4j slf4j-api - 1.7.36 org.apache.logging.log4j log4j-slf4j-impl - 2.20.0 org.apache.logging.log4j log4j-api - 2.20.0 org.apache.logging.log4j log4j-core - 2.20.0 org.slf4j jcl-over-slf4j - 1.7.36 org.folio util - 35.0.6 + 35.2.2 org.folio.okapi okapi-common - 5.1.1 + 6.0.2 org.hamcrest - hamcrest-core - 1.3 + hamcrest + 3.0 test org.mockito mockito-core - 3.1.0 + 5.13.0 test @@ -192,13 +187,7 @@ io.rest-assured rest-assured - 4.4.0 - test - - - com.jayway.restassured - xml-path - 2.9.0 + 5.5.0 test @@ -251,9 +240,9 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.13.0 - 11 + 17 UTF-8 @@ -261,7 +250,7 @@ org.apache.maven.plugins maven-resources-plugin - 3.0.1 + 3.3.1 filter-descriptor-inputs @@ -286,7 +275,7 @@ com.coderplus.maven.plugins copy-rename-maven-plugin - 1.0 + 1.0.1 rename-descriptor-outputs @@ -313,7 +302,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M5 + 3.5.0 **/*Test.java @@ -325,7 +314,7 @@ org.apache.maven.plugins maven-shade-plugin - 2.4 + 3.6.0 package @@ -352,7 +341,7 @@ org.apache.maven.plugins maven-release-plugin - 2.5.3 + 3.1.1 clean verify v@{project.version} diff --git a/src/test/java/org/folio/ncip/LookupUser.java b/src/test/java/org/folio/ncip/LookupUser.java index a33829c..5acd4d7 100644 --- a/src/test/java/org/folio/ncip/LookupUser.java +++ b/src/test/java/org/folio/ncip/LookupUser.java @@ -1,10 +1,8 @@ /** - * + * */ package org.folio.ncip; -import static org.junit.Assert.*; - import java.net.MalformedURLException; import org.hamcrest.Matchers; @@ -16,23 +14,17 @@ import org.junit.Before; import org.junit.Test; -import io.restassured.matcher.ResponseAwareMatcher; import io.restassured.response.Response; -import static org.junit.Assert.assertEquals; -import org.junit.Test; -import com.jayway.restassured.path.xml.XmlPath; -import com.jayway.restassured.path.xml.XmlPath.CompatibilityMode; - /** - * @author + * @author * */ public class LookupUser extends TestBase { - + /** @@ -50,7 +42,7 @@ public void callLookupUserSuccess() throws MalformedURLException { response.then().assertThat().body("NCIPMessage.LookupUserResponse.UserOptionalFields.UserPrivilege[0].UserPrivilegeStatus.UserPrivilegeStatusType", Matchers.equalTo("GRAD")); System.out.println(response.getBody().prettyPrint()); } - + @Test public void callLookupUserNotFound() throws MalformedURLException { Response response = postData("src/test/resources/mockdata/ncip-lookupUserNotFound.xml"); @@ -58,7 +50,7 @@ public void callLookupUserNotFound() throws MalformedURLException { response.then().assertThat().body("NCIPMessage.LookupUserResponse.Problem.ProblemValue", Matchers.containsString(TestConstants.DID_NOT_FIND)); System.out.println(response.getBody().prettyPrint()); } - + @Test public void callLookupUserBlocked() throws MalformedURLException { Response response = postData("src/test/resources/mockdata/ncip-lookupUserBlocked.xml"); @@ -66,8 +58,8 @@ public void callLookupUserBlocked() throws MalformedURLException { response.then().assertThat().body("NCIPMessage.LookupUserResponse.UserOptionalFields.UserPrivilege[2].UserPrivilegeStatus.UserPrivilegeStatusType", Matchers.equalTo(TestConstants.BLOCKED)); System.out.println(response.getBody().prettyPrint()); } - - + + @Test public void callLookupUserAutomatedBlock() throws MalformedURLException { Response response = postData("src/test/resources/mockdata/ncip-lookupUserAutomatedBlock.xml"); @@ -75,7 +67,7 @@ public void callLookupUserAutomatedBlock() throws MalformedURLException { response.then().assertThat().body("NCIPMessage.LookupUserResponse.UserOptionalFields.UserPrivilege[2].UserPrivilegeStatus.UserPrivilegeStatusType", Matchers.equalTo(TestConstants.BLOCKED)); System.out.println(response.getBody().prettyPrint()); } - + diff --git a/src/test/java/org/folio/ncip/MainVerticleTest.java b/src/test/java/org/folio/ncip/MainVerticleTest.java index e8c75f0..d32e589 100644 --- a/src/test/java/org/folio/ncip/MainVerticleTest.java +++ b/src/test/java/org/folio/ncip/MainVerticleTest.java @@ -50,7 +50,8 @@ public void before(TestContext ctx) { @Test public void health(TestContext ctx) { - vertx.deployVerticle(new MainVerticle(), success(ctx, x -> { + vertx.deployVerticle(new MainVerticle()) + .onComplete(ctx.asyncAssertSuccess(x -> { get("/admin/health"). then(). statusCode(200). @@ -75,34 +76,24 @@ public void ncipConfigCheck(TestContext ctx) { default: req.response().setStatusCode(500).end("Bad path " + req.path()); break; } }) - .listen(8082, ctx.asyncAssertSuccess(x -> { - vertx.deployVerticle(new MainVerticle(), success(ctx, y -> { - get("/ncipconfigcheck"). - then(). - statusCode(200). - body(is("OK")); - })); + .listen(8082) + .compose(x -> vertx.deployVerticle(new MainVerticle())) + .onComplete(ctx.asyncAssertSuccess(x -> { + get("/ncipconfigcheck"). + then(). + statusCode(200). + body(is("OK")); })); } @Test public void ncipConfigCheckFailure(TestContext ctx) { - vertx.deployVerticle(new MainVerticle(), success(ctx, y -> { + vertx.deployVerticle(new MainVerticle()) + .onComplete(ctx.asyncAssertSuccess(y -> { get("/ncipconfigcheck"). then(). statusCode(500). body(containsString("localhost:8082")); })); } - - /** - * Like TestContext.asyncAssertSuccess, but use executeBlocking to run nextHandler - * so that the mock http server can respond. - */ - private Handler> success(TestContext ctx, Handler nextHandler) { - return ctx.asyncAssertSuccess(value -> vertx.executeBlocking(promise -> { - nextHandler.handle(value); - promise.complete(); - }, ctx.asyncAssertSuccess())); - } } diff --git a/src/test/java/org/folio/ncip/RequestItem.java b/src/test/java/org/folio/ncip/RequestItem.java index 3620784..5b632dd 100644 --- a/src/test/java/org/folio/ncip/RequestItem.java +++ b/src/test/java/org/folio/ncip/RequestItem.java @@ -3,24 +3,14 @@ */ package org.folio.ncip; -import static org.junit.Assert.*; - import java.net.MalformedURLException; -import org.hamcrest.Matchers; - import org.junit.Before; import org.junit.Test; -import io.restassured.matcher.ResponseAwareMatcher; import io.restassured.response.Response; -import static org.junit.Assert.assertEquals; -import org.junit.Test; -import com.jayway.restassured.path.xml.XmlPath; -import com.jayway.restassured.path.xml.XmlPath.CompatibilityMode; -