@Test public void shouldReturnDomains() throws OpenShiftException { // precondition DomainTestUtils.ensureHasDomain(user); // operation List<IDomain> domains = user.getDomains(); // verification assertThat(domains).isNotEmpty(); }
@Test public void shouldReturnId() throws OpenShiftException { // precondition DomainTestUtils.ensureHasDomain(user); // operation String id = user.getId(); // verification assertThat(id).isNotEmpty(); }
@Test public void shouldReturnThatHasNamedDomain() throws OpenShiftException { // precondition IDomain domain = DomainTestUtils.ensureHasDomain(user); // operation Boolean hasDomain = user.hasDomain(domain.getId()); // verification assertTrue(hasDomain); }
@Test public void shouldReturnDomainByName() throws OpenShiftException { // pre-condition IDomain domain = DomainTestUtils.ensureHasDomain(user); // operation IDomain domainByNamespace = user.getDomain(domain.getId()); // verification assertThat(domainByNamespace.getId()).isEqualTo(domain.getId()); }
@Test public void shouldGetDefaultDomain() throws OpenShiftException { // precondition DomainTestUtils.ensureHasDomain(user); // operation IDomain domain = user.getDefaultDomain(); // verification assertNotNull(domain); assertNotNull(domain.getId()); assertTrue(domain.getId().length() > 0); assertNotNull(domain.getSuffix()); assertTrue(domain.getSuffix().length() > 0); }
@Test public void shouldNoDefaultDomainAfterRefresh() throws OpenShiftException, FileNotFoundException, IOException { // precondition IDomain domain = DomainTestUtils.ensureHasDomain(user); assertNotNull(domain); IUser otherUser = new TestConnectionBuilder() .defaultCredentials() .disableSSLCertificateChecks() .create() .getUser(); DomainTestUtils.destroyAllDomains(otherUser); assertNull(otherUser.getDefaultDomain()); // operation user.refresh(); // verification assertNull(user.getDefaultDomain()); }