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");
}
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);
}
Aggregations