Search in sources :

Example 1 with KeystoneAuthenticationToken

use of org.openstack.keystone.auth.client.KeystoneAuthenticationToken in project platformlayer by platformlayer.

the class SmokeTest method listTenants_forgedToken.

@Test(expected = KeystoneAuthenticationException.class)
public void listTenants_forgedToken() throws Exception {
    KeystoneAuthenticationClient client = new KeystoneAuthenticationClient();
    KeystoneAuthenticationToken fakeToken = buildFakeToken("HELLOWORLD");
    client.listTenants(fakeToken);
}
Also used : KeystoneAuthenticationClient(org.openstack.keystone.auth.client.KeystoneAuthenticationClient) KeystoneAuthenticationToken(org.openstack.keystone.auth.client.KeystoneAuthenticationToken) Test(org.junit.Test)

Example 2 with KeystoneAuthenticationToken

use of org.openstack.keystone.auth.client.KeystoneAuthenticationToken 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

KeystoneAuthenticationToken (org.openstack.keystone.auth.client.KeystoneAuthenticationToken)2 Test (org.junit.Test)1 Access (org.openstack.docs.identity.api.v2.Access)1 Token (org.openstack.docs.identity.api.v2.Token)1 KeystoneAuthenticationClient (org.openstack.keystone.auth.client.KeystoneAuthenticationClient)1