Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MODNCIP-71: Upgrade dependencies for Ramsons #101

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 20 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</licenses>

<properties>
<vertx.version>4.4.6</vertx.version>
<vertx.version>4.5.10</vertx.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
Expand Down Expand Up @@ -45,18 +45,18 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
<version>4.5.14</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.16.0</version>
<version>1.17.1</version>
</dependency>
<!--ncip toolkit dependencies start -->
<dependency>
<groupId>net.sf.dozer</groupId>
<artifactId>dozer</artifactId>
<version>5.3.2</version>
<groupId>com.github.dozermapper</groupId>
<artifactId>dozer-core</artifactId>
<version>7.0.0</version>
<exclusions>
<exclusion>
<groupId>commons-beanutils</groupId>
Expand All @@ -67,7 +67,7 @@
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.1</version>
<version>2.3.9</version>
</dependency>
<dependency>
<groupId>org.extensiblecatalog.ncip.v2</groupId>
Expand Down Expand Up @@ -134,49 +134,44 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>org.folio</groupId>
<artifactId>util</artifactId>
<version>35.0.6</version>
<version>35.2.2</version>
</dependency>
<dependency>
<groupId>org.folio.okapi</groupId>
<artifactId>okapi-common</artifactId>
<version>5.1.1</version>
<version>6.0.2</version>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<artifactId>hamcrest</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.1.0</version>
<version>5.13.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -193,13 +188,7 @@
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>4.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>xml-path</artifactId>
<version>2.9.0</version>
<version>5.5.0</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -252,17 +241,17 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.13.0</version>
<configuration>
<release>11</release>
<release>17</release>
<encoding>UTF-8</encoding>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<version>3.3.1</version>
<executions>
<execution>
<id>filter-descriptor-inputs</id>
Expand All @@ -287,7 +276,7 @@
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0</version>
<version>1.0.1</version>
<executions>
<execution>
<id>rename-descriptor-outputs</id>
Expand All @@ -314,7 +303,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<version>3.5.0</version>
<configuration>
<includes>
<include>**/*Test.java</include>
Expand All @@ -326,7 +315,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4</version>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -353,7 +342,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<version>3.1.1</version>
<configuration>
<preparationGoals>clean verify</preparationGoals>
<tagNameFormat>v@{project.version}</tagNameFormat>
Expand Down
33 changes: 11 additions & 22 deletions src/test/java/org/folio/ncip/MainVerticleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import io.restassured.RestAssured;
import io.restassured.builder.RequestSpecBuilder;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
Expand Down Expand Up @@ -50,7 +48,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).
Expand All @@ -75,34 +74,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 <T> Handler<AsyncResult<T>> success(TestContext ctx, Handler<T> nextHandler) {
return ctx.asyncAssertSuccess(value -> vertx.executeBlocking(promise -> {
nextHandler.handle(value);
promise.complete();
}, ctx.asyncAssertSuccess()));
}
}