@Test
public void testLoadJWKOnClassPath() throws Exception {

    JWTAuthContextInfo contextInfo = new JWTAuthContextInfo();
    contextInfo.setDecryptionKeyLocation("decryptPrivateKey.jwk");
    contextInfo.setTokenDecryptionKeyId("key1");
    when(encryption.getHeaders()).thenReturn(headers);
    when(headers.getStringHeaderValue(JsonWebKey.KEY_ID_PARAMETER)).thenReturn("key1");
    DecryptionKeyLocationResolver keyLocationResolver = new DecryptionKeyLocationResolver(contextInfo);
    assertNotNull(keyLocationResolver.key);
    assertEquals(keyLocationResolver.key, keyLocationResolver.resolveKey(encryption, emptyList()));
    assertEquals(keyLocationResolver.key,
            ((PublicJsonWebKey) keyLocationResolver.getJsonWebKey("key1", null)).getPrivateKey());
}