Skip to content

Commit fef3ccf

Browse files
authored
Update test dependencies (#539)
1 parent 90cea2d commit fef3ccf

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

lib/build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ javadoc {
4848

4949
dependencies {
5050
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.6'
51-
testImplementation 'org.bouncycastle:bcprov-jdk15on:1.60'
52-
testImplementation 'junit:junit:4.12'
53-
testImplementation 'net.jodah:concurrentunit:0.4.3'
54-
testImplementation 'org.hamcrest:java-hamcrest:2.0.0.0'
55-
testImplementation 'org.mockito:mockito-core:2.18.3'
51+
52+
testImplementation 'org.bouncycastle:bcprov-jdk15on:1.70'
53+
testImplementation 'junit:junit:4.13.2'
54+
testImplementation 'net.jodah:concurrentunit:0.4.6'
55+
testImplementation 'org.hamcrest:hamcrest:2.2'
56+
testImplementation 'org.mockito:mockito-core:4.4.0'
5657
}
5758

5859
jacoco {
@@ -92,7 +93,7 @@ task compileModuleInfoJava(type: JavaCompile) {
9293
}
9394

9495
compileTestJava {
95-
options.compilerArgs = ['--release', "8"]
96+
options.compilerArgs = ['--release', "8", "-Xlint:deprecation"]
9697
}
9798

9899
def testJava8 = tasks.register('testJava8', Test) {

lib/src/test/java/com/auth0/jwt/JWTDecoderTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import com.auth0.jwt.interfaces.Claim;
66
import com.auth0.jwt.interfaces.DecodedJWT;
77
import org.hamcrest.collection.IsCollectionWithSize;
8-
import org.hamcrest.core.IsCollectionContaining;
8+
import org.hamcrest.core.IsIterableContaining;
99
import org.junit.Rule;
1010
import org.junit.Test;
1111
import org.junit.rules.ExpectedException;
@@ -142,15 +142,15 @@ public void shouldGetArrayAudience() {
142142
DecodedJWT jwt = JWT.decode("eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOlsiSG9wZSIsIlRyYXZpcyIsIlNvbG9tb24iXX0.Tm4W8WnfPjlmHSmKFakdij0on2rWPETpoM7Sh0u6-S4");
143143
assertThat(jwt, is(notNullValue()));
144144
assertThat(jwt.getAudience(), is(IsCollectionWithSize.hasSize(3)));
145-
assertThat(jwt.getAudience(), is(IsCollectionContaining.hasItems("Hope", "Travis", "Solomon")));
145+
assertThat(jwt.getAudience(), is(IsIterableContaining.hasItems("Hope", "Travis", "Solomon")));
146146
}
147147

148148
@Test
149149
public void shouldGetStringAudience() {
150150
DecodedJWT jwt = JWT.decode("eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJKYWNrIFJleWVzIn0.a4I9BBhPt1OB1GW67g2P1bEHgi6zgOjGUL4LvhE9Dgc");
151151
assertThat(jwt, is(notNullValue()));
152152
assertThat(jwt.getAudience(), is(IsCollectionWithSize.hasSize(1)));
153-
assertThat(jwt.getAudience(), is(IsCollectionContaining.hasItems("Jack Reyes")));
153+
assertThat(jwt.getAudience(), is(IsIterableContaining.hasItems("Jack Reyes")));
154154
}
155155

156156
@Test

lib/src/test/java/com/auth0/jwt/JWTTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.auth0.jwt.algorithms.Algorithm;
44
import com.auth0.jwt.interfaces.DecodedJWT;
55
import org.hamcrest.collection.IsCollectionWithSize;
6-
import org.hamcrest.core.IsCollectionContaining;
6+
import org.hamcrest.core.IsIterableContaining;
77
import org.junit.Rule;
88
import org.junit.Test;
99
import org.junit.rules.ExpectedException;
@@ -256,7 +256,7 @@ public void shouldGetArrayAudience() {
256256

257257
assertThat(jwt, is(notNullValue()));
258258
assertThat(jwt.getAudience(), is(IsCollectionWithSize.hasSize(3)));
259-
assertThat(jwt.getAudience(), is(IsCollectionContaining.hasItems("Hope", "Travis", "Solomon")));
259+
assertThat(jwt.getAudience(), is(IsIterableContaining.hasItems("Hope", "Travis", "Solomon")));
260260
}
261261

262262
@Test
@@ -268,7 +268,7 @@ public void shouldGetStringAudience() {
268268

269269
assertThat(jwt, is(notNullValue()));
270270
assertThat(jwt.getAudience(), is(IsCollectionWithSize.hasSize(1)));
271-
assertThat(jwt.getAudience(), is(IsCollectionContaining.hasItems("Jack Reyes")));
271+
assertThat(jwt.getAudience(), is(IsIterableContaining.hasItems("Jack Reyes")));
272272
}
273273

274274
@Test

lib/src/test/java/com/auth0/jwt/impl/PayloadDeserializerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import com.fasterxml.jackson.databind.node.*;
1313
import org.hamcrest.collection.IsCollectionWithSize;
1414
import org.hamcrest.collection.IsEmptyCollection;
15-
import org.hamcrest.core.IsCollectionContaining;
15+
import org.hamcrest.core.IsIterableContaining;
1616
import org.junit.Before;
1717
import org.junit.Rule;
1818
import org.junit.Test;
@@ -93,7 +93,7 @@ public void shouldNotRemoveKnownPublicClaimsFromTree() throws Exception {
9393
assertThat(payload, is(notNullValue()));
9494
assertThat(payload.getIssuer(), is("auth0"));
9595
assertThat(payload.getSubject(), is("emails"));
96-
assertThat(payload.getAudience(), is(IsCollectionContaining.hasItem("users")));
96+
assertThat(payload.getAudience(), is(IsIterableContaining.hasItem("users")));
9797
assertThat(payload.getIssuedAt().getTime(), is(10101010L * 1000));
9898
assertThat(payload.getExpiresAt().getTime(), is(11111111L * 1000));
9999
assertThat(payload.getNotBefore().getTime(), is(10101011L * 1000));
@@ -126,7 +126,7 @@ public void shouldGetStringArrayWhenParsingArrayNode() {
126126
List<String> values = deserializer.getStringOrArray(tree, "key");
127127
assertThat(values, is(notNullValue()));
128128
assertThat(values, is(IsCollectionWithSize.hasSize(2)));
129-
assertThat(values, is(IsCollectionContaining.hasItems("one", "two")));
129+
assertThat(values, is(IsIterableContaining.hasItems("one", "two")));
130130
}
131131

132132
@Test
@@ -138,7 +138,7 @@ public void shouldGetStringArrayWhenParsingTextNode() {
138138
List<String> values = deserializer.getStringOrArray(tree, "key");
139139
assertThat(values, is(notNullValue()));
140140
assertThat(values, is(IsCollectionWithSize.hasSize(1)));
141-
assertThat(values, is(IsCollectionContaining.hasItems("something")));
141+
assertThat(values, is(IsIterableContaining.hasItems("something")));
142142
}
143143

144144
@Test

lib/src/test/java/com/auth0/jwt/impl/PayloadImplTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import com.fasterxml.jackson.databind.ObjectReader;
77
import com.fasterxml.jackson.databind.node.TextNode;
88
import org.hamcrest.collection.IsCollectionWithSize;
9-
import org.hamcrest.core.IsCollectionContaining;
9+
import org.hamcrest.core.IsIterableContaining;
1010
import org.junit.Before;
1111
import org.junit.Rule;
1212
import org.junit.Test;
@@ -86,7 +86,7 @@ public void shouldGetAudience() {
8686
assertThat(payload, is(notNullValue()));
8787

8888
assertThat(payload.getAudience(), is(IsCollectionWithSize.hasSize(1)));
89-
assertThat(payload.getAudience(), is(IsCollectionContaining.hasItems("audience")));
89+
assertThat(payload.getAudience(), is(IsIterableContaining.hasItems("audience")));
9090
}
9191

9292
@Test

0 commit comments

Comments
 (0)