@Test
public void testCreateUser() {
skipIfNotGlobalAdmin();
Account testAccount = createTestAccount(globalAdminClient, prefix);
User testUser = null;
try {
testUser = createTestUser(globalAdminClient, testAccount, prefix);
assertNotNull(testUser);
assertEquals(testUser.getName(), prefix + "-user");
assertEquals(testUser.getAccount(), prefix + "-account");
User updatedUser = globalAdminClient.getUserClient()
.updateUser(testUser.getId(), userName(prefix + "-user-2"));
assertNotNull(updatedUser);
assertEquals(updatedUser.getName(), prefix + "-user-2");
ApiKeyPair apiKeys = globalAdminClient.getUserClient()
.registerUserKeys(updatedUser.getId());
assertNotNull(apiKeys.getApiKey());
assertNotNull(apiKeys.getSecretKey());
checkAuthAsUser(apiKeys);
} finally {
if (testUser != null) {
globalAdminClient.getUserClient().deleteUser(testUser.getId());
}
globalAdminClient.getAccountClient().deleteAccount(testAccount.getId());
}
}