use of org.openstack.keystone.auth.client.KeystoneAuthenticationClient 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);
}
use of org.openstack.keystone.auth.client.KeystoneAuthenticationClient in project platformlayer by platformlayer.
the class SmokeTest method test.
// private static StandaloneUserServer server;
//
// @BeforeClass
// public static void startServer() throws Exception {
// File base = new File(".").getCanonicalFile();
//
// while (!base.getName().equals("auth")) {
// base = base.getParentFile();
// }
//
// base = new File(base, "server-user");
//
// server = new StandaloneUserServer();
// server.start(base, 8081);
// }
//
// @AfterClass
// public static void stopServer() throws Exception {
// server.stop();
// }
@Test
public void test() throws Exception {
KeystoneAuthenticationClient client = new KeystoneAuthenticationClient();
PasswordCredentials passwordCredentials = new PasswordCredentials();
passwordCredentials.setUsername("user1");
passwordCredentials.setPassword("secretuser1");
String tenantId = null;
client.authenticate(tenantId, passwordCredentials);
}
Aggregations