use of org.xdi.oxauth.client.JwkClient in project oxAuth by GluuFederation.
the class JwkRestWebServiceHttpTest method requestClientJwks.
@Parameters({ "clientJwksUri" })
@Test
public void requestClientJwks(final String clientJwksUri) throws Exception {
showTitle("requestJwks");
JwkClient jwkClient = new JwkClient(clientJwksUri);
JwkResponse response = jwkClient.exec();
showClient(jwkClient);
assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
assertNotNull(response.getEntity(), "Unexpected result: entity is null");
assertNotNull(response.getJwks(), "Unexpected result: jwks is null");
assertNotNull(response.getJwks().getKeys(), "Unexpected result: keys is null");
assertTrue(response.getJwks().getKeys().size() > 0, "Unexpected result: keys is empty");
for (JSONWebKey JSONWebKey : response.getJwks().getKeys()) {
assertNotNull(JSONWebKey.getKid(), "Unexpected result: kid is null");
assertNotNull(JSONWebKey.getUse(), "Unexpected result: use is null");
}
}
use of org.xdi.oxauth.client.JwkClient in project oxAuth by GluuFederation.
the class JwkRestWebServiceHttpTest method requestJwks.
@Test
public void requestJwks() throws Exception {
showTitle("requestJwks");
JwkClient jwkClient = new JwkClient(jwksUri);
JwkResponse response = jwkClient.exec();
showClient(jwkClient);
assertEquals(response.getStatus(), 200, "Unexpected response code: " + response.getEntity());
assertNotNull(response.getEntity(), "Unexpected result: entity is null");
assertNotNull(response.getJwks(), "Unexpected result: jwks is null");
assertNotNull(response.getJwks().getKeys(), "Unexpected result: keys is null");
assertTrue(response.getJwks().getKeys().size() > 0, "Unexpected result: keys is empty");
for (JSONWebKey JSONWebKey : response.getJwks().getKeys()) {
assertNotNull(JSONWebKey.getKid(), "Unexpected result: kid is null");
assertNotNull(JSONWebKey.getUse(), "Unexpected result: use is null");
}
}
Aggregations