Skip to content

Commit

Permalink
Added test case for #438 (#811)
Browse files Browse the repository at this point in the history
* Added test case for #438
  • Loading branch information
lhazlewood committed Sep 5, 2023
1 parent 26026d6 commit d54be18
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions impl/src/test/groovy/io/jsonwebtoken/issues/Issue438Test.groovy
@@ -0,0 +1,33 @@
/*
* Copyright © 2023 jsonwebtoken.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.jsonwebtoken.issues

import io.jsonwebtoken.Jwts
import io.jsonwebtoken.UnsupportedJwtException
import io.jsonwebtoken.impl.security.TestKeys
import org.junit.Test

/**
* https://github.com/jwtk/jjwt/issues/438
*/
class Issue438Test {

@Test(expected = UnsupportedJwtException /* not IllegalArgumentException */)
void testIssue438() {
String jws = Jwts.builder().audience('test').signWith(TestKeys.RS256.pair.private).compact()
Jwts.parser().verifyWith(TestKeys.HS256).build().parseClaimsJws(jws)
}
}

0 comments on commit d54be18

Please sign in to comment.