Skip to content

Commit

Permalink
Update test dependencies (#539)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyjames committed Mar 11, 2022
1 parent 90cea2d commit fef3ccf
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
13 changes: 7 additions & 6 deletions lib/build.gradle
Expand Up @@ -48,11 +48,12 @@ javadoc {

dependencies {
implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.6'
testImplementation 'org.bouncycastle:bcprov-jdk15on:1.60'
testImplementation 'junit:junit:4.12'
testImplementation 'net.jodah:concurrentunit:0.4.3'
testImplementation 'org.hamcrest:java-hamcrest:2.0.0.0'
testImplementation 'org.mockito:mockito-core:2.18.3'

testImplementation 'org.bouncycastle:bcprov-jdk15on:1.70'
testImplementation 'junit:junit:4.13.2'
testImplementation 'net.jodah:concurrentunit:0.4.6'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.mockito:mockito-core:4.4.0'
}

jacoco {
Expand Down Expand Up @@ -92,7 +93,7 @@ task compileModuleInfoJava(type: JavaCompile) {
}

compileTestJava {
options.compilerArgs = ['--release', "8"]
options.compilerArgs = ['--release', "8", "-Xlint:deprecation"]
}

def testJava8 = tasks.register('testJava8', Test) {
Expand Down
6 changes: 3 additions & 3 deletions lib/src/test/java/com/auth0/jwt/JWTDecoderTest.java
Expand Up @@ -5,7 +5,7 @@
import com.auth0.jwt.interfaces.Claim;
import com.auth0.jwt.interfaces.DecodedJWT;
import org.hamcrest.collection.IsCollectionWithSize;
import org.hamcrest.core.IsCollectionContaining;
import org.hamcrest.core.IsIterableContaining;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
Expand Down Expand Up @@ -142,15 +142,15 @@ public void shouldGetArrayAudience() {
DecodedJWT jwt = JWT.decode("eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOlsiSG9wZSIsIlRyYXZpcyIsIlNvbG9tb24iXX0.Tm4W8WnfPjlmHSmKFakdij0on2rWPETpoM7Sh0u6-S4");
assertThat(jwt, is(notNullValue()));
assertThat(jwt.getAudience(), is(IsCollectionWithSize.hasSize(3)));
assertThat(jwt.getAudience(), is(IsCollectionContaining.hasItems("Hope", "Travis", "Solomon")));
assertThat(jwt.getAudience(), is(IsIterableContaining.hasItems("Hope", "Travis", "Solomon")));
}

@Test
public void shouldGetStringAudience() {
DecodedJWT jwt = JWT.decode("eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJKYWNrIFJleWVzIn0.a4I9BBhPt1OB1GW67g2P1bEHgi6zgOjGUL4LvhE9Dgc");
assertThat(jwt, is(notNullValue()));
assertThat(jwt.getAudience(), is(IsCollectionWithSize.hasSize(1)));
assertThat(jwt.getAudience(), is(IsCollectionContaining.hasItems("Jack Reyes")));
assertThat(jwt.getAudience(), is(IsIterableContaining.hasItems("Jack Reyes")));
}

@Test
Expand Down
6 changes: 3 additions & 3 deletions lib/src/test/java/com/auth0/jwt/JWTTest.java
Expand Up @@ -3,7 +3,7 @@
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.DecodedJWT;
import org.hamcrest.collection.IsCollectionWithSize;
import org.hamcrest.core.IsCollectionContaining;
import org.hamcrest.core.IsIterableContaining;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
Expand Down Expand Up @@ -256,7 +256,7 @@ public void shouldGetArrayAudience() {

assertThat(jwt, is(notNullValue()));
assertThat(jwt.getAudience(), is(IsCollectionWithSize.hasSize(3)));
assertThat(jwt.getAudience(), is(IsCollectionContaining.hasItems("Hope", "Travis", "Solomon")));
assertThat(jwt.getAudience(), is(IsIterableContaining.hasItems("Hope", "Travis", "Solomon")));
}

@Test
Expand All @@ -268,7 +268,7 @@ public void shouldGetStringAudience() {

assertThat(jwt, is(notNullValue()));
assertThat(jwt.getAudience(), is(IsCollectionWithSize.hasSize(1)));
assertThat(jwt.getAudience(), is(IsCollectionContaining.hasItems("Jack Reyes")));
assertThat(jwt.getAudience(), is(IsIterableContaining.hasItems("Jack Reyes")));
}

@Test
Expand Down
Expand Up @@ -12,7 +12,7 @@
import com.fasterxml.jackson.databind.node.*;
import org.hamcrest.collection.IsCollectionWithSize;
import org.hamcrest.collection.IsEmptyCollection;
import org.hamcrest.core.IsCollectionContaining;
import org.hamcrest.core.IsIterableContaining;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -93,7 +93,7 @@ public void shouldNotRemoveKnownPublicClaimsFromTree() throws Exception {
assertThat(payload, is(notNullValue()));
assertThat(payload.getIssuer(), is("auth0"));
assertThat(payload.getSubject(), is("emails"));
assertThat(payload.getAudience(), is(IsCollectionContaining.hasItem("users")));
assertThat(payload.getAudience(), is(IsIterableContaining.hasItem("users")));
assertThat(payload.getIssuedAt().getTime(), is(10101010L * 1000));
assertThat(payload.getExpiresAt().getTime(), is(11111111L * 1000));
assertThat(payload.getNotBefore().getTime(), is(10101011L * 1000));
Expand Down Expand Up @@ -126,7 +126,7 @@ public void shouldGetStringArrayWhenParsingArrayNode() {
List<String> values = deserializer.getStringOrArray(tree, "key");
assertThat(values, is(notNullValue()));
assertThat(values, is(IsCollectionWithSize.hasSize(2)));
assertThat(values, is(IsCollectionContaining.hasItems("one", "two")));
assertThat(values, is(IsIterableContaining.hasItems("one", "two")));
}

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

@Test
Expand Down
4 changes: 2 additions & 2 deletions lib/src/test/java/com/auth0/jwt/impl/PayloadImplTest.java
Expand Up @@ -6,7 +6,7 @@
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.node.TextNode;
import org.hamcrest.collection.IsCollectionWithSize;
import org.hamcrest.core.IsCollectionContaining;
import org.hamcrest.core.IsIterableContaining;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand Down Expand Up @@ -86,7 +86,7 @@ public void shouldGetAudience() {
assertThat(payload, is(notNullValue()));

assertThat(payload.getAudience(), is(IsCollectionWithSize.hasSize(1)));
assertThat(payload.getAudience(), is(IsCollectionContaining.hasItems("audience")));
assertThat(payload.getAudience(), is(IsIterableContaining.hasItems("audience")));
}

@Test
Expand Down

0 comments on commit fef3ccf

Please sign in to comment.