@Test
public void testResolveSigningKey() {

    final String oldConf = System.setProperty(JwtsSigningKeyResolver.ZTS_PROP_ATHENZ_CONF,
            "src/test/resources/athenz.conf");
    JwtsSigningKeyResolver resolver = new JwtsSigningKeyResolver(null, null);
    JwsHeader header = Mockito.mock(JwsHeader.class);
    Mockito.when(header.getKeyId())
            .thenReturn("eckey1")
            .thenReturn("unknown");
    // first we get eckey1 which exists
    java.security.Key key = resolver.resolveSigningKey(header, "body");
    assertNotNull(key);
    // next we get unknown
    key = resolver.resolveSigningKey(header, "body");
    assertNull(key);
    if (oldConf == null) {
        System.clearProperty(JwtsSigningKeyResolver.ZTS_PROP_ATHENZ_CONF);
    } else {
        System.setProperty(JwtsSigningKeyResolver.ZTS_PROP_ATHENZ_CONF, oldConf);
    }
}