List of usage examples for junit.framework Assert assertFalse
static public void assertFalse(boolean condition)
From source file:com.vmware.identity.idm.client.TenantManagementTest.java
@TestOrderAnnotation(order = 14) @Test/*from ww w .j av a 2 s . c om*/ public void testSetTenantTrustedCertChain() throws Exception, IDMException { CasIdmClient idmClient = getIdmClient(); Properties props = getTestProperties(); // Set trustedCertChain for non-system tenant String tenantName = props.getProperty(CFG_KEY_IDM_TENANT_1_NAME); Assert.assertNotNull(tenantName); Tenant tenant = IdmClientTestUtil.ensureTenantExists(idmClient, tenantName); Assert.assertNotNull(tenant); List<Certificate> certList = new ArrayList<Certificate>(); KeyStore ks = loadKeyStore(CFG_KEY_TRUSTED_STS_KEYSTORE, CFG_KEY_TRUSTED_STS_KEYSTORE_PASSWORD); String alias = props.getProperty(CFG_KEY_TRUSTED_STS_KEY_ALIAS); Assert.assertNotNull(alias); certList.add(ks.getCertificate(alias)); String alias1 = props.getProperty(CFG_KEY_TRUSTED_STS_KEY_ALIAS1); Assert.assertNotNull(alias1); certList.add(ks.getCertificate(alias1)); Collection<List<Certificate>> certList_prev = idmClient.getTenantCertificates(tenantName); idmClient.setTenantTrustedCertificateChain(tenantName, certList); Collection<List<Certificate>> certList_after = idmClient.getTenantCertificates(tenantName); Assert.assertTrue(certList_after.contains(certList)); Assert.assertTrue(certList_prev.size() + 1 == certList_after.size()); // Set trustedCertChain for system tenant List<Certificate> certList1 = new ArrayList<Certificate>(); ks = loadKeyStore(CFG_KEY_STS_KEYSTORE, CFG_KEY_STS_KEYSTORE_PASSWORD); alias = props.getProperty(CFG_KEY_STS_KEY_ALIAS); Assert.assertNotNull(alias); Certificate trusted_leaf_cert = ks.getCertificate(alias); certList1.add(trusted_leaf_cert); alias1 = props.getProperty(CFG_KEY_STS_KEY_ALIAS1); Assert.assertNotNull(alias1); Certificate trusted_root_cert = ks.getCertificate(alias1); certList1.add(trusted_root_cert); String system_tenantName = props.getProperty(CFG_KEY_IDM_SYSTEM_TENANT_NAME); Assert.assertNotNull(system_tenantName); String obtainedSysTenant = idmClient.getSystemTenant(); Assert.assertTrue(system_tenantName.equalsIgnoreCase(obtainedSysTenant)); Collection<List<Certificate>> certList_prev_sp = idmClient.getTenantCertificates(system_tenantName); idmClient.setTenantTrustedCertificateChain(system_tenantName, certList1); Collection<List<Certificate>> certList_after_sp = idmClient.getTenantCertificates(system_tenantName); Assert.assertTrue(certList_after_sp.contains(certList1)); Assert.assertTrue(certList_prev_sp.size() + 1 == certList_after_sp.size()); Collection<Certificate> allLdapCerts = idmClient.getAllCertificates(system_tenantName, CertificateType.LDAP_TRUSTED_CERT); Assert.assertTrue(allLdapCerts == null || allLdapCerts.size() == 0); Collection<Certificate> allStsCerts = idmClient.getAllCertificates(system_tenantName, CertificateType.STS_TRUST_CERT); Collection<Certificate> rootCerts = idmClient.getTrustedCertificates(system_tenantName); Assert.assertTrue(rootCerts.contains(trusted_root_cert)); Collection<Certificate> leafCerts = idmClient.getStsIssuersCertificates(system_tenantName); Assert.assertTrue(leafCerts.contains(trusted_leaf_cert)); // clean up added TrustedCertificateChain idmClient.deleteCertificate(system_tenantName, CertificateUtil.generateFingerprint((X509Certificate) trusted_root_cert), CertificateType.STS_TRUST_CERT); // Make sure 'trusted_root_cert' is removed successfully allStsCerts = idmClient.getAllCertificates(system_tenantName, CertificateType.STS_TRUST_CERT); Assert.assertFalse(allStsCerts.contains(trusted_root_cert)); rootCerts = idmClient.getTrustedCertificates(system_tenantName); Assert.assertTrue(rootCerts.size() == 1); leafCerts = idmClient.getStsIssuersCertificates(system_tenantName); Assert.assertTrue(leafCerts.size() == 1); // Make sure 'trustedCertChain is removed (triggered by trustedRoot Cert removal) Collection<List<Certificate>> certChains = idmClient.getTenantCertificates(system_tenantName); // certChain used in 'TenantTest' has two elements (sorted by leaf followed by root) for (List<Certificate> certChain : certChains) { boolean bcertChainExist = certChain.get(0).equals(trusted_leaf_cert) && certChain.get(1).equals(trusted_root_cert); Assert.assertFalse(bcertChainExist); } return; }
From source file:de.clusteval.data.dataset.TestDataSet.java
/** * Test method for {@link data.dataset.DataSet#unloadFromMemory()}. * // ww w.ja v a 2 s.c o m * @throws UnknownDataSetFormatException * @throws NoRepositoryFoundException * @throws IOException * @throws FormatConversionException * @throws DataSetNotFoundException * @throws InvalidDataSetFormatVersionException * @throws DataSetConfigurationException * @throws RegisterException * @throws IllegalAccessException * @throws InstantiationException * @throws RNotAvailableException * @throws UnknownRunDataStatisticException * @throws UnknownRunStatisticException * @throws UnknownDataStatisticException * @throws NoOptimizableProgramParameterException * @throws UnknownParameterOptimizationMethodException * @throws IncompatibleParameterOptimizationMethodException * @throws IncompatibleDataSetConfigPreprocessorException * @throws UnknownDataPreprocessorException * @throws UnknownRProgramException * @throws UnknownProgramTypeException * @throws UnknownProgramParameterException * @throws InvalidOptimizationParameterException * @throws UnknownRunResultFormatException * @throws IncompatibleContextException * @throws RunException * @throws UnknownClusteringQualityMeasureException * @throws UnknownParameterType * @throws ConfigurationException * @throws NumberFormatException * @throws DataConfigNotFoundException * @throws DataConfigurationException * @throws GoldStandardConfigNotFoundException * @throws DataSetConfigNotFoundException * @throws GoldStandardConfigurationException * @throws GoldStandardNotFoundException * @throws UnknownContextException */ @Test public void testUnloadFromMemory() throws NoRepositoryFoundException, UnknownDataSetFormatException, FormatConversionException, IOException, DataSetNotFoundException, InvalidDataSetFormatVersionException, DataSetConfigurationException, RegisterException, UnknownDataSetTypeException, NoDataSetException, InstantiationException, IllegalAccessException, UnknownDistanceMeasureException, RNotAvailableException, GoldStandardNotFoundException, GoldStandardConfigurationException, DataSetConfigNotFoundException, GoldStandardConfigNotFoundException, DataConfigurationException, DataConfigNotFoundException, NumberFormatException, ConfigurationException, UnknownContextException, UnknownParameterType, UnknownClusteringQualityMeasureException, RunException, IncompatibleContextException, UnknownRunResultFormatException, InvalidOptimizationParameterException, UnknownProgramParameterException, UnknownProgramTypeException, UnknownRProgramException, UnknownDataPreprocessorException, IncompatibleDataSetConfigPreprocessorException, IncompatibleParameterOptimizationMethodException, UnknownParameterOptimizationMethodException, NoOptimizableProgramParameterException, UnknownDataStatisticException, UnknownRunStatisticException, UnknownRunDataStatisticException { this.repositoryObject = Parser.parseFromFile(DataSet.class, new File("testCaseRepository/data/datasets/DS1/Zachary_karate_club_similarities.txt") .getAbsoluteFile()); DataSet standard = ((DataSet) this.repositoryObject).preprocessAndConvertTo(context, DataSetFormat.parseFromString(getRepository(), "SimMatrixDataSetFormat"), new ConversionInputToStandardConfiguration( DistanceMeasure.parseFromString(getRepository(), "EuclidianDistanceMeasure"), NUMBER_PRECISION.DOUBLE, new ArrayList<DataPreprocessor>(), new ArrayList<DataPreprocessor>()), new ConversionStandardToInputConfiguration()); standard.loadIntoMemory(); Assert.assertTrue(standard.isInMemory()); standard.unloadFromMemory(); Assert.assertFalse(standard.isInMemory()); }
From source file:com.amazonaws.services.kinesis.clientlibrary.lib.worker.ShardSyncerTest.java
/** * Test CheckIfDescendantAndAddNewLeasesForAncestors when shardId is null *///from ww w .j av a 2s . c o m @Test public final void testCheckIfDescendantAndAddNewLeasesForAncestorsNullShardId() { Map<String, Boolean> memoizationContext = new HashMap<>(); Assert.assertFalse(ShardSyncer.checkIfDescendantAndAddNewLeasesForAncestors(null, INITIAL_POSITION_LATEST, null, null, null, memoizationContext)); }
From source file:com.amazonaws.services.kinesis.clientlibrary.lib.worker.ShardSyncerTest.java
/** * Test CheckIfDescendantAndAddNewLeasesForAncestors when shard has been trimmed *//*from ww w . ja v a 2 s . c om*/ @Test public final void testCheckIfDescendantAndAddNewLeasesForAncestorsTrimmedShard() { String shardId = "shardId-trimmed"; Map<String, Shard> kinesisShards = new HashMap<String, Shard>(); Map<String, Boolean> memoizationContext = new HashMap<>(); Assert.assertFalse(ShardSyncer.checkIfDescendantAndAddNewLeasesForAncestors(shardId, INITIAL_POSITION_LATEST, null, kinesisShards, null, memoizationContext)); }
From source file:com.amazonaws.services.kinesis.clientlibrary.lib.worker.ShardSyncerTest.java
/** * Test CheckIfDescendantAndAddNewLeasesForAncestors - two parents, two ancestors, not descendant *//*from w w w. jav a 2s . c o m*/ @Test public final void testCheckIfDescendantAndAddNewLeasesForAncestors2P2ANotDescendant() { Set<String> shardIdsOfCurrentLeases = new HashSet<String>(); Map<String, KinesisClientLease> newLeaseMap = new HashMap<String, KinesisClientLease>(); Map<String, Shard> kinesisShards = new HashMap<String, Shard>(); String parentShardId = "shardId-parent"; kinesisShards.put(parentShardId, ShardObjectHelper.newShard(parentShardId, null, null, null)); String adjacentParentShardId = "shardId-adjacentParent"; kinesisShards.put(adjacentParentShardId, ShardObjectHelper.newShard(adjacentParentShardId, null, null, null)); String shardId = "shardId-9-1"; kinesisShards.put(shardId, ShardObjectHelper.newShard(shardId, parentShardId, adjacentParentShardId, null)); Map<String, Boolean> memoizationContext = new HashMap<>(); Assert.assertFalse(ShardSyncer.checkIfDescendantAndAddNewLeasesForAncestors(shardId, INITIAL_POSITION_LATEST, shardIdsOfCurrentLeases, kinesisShards, newLeaseMap, memoizationContext)); Assert.assertTrue(newLeaseMap.isEmpty()); }
From source file:com.amazonaws.services.kinesis.clientlibrary.lib.worker.ShardSyncerTest.java
/** * Test isCandidateForCleanup//w ww.j a v a 2 s . c om * * @throws KinesisClientLibIOException */ @Test public final void testIsCandidateForCleanup() throws KinesisClientLibIOException { String parentShardId = "shardId-0000"; String adjacentParentShardId = "shardId-0001"; String shardId = "shardId-0002"; KinesisClientLease lease = newLease(shardId); List<String> parentShardIds = new ArrayList<>(); parentShardIds.add(parentShardId); parentShardIds.add(adjacentParentShardId); lease.setParentShardIds(parentShardIds); Set<String> currentKinesisShardIds = new HashSet<>(); currentKinesisShardIds.add(shardId); Assert.assertFalse(ShardSyncer.isCandidateForCleanup(lease, currentKinesisShardIds)); currentKinesisShardIds.clear(); Assert.assertTrue(ShardSyncer.isCandidateForCleanup(lease, currentKinesisShardIds)); currentKinesisShardIds.add(parentShardId); // Assert.assertFalse(ShardSyncer.isCandidateForCleanup(lease, currentKinesisShardIds)); currentKinesisShardIds.clear(); Assert.assertTrue(ShardSyncer.isCandidateForCleanup(lease, currentKinesisShardIds)); currentKinesisShardIds.add(adjacentParentShardId); // Assert.assertFalse(ShardSyncer.isCandidateForCleanup(lease, currentKinesisShardIds)); currentKinesisShardIds.add(parentShardId); // Assert.assertFalse(ShardSyncer.isCandidateForCleanup(lease, currentKinesisShardIds)); currentKinesisShardIds.add(shardId); Assert.assertFalse(ShardSyncer.isCandidateForCleanup(lease, currentKinesisShardIds)); }
From source file:com.amazonaws.services.kinesis.clientlibrary.lib.worker.ShardSyncerTest.java
/** * Test isCandidateForCleanup/*w w w .j a v a2s.co m*/ * * @throws KinesisClientLibIOException */ @Test(expected = KinesisClientLibIOException.class) public final void testIsCandidateForCleanupParentExists() throws KinesisClientLibIOException { String parentShardId = "shardId-0000"; String adjacentParentShardId = "shardId-0001"; String shardId = "shardId-0002"; KinesisClientLease lease = newLease(shardId); List<String> parentShardIds = new ArrayList<>(); parentShardIds.add(parentShardId); parentShardIds.add(adjacentParentShardId); lease.setParentShardIds(parentShardIds); Set<String> currentKinesisShardIds = new HashSet<>(); currentKinesisShardIds.add(parentShardId); Assert.assertFalse(ShardSyncer.isCandidateForCleanup(lease, currentKinesisShardIds)); }
From source file:com.amazonaws.services.kinesis.clientlibrary.lib.worker.ShardSyncerTest.java
/** * Test isCandidateForCleanup/*from w w w . j a va2 s .com*/ * * @throws KinesisClientLibIOException */ @Test(expected = KinesisClientLibIOException.class) public final void testIsCandidateForCleanupAdjacentParentExists() throws KinesisClientLibIOException { String parentShardId = "shardId-0000"; String adjacentParentShardId = "shardId-0001"; String shardId = "shardId-0002"; KinesisClientLease lease = newLease(shardId); List<String> parentShardIds = new ArrayList<>(); parentShardIds.add(parentShardId); parentShardIds.add(adjacentParentShardId); lease.setParentShardIds(parentShardIds); Set<String> currentKinesisShardIds = new HashSet<>(); currentKinesisShardIds.add(adjacentParentShardId); Assert.assertFalse(ShardSyncer.isCandidateForCleanup(lease, currentKinesisShardIds)); }
From source file:com.vmware.identity.idm.client.TenantManagementTest.java
@TestOrderAnnotation(order = 46) @Ignore("LIKEWISE SAMDB should be setup for this to work") @Test//from ww w. j ava 2s. c o m public void testAuthenticateRoot() throws Exception, IDMException { CasIdmClient idmClient = getIdmClient(); String tenantName = idmClient.getDefaultTenant(); Assert.assertNotNull(tenantName); Assert.assertFalse(tenantName.length() == 0); idmClient.authenticate(tenantName, "root", "vmware"); }
From source file:com.vmware.identity.idm.client.TenantManagementTest.java
@TestOrderAnnotation(order = 49) @Test/*from w w w.j a v a2 s. c o m*/ public void testSetGetTenantProperties() throws Exception, IDMException { CasIdmClient idmClient = getIdmClient(); Properties props = getTestProperties(); String testTenantName = props.getProperty(CFG_KEY_IDM_TENANT_2_NAME); Assert.assertNotNull(testTenantName); IdmClientTestUtil.ensureTenantDoesNotExist(idmClient, testTenantName); Tenant tenant = IdmClientTestUtil.ensureTenantExists(idmClient, testTenantName); Assert.assertNotNull(tenant); final long clockTolerance = 20000; idmClient.setClockTolerance(testTenantName, clockTolerance); Assert.assertEquals(clockTolerance, idmClient.getClockTolerance(testTenantName)); final int delegationCount = 5; idmClient.setDelegationCount(testTenantName, delegationCount); Assert.assertEquals(delegationCount, idmClient.getDelegationCount(testTenantName)); final int renewCount = 10; idmClient.setRenewCount(testTenantName, renewCount); Assert.assertEquals(renewCount, idmClient.getRenewCount(testTenantName)); final long maxhoktoken = 30000; idmClient.setMaximumHoKTokenLifetime(testTenantName, maxhoktoken); Assert.assertEquals(maxhoktoken, idmClient.getMaximumHoKTokenLifetime(testTenantName)); final long maxbeartoken = 40000; idmClient.setMaximumBearerTokenLifetime(testTenantName, maxbeartoken); Assert.assertEquals(maxbeartoken, idmClient.getMaximumBearerTokenLifetime(testTenantName)); final long maxBearerRefreshTokenLifeTime = 40000; idmClient.setMaximumBearerRefreshTokenLifetime(testTenantName, maxBearerRefreshTokenLifeTime); Assert.assertEquals(maxbeartoken, idmClient.getMaximumBearerRefreshTokenLifetime(testTenantName)); final long maxHoKRefreshTokenLifeTime = 30000; idmClient.setMaximumHoKRefreshTokenLifetime(testTenantName, maxHoKRefreshTokenLifeTime); Assert.assertEquals(maxhoktoken, idmClient.getMaximumHoKRefreshTokenLifetime(testTenantName)); final String signatureAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"; idmClient.setTenantSignatureAlgorithm(testTenantName, signatureAlgorithm); Assert.assertEquals(signatureAlgorithm, idmClient.getTenantSignatureAlgorithm(testTenantName)); final String brandName = "Acme single sign-on"; idmClient.setBrandName(testTenantName, brandName); String retrievedBrand = idmClient.getBrandName(testTenantName); Assert.assertEquals(brandName, retrievedBrand); String testLogonBannerTitle = "Acme logon banner"; String testLogonBannerContent = "This is a disclaimer."; idmClient.setLogonBannerTitle(testTenantName, testLogonBannerTitle); idmClient.setLogonBannerContent(testTenantName, testLogonBannerContent); idmClient.setLogonBannerCheckboxFlag(testTenantName, true); String retrievedLogonBannerContent = idmClient.getLogonBannerContent(testTenantName); String retrievedLogonBannerTitle = idmClient.getLogonBannerTitle(testTenantName); Assert.assertEquals(retrievedLogonBannerTitle, testLogonBannerTitle); Assert.assertEquals(retrievedLogonBannerContent, testLogonBannerContent); Assert.assertTrue(idmClient.getLogonBannerCheckboxFlag(testTenantName)); final String entityId = "EntityId"; idmClient.setEntityID(testTenantName, entityId); Assert.assertEquals(entityId, idmClient.getEntityID(testTenantName)); final String alias = "vsphere.local"; idmClient.setLocalIDPAlias(testTenantName, alias); Assert.assertEquals(alias, idmClient.getLocalIDPAlias(testTenantName)); idmClient.setLocalIDPAlias(testTenantName, null); Assert.assertNull(idmClient.getLocalIDPAlias(testTenantName)); Assert.assertTrue(idmClient.isTenantIDPSelectionEnabled(testTenantName)); boolean enableIdpSelection = false; idmClient.setTenantIDPSelectionEnabled(testTenantName, enableIdpSelection); Assert.assertFalse(idmClient.isTenantIDPSelectionEnabled(testTenantName)); PasswordExpiration expiration = new PasswordExpiration(true, "a@abc.com", "Password Expired", new int[] { 1, 3, 5 }); idmClient.updatePasswordExpirationConfiguration(testTenantName, expiration); PasswordExpiration expiration1 = idmClient.getPasswordExpirationConfiguration(testTenantName); Assert.assertNotNull(expiration1); Assert.assertEquals(expiration.isEmailNotificationEnabled(), expiration1.isEmailNotificationEnabled()); Assert.assertEquals(expiration.getEmailFrom(), expiration1.getEmailFrom()); Assert.assertEquals(expiration.getEmailSubject(), expiration1.getEmailSubject()); int[] days = expiration1.getNotificationDays(); Assert.assertNotNull(days); Assert.assertEquals(expiration.getNotificationDays().length, days.length); int i = 0; for (int day : expiration.getNotificationDays()) { Assert.assertEquals(day, days[i]); i++; } // idm cert KeyStore ks = loadKeyStore(CFG_KEY_STS_KEYSTORE, CFG_KEY_STS_KEYSTORE_PASSWORD); X509Certificate cert = (X509Certificate) ks.getCertificate(props.getProperty(CFG_KEY_STS_KEY_ALIAS)); // add cert of type 'LDAP_TRUSTED_CERT' idmClient.addCertificate(testTenantName, cert, CertificateType.LDAP_TRUSTED_CERT); Collection<Certificate> idmCertificates = idmClient.getAllCertificates(testTenantName, CertificateType.LDAP_TRUSTED_CERT); Assert.assertNotNull(idmCertificates); Assert.assertEquals(1, idmCertificates.size()); X509Certificate cert1 = (X509Certificate) ks.getCertificate(props.getProperty(CFG_KEY_STS_KEY_ALIAS1)); // add cert of type 'STS_TRUSTED_CERT' idmClient.addCertificate(testTenantName, cert1, CertificateType.STS_TRUST_CERT); idmCertificates = idmClient.getAllCertificates(testTenantName, CertificateType.STS_TRUST_CERT); Assert.assertNotNull(idmCertificates); Assert.assertEquals(1, idmCertificates.size()); // delete cert of type 'LDAP_TRUSTED_CERT' idmClient.deleteCertificate(testTenantName, CertificateUtil.generateFingerprint(cert), CertificateType.LDAP_TRUSTED_CERT); idmCertificates = idmClient.getAllCertificates(testTenantName, CertificateType.LDAP_TRUSTED_CERT); Assert.assertEquals(true, ((idmCertificates == null) || (idmCertificates.size() == 0))); // should still have 'sts' trust cert idmCertificates = idmClient.getAllCertificates(testTenantName, CertificateType.STS_TRUST_CERT); Assert.assertNotNull(idmCertificates); Assert.assertEquals(1, idmCertificates.size()); // delete cert of type 'STS_TRUSTED_CERT' idmClient.deleteCertificate(testTenantName, CertificateUtil.generateFingerprint(cert1), CertificateType.STS_TRUST_CERT); idmCertificates = idmClient.getAllCertificates(testTenantName, CertificateType.STS_TRUST_CERT); Assert.assertEquals(true, ((idmCertificates == null) || (idmCertificates.size() == 0))); // default provider final String adProviderName = props.getProperty(CFG_KEY_IDM_TENANT_1_AD_PROVIDER_DOMAIN_NAME); Assert.assertNotNull(adProviderName); final String adProviderAlias = props.getProperty(CFG_KEY_IDM_TENANT_1_AD_PROVIDER_ALIAS); Assert.assertNotNull(adProviderAlias); IdentityStoreData adStore = IdmClientTestUtil.prepareADIdentityStore(idmClient, true); IIdentityStoreData store = idmClient.getProvider(testTenantName, adProviderName); // check before create if (store == null) { idmClient.addProvider(testTenantName, adStore); } // set using providerName idmClient.setDefaultProviders(testTenantName, Arrays.asList(new String[] { adProviderName })); Collection<String> providers = idmClient.getDefaultProviders(testTenantName); Assert.assertNotNull(providers); Assert.assertEquals(1, providers.size()); Assert.assertEquals(adProviderName, providers.iterator().next()); idmClient.deleteProvider(testTenantName, adProviderName); providers = idmClient.getDefaultProviders(testTenantName); Assert.assertTrue(((providers == null) || (providers.size() == 0))); store = idmClient.getProvider(testTenantName, adProviderName); // check before create if (store == null) { idmClient.addProvider(testTenantName, adStore); } // set using provider Alias Name idmClient.setDefaultProviders(testTenantName, Arrays.asList(new String[] { adProviderAlias })); providers = idmClient.getDefaultProviders(testTenantName); Assert.assertNotNull(providers); Assert.assertEquals(1, providers.size()); Assert.assertEquals(adProviderAlias, providers.iterator().next()); idmClient.setDefaultProviders(testTenantName, null); providers = idmClient.getDefaultProviders(testTenantName); Assert.assertTrue(((providers == null) || (providers.size() == 0))); idmClient.deleteProvider(testTenantName, adProviderAlias); providers = idmClient.getDefaultProviders(testTenantName); Assert.assertTrue(((providers == null) || (providers.size() == 0))); // default tenant String defaultTenant = idmClient.getDefaultTenant(); idmClient.setDefaultTenant(testTenantName); Assert.assertEquals(testTenantName, idmClient.getDefaultTenant()); idmClient.deleteTenant(testTenantName); String defTenant = idmClient.getDefaultTenant(); Assert.assertTrue((defTenant == null) || (defTenant.isEmpty())); if ((defaultTenant != testTenantName) && (defaultTenant != null) && (defaultTenant.isEmpty() == false)) { idmClient.setDefaultTenant(defaultTenant); Assert.assertEquals(defaultTenant, idmClient.getDefaultTenant()); } }