Search in sources :

Example 1 with Access

use of org.openstack4j.model.identity.v2.Access in project openstack4j by ContainX.

the class KeystoneTests method testAuthorizationFailure.

public void testAuthorizationFailure() throws IOException {
    // First we simulate a 401 Authorization error
    respondWith(401);
    // The retry logic should re-authenticate and would be expecting the
    // Access object
    respondWith(JSON_ACCESS);
    // The retry logic would then run the user lists expecting the proper
    // result
    respondWith(JSON_USERS);
    assertEquals(osv2.identity().users().list().size(), 8);
    // Positive test to make sure we are back in sync
    respondWith(JSON_TENANT);
    Tenant t = osv2.identity().tenants().get("b80f8d4e28b74188858b654cb1fccf7d");
    assertEquals(t.getName(), "admin");
}
Also used : Tenant(org.openstack4j.model.identity.v2.Tenant)

Example 2 with Access

use of org.openstack4j.model.identity.v2.Access in project platformlayer by platformlayer.

the class SmokeTest method buildFakeToken.

private KeystoneAuthenticationToken buildFakeToken(String tokenCode) {
    Access auth = new Access();
    Token tokenObject = new Token();
    tokenObject.setId(tokenCode);
    auth.setToken(tokenObject);
    return new KeystoneAuthenticationToken(auth);
}
Also used : Access(org.openstack.docs.identity.api.v2.Access) Token(org.openstack.docs.identity.api.v2.Token) KeystoneAuthenticationToken(org.openstack.keystone.auth.client.KeystoneAuthenticationToken) KeystoneAuthenticationToken(org.openstack.keystone.auth.client.KeystoneAuthenticationToken)

Aggregations

Access (org.openstack.docs.identity.api.v2.Access)1 Token (org.openstack.docs.identity.api.v2.Token)1 KeystoneAuthenticationToken (org.openstack.keystone.auth.client.KeystoneAuthenticationToken)1 Tenant (org.openstack4j.model.identity.v2.Tenant)1