@Test
public void testLoadHttpsJwksWithX5t() throws Exception {

    JWTAuthContextInfo contextInfo = new JWTAuthContextInfo("https://github.com/my_key.jwks", "issuer");
    contextInfo.setJwksRefreshInterval(10);
    RsaJsonWebKey jwk = new RsaJsonWebKey(key);
    jwk.setOtherParameter("x5c", Collections.singletonList(x5c));
    when(mockedHttpsJwks.getJsonWebKeys()).thenReturn(Collections.singletonList(jwk));
    X509KeyLocationResolver keyLocationResolver = new X509KeyLocationResolver(contextInfo) {
        protected HttpsJwks initializeHttpsJwks(String loc) {
            return mockedHttpsJwks;
        }
    };
    keyLocationResolver = Mockito.spy(keyLocationResolver);
    when(signature.getX509CertSha1ThumbprintHeaderValue()).thenReturn(x5t);
    assertEquals(key, keyLocationResolver.resolveKey(signature, emptyList()));
}