Skip to content

Commit

Permalink
For #826: Review changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulodamaso committed Oct 15, 2018
1 parent dcd77db commit 1b59c9b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/test/java/org/takes/facets/auth/TokenTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import javax.json.JsonObject;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.hamcrest.core.IsEqual;
import org.junit.Test;
import org.takes.facets.auth.Token.Jose;
import org.takes.facets.auth.Token.Jwt;
Expand Down Expand Up @@ -64,11 +65,12 @@ public void joseAlgorithm() throws IOException {
public void joseEncoded() throws IOException {
// @checkstyle MagicNumber (2 lines)
final byte[] code = new Token.Jose(256).encoded();
final JsonObject jose = new Token.Jose(256).json();
MatcherAssert.assertThat(
code,
Matchers.equalTo(
Base64.getEncoder().encode(jose.toString().getBytes())
new IsEqual<>(
Base64.getEncoder().encode(
"{\"alg\":\"HS256\",\"typ\":\"JWT\"}".getBytes()
)
)
);
}
Expand Down

0 comments on commit 1b59c9b

Please sign in to comment.