|
1 | 1 | /* |
2 | | - * Copyright 2012-2017 the original author or authors. |
| 2 | + * Copyright 2012-2019 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -138,13 +138,12 @@ public void convertWhenJwkSetStreamHasRSAJwkElementWithMissingPublicKeyUseAttrib |
138 | 138 | } |
139 | 139 |
|
140 | 140 | @Test |
141 | | - public void convertWhenJwkSetStreamHasRSAJwkElementWithENCPublicKeyUseAttributeThenThrowJwkException() throws Exception { |
142 | | - this.thrown.expect(JwkException.class); |
143 | | - this.thrown.expectMessage("enc (use) is currently not supported."); |
| 141 | + public void convertWhenJwkSetStreamHasRSAJwkElementWithENCPublicKeyUseAttributeThenReturnEmptyJwkSet() throws Exception { |
144 | 142 | Map<String, Object> jwkSetObject = new HashMap<String, Object>(); |
145 | 143 | Map<String, Object> jwkObject = this.createJwkObject(JwkDefinition.KeyType.RSA, "key-id-1", JwkDefinition.PublicKeyUse.ENC); |
146 | 144 | jwkSetObject.put(JwkAttributes.KEYS, new Map[] {jwkObject}); |
147 | | - this.converter.convert(this.asInputStream(jwkSetObject)); |
| 145 | + Set<JwkDefinition> jwkSet = this.converter.convert(this.asInputStream(jwkSetObject)); |
| 146 | + assertTrue("JWK Set NOT empty", jwkSet.isEmpty()); |
148 | 147 | } |
149 | 148 |
|
150 | 149 | @Test |
@@ -190,13 +189,12 @@ public void convertWhenJwkSetStreamHasECJwkElementWithMissingPublicKeyUseAttribu |
190 | 189 | } |
191 | 190 |
|
192 | 191 | @Test |
193 | | - public void convertWhenJwkSetStreamHasECJwkElementWithENCPublicKeyUseAttributeThenThrowJwkException() throws Exception { |
194 | | - this.thrown.expect(JwkException.class); |
195 | | - this.thrown.expectMessage("enc (use) is currently not supported."); |
| 192 | + public void convertWhenJwkSetStreamHasECJwkElementWithENCPublicKeyUseAttributeThenReturnEmptyJwkSet() throws Exception { |
196 | 193 | Map<String, Object> jwkSetObject = new HashMap<String, Object>(); |
197 | 194 | Map<String, Object> jwkObject = this.createEllipticCurveJwkObject("key-id-1", JwkDefinition.PublicKeyUse.ENC, null); |
198 | 195 | jwkSetObject.put(JwkAttributes.KEYS, new Map[] {jwkObject}); |
199 | | - this.converter.convert(this.asInputStream(jwkSetObject)); |
| 196 | + Set<JwkDefinition> jwkSet = this.converter.convert(this.asInputStream(jwkSetObject)); |
| 197 | + assertTrue("JWK Set NOT empty", jwkSet.isEmpty()); |
200 | 198 | } |
201 | 199 |
|
202 | 200 | @Test |
|
0 commit comments