@Test public void testEnableDisableAccount() { skipIfNotGlobalAdmin(); Account testAccount = null; try { testAccount = createTestAccount(globalAdminClient, prefix); AsyncCreateResponse response = domainAdminClient.getAccountClient() .disableAccount(testAccount.getName(), testAccount.getDomainId(), false); assertNotNull(response); assertTrue(jobComplete.apply(response.getJobId())); AsyncJob<Account> job = domainAdminClient.getAsyncJobClient().getAsyncJob(response.getJobId()); assertEquals(job.getResult().getState(), Account.State.DISABLED); Account updated = domainAdminClient.getAccountClient() .enableAccount(testAccount.getName(), testAccount.getDomainId()); assertNotNull(updated); assertEquals(updated.getState(), Account.State.ENABLED); } finally { if (testAccount != null) { globalAdminClient.getAccountClient().deleteAccount(testAccount.getId()); } } }
@Test public void testEnableDisableAccount() { skipIfNotGlobalAdmin(); Account testAccount = null; try { testAccount = createTestAccount(globalAdminClient, prefix); AsyncCreateResponse response = domainAdminClient.getAccountApi() .disableAccount(testAccount.getName(), testAccount.getDomainId(), false); assertNotNull(response); assertTrue(adminJobComplete.apply(response.getJobId())); AsyncJob<Account> job = domainAdminClient.getAsyncJobApi().getAsyncJob(response.getJobId()); assertEquals(job.getResult().getState(), Account.State.DISABLED); Account updated = domainAdminClient.getAccountApi() .enableAccount(testAccount.getName(), testAccount.getDomainId()); assertNotNull(updated); assertEquals(updated.getState(), Account.State.ENABLED); } finally { if (testAccount != null) { globalAdminClient.getAccountApi().deleteAccount(testAccount.getId()); } } }
assert account.getSnapshotLimit() == null || account.getSnapshotLimit() >= 0 : account; assert account.getSnapshots() >= 0 : account; assert account.getState() != null && account.getState() != Account.State.UNRECOGNIZED : account; assert account.getTemplatesAvailable() == null || account.getTemplatesAvailable() >= 0 : account; assert account.getTemplateLimit() == null || account.getTemplateLimit() >= 0 : account;
assert account.getSnapshotLimit() == null || account.getSnapshotLimit() >= 0 : account; assert account.getSnapshots() >= 0 : account; assert account.getState() != null && account.getState() != Account.State.UNRECOGNIZED : account; assert account.getTemplatesAvailable() == null || account.getTemplatesAvailable() >= 0 : account; assert account.getTemplateLimit() == null || account.getTemplateLimit() >= 0 : account;
.snapshotLimit(in.getSnapshotLimit()) .snapshots(in.getSnapshots()) .state(in.getState()) .templatesAvailable(in.getTemplatesAvailable()) .templateLimit(in.getTemplateLimit())
.snapshotLimit(in.getSnapshotLimit()) .snapshots(in.getSnapshots()) .state(in.getState()) .templatesAvailable(in.getTemplatesAvailable()) .templateLimit(in.getTemplateLimit())
.snapshotLimit(in.getSnapshotLimit()) .snapshots(in.getSnapshots()) .state(in.getState()) .templatesAvailable(in.getTemplatesAvailable()) .templateLimit(in.getTemplateLimit())