Skip to content

Commit

Permalink
MODNCIP-71: Upgrade dependencies for Ramsons
Browse files Browse the repository at this point in the history
  • Loading branch information
julianladisch committed Sep 3, 2024
1 parent 18e2e8b commit 5ef462d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 77 deletions.
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.9</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 @@ -44,18 +44,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 @@ -66,7 +66,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 @@ -133,49 +133,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 @@ -192,13 +187,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 @@ -251,17 +240,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 @@ -286,7 +275,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 @@ -313,7 +302,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 @@ -325,7 +314,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 @@ -352,7 +341,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
24 changes: 8 additions & 16 deletions src/test/java/org/folio/ncip/LookupUser.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/**
*
*
*/
package org.folio.ncip;

import static org.junit.Assert.*;

import java.net.MalformedURLException;

import org.hamcrest.Matchers;
Expand All @@ -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 {



/**
Expand All @@ -50,32 +42,32 @@ 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");
response.then().assertThat().body("NCIPMessage.LookupUserResponse.Problem", Matchers.not(Matchers.isEmptyOrNullString()));
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");
response.then().assertThat().body("NCIPMessage.LookupUserResponse.UserId.UserIdentifierValue", Matchers.equalTo(TestConstants.BLOCKED_PATRON_BARCODE));
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");
response.then().assertThat().body("NCIPMessage.LookupUserResponse.UserId.UserIdentifierValue", Matchers.equalTo(TestConstants.BLOCKED_PATRON_BARCODE_BY_AUTOMATED));
response.then().assertThat().body("NCIPMessage.LookupUserResponse.UserOptionalFields.UserPrivilege[2].UserPrivilegeStatus.UserPrivilegeStatusType", Matchers.equalTo(TestConstants.BLOCKED));
System.out.println(response.getBody().prettyPrint());
}




Expand Down
31 changes: 11 additions & 20 deletions src/test/java/org/folio/ncip/MainVerticleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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 <T> Handler<AsyncResult<T>> success(TestContext ctx, Handler<T> nextHandler) {
return ctx.asyncAssertSuccess(value -> vertx.executeBlocking(promise -> {
nextHandler.handle(value);
promise.complete();
}, ctx.asyncAssertSuccess()));
}
}
10 changes: 0 additions & 10 deletions src/test/java/org/folio/ncip/RequestItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;




Expand Down

0 comments on commit 5ef462d

Please sign in to comment.