Skip to content

Commit 2befc2e

Browse files
committed
Upgrade Jersey, clean build warnings
1 parent 6a0418d commit 2befc2e

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

NetLicensingClient-demo/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<filter>
3434
<artifact>*:*</artifact>
3535
<excludes>
36+
<exclude>module-info.class</exclude>
3637
<exclude>META-INF/*.SF</exclude>
3738
<exclude>META-INF/*.DSA</exclude>
3839
<exclude>META-INF/*.RSA</exclude>
@@ -50,6 +51,7 @@
5051
<plugin>
5152
<groupId>org.apache.maven.plugins</groupId>
5253
<artifactId>maven-surefire-plugin</artifactId>
54+
<version>3.0.0-M5</version>
5355
<configuration>
5456
<!-- Do not execute unit tests on build.
5557
Unit tests in this project are used

NetLicensingClient/src/test/java/com/labs64/netlicensing/service/SecurityTest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@
1212
*/
1313
package com.labs64.netlicensing.service;
1414

15-
import static org.junit.Assert.assertEquals;
16-
import static org.junit.Assert.assertTrue;
15+
import java.util.Base64;
1716

1817
import javax.ws.rs.GET;
1918
import javax.ws.rs.HeaderParam;
2019
import javax.ws.rs.HttpMethod;
2120
import javax.ws.rs.Path;
2221
import javax.ws.rs.core.Response;
2322

24-
import org.glassfish.jersey.internal.util.Base64;
2523
import org.junit.Test;
2624

2725
import com.labs64.netlicensing.domain.vo.Context;
@@ -30,6 +28,9 @@
3028
import com.labs64.netlicensing.schema.context.Netlicensing;
3129
import com.labs64.netlicensing.schema.context.ObjectFactory;
3230

31+
import static org.junit.Assert.assertEquals;
32+
import static org.junit.Assert.assertTrue;
33+
3334
/**
3435
* Tests for checking the ability to connect to services using different security modes
3536
*/
@@ -51,7 +52,7 @@ public void testBasicAuthentication() throws Exception {
5152

5253
assertTrue(authHeader.startsWith("Basic "));
5354

54-
final String[] userAndPassword = Base64.decodeAsString(authHeader.substring(6)).split(":");
55+
final String[] userAndPassword = new String(Base64.getDecoder().decode(authHeader.substring(6))).split(":");
5556
assertEquals("user1", userAndPassword[0]);
5657
assertEquals("pswrd", userAndPassword[1]);
5758
}
@@ -69,7 +70,7 @@ public void testApiKeyIdentification() throws Exception {
6970

7071
assertTrue(authHeader.startsWith("Basic "));
7172

72-
final String[] headerArray = Base64.decodeAsString(authHeader.substring(6)).split(":");
73+
final String[] headerArray = new String(Base64.getDecoder().decode(authHeader.substring(6))).split(":");
7374
assertEquals("apiKey", headerArray[0]);
7475
assertEquals("TEST_API_KEY", headerArray[1]);
7576

pom.xml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<log4j.version>1.2.17</log4j.version>
8383
<slf4j.version>1.7.25</slf4j.version>
8484
<junit.version>4.13.1</junit.version>
85-
<jersey.version>2.27</jersey.version>
85+
<jersey.version>2.33</jersey.version>
8686
<jaxb.api.version>2.3.1</jaxb.api.version>
8787
<jaxb-runtime.version>2.3.2</jaxb-runtime.version>
8888
<com.helger.version>3.0.2</com.helger.version>
@@ -98,6 +98,7 @@
9898
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
9999
<!-- TODO(AY): change version when the new release comes. Java 11 Warning https://github.com/highsource/maven-jaxb2-plugin/issues/148 -->
100100
<maven-jaxb2-plugin.version>0.14.0</maven-jaxb2-plugin.version>
101+
<jaxb.version>2.3.1</jaxb.version>
101102
<build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
102103
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
103104
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
@@ -106,10 +107,6 @@
106107
<javax.activation.version>1.1.1</javax.activation.version>
107108
</properties>
108109

109-
<prerequisites>
110-
<maven>${maven.version}</maven>
111-
</prerequisites>
112-
113110
<build>
114111
<pluginManagement>
115112
<plugins>
@@ -218,6 +215,28 @@
218215
</plugin>
219216
</plugins>
220217
</configuration>
218+
<dependencies>
219+
<dependency>
220+
<groupId>javax.xml.bind</groupId>
221+
<artifactId>jaxb-api</artifactId>
222+
<version>${jaxb.version}</version>
223+
</dependency>
224+
<dependency>
225+
<groupId>org.glassfish.jaxb</groupId>
226+
<artifactId>jaxb-runtime</artifactId>
227+
<version>${jaxb.version}</version>
228+
</dependency>
229+
<dependency>
230+
<groupId>org.glassfish.jaxb</groupId>
231+
<artifactId>jaxb-xjc</artifactId>
232+
<version>${jaxb.version}</version>
233+
</dependency>
234+
<dependency>
235+
<groupId>com.sun.xml.bind.external</groupId>
236+
<artifactId>rngom</artifactId>
237+
<version>${jaxb.version}</version>
238+
</dependency>
239+
</dependencies>
221240
</plugin>
222241
<plugin>
223242
<groupId>org.codehaus.mojo</groupId>

0 commit comments

Comments
 (0)