Skip to content

Commit

Permalink
Code coverage to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
lhazlewood committed Aug 17, 2023
1 parent 129c0e3 commit ee056d6
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ import java.nio.charset.StandardCharsets
import java.security.Key
import java.security.Provider

import static org.junit.Assert.assertEquals
import static org.junit.Assert.fail
import static org.junit.Assert.*

class DefaultJwkParserTest {

Expand Down Expand Up @@ -84,6 +83,18 @@ class DefaultJwkParserTest {
}
}

@Test
void testParseWithProvider() {
def provider = Providers.findBouncyCastle(Conditions.TRUE)
def jwk = Jwks.builder().provider(provider).key(TestKeys.HS256).build()
def serializer = Services.loadFirst(Serializer)
def data = serializer.serialize(jwk)
String json = new String(data, StandardCharsets.UTF_8)
def parsed = Jwks.parser().provider(provider).build().parse(json)
assertEquals jwk, parsed
assertSame provider, parsed.@context.@provider
}

@Test
void testDeserializationFailure() {
def parser = new DefaultJwkParser(null, Services.loadFirst(Deserializer)) {
Expand Down

0 comments on commit ee056d6

Please sign in to comment.