Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.cloudfoundry.client.v3.domains.GetDomainResponse;
import org.cloudfoundry.client.v3.domains.ListDomainsRequest;
import org.cloudfoundry.client.v3.domains.ListDomainsResponse;
import org.cloudfoundry.client.v3.domains.RouterGroup;
import org.cloudfoundry.client.v3.domains.ShareDomainRequest;
import org.cloudfoundry.client.v3.domains.ShareDomainResponse;
import org.cloudfoundry.client.v3.domains.UnshareDomainRequest;
Expand Down Expand Up @@ -279,6 +280,11 @@ void list() {
.updatedAt("2019-03-08T01:06:19Z")
.name("test-domain.com")
.isInternal(false)
.routerGroup(
RouterGroup.builder()
.id(
"5806148f-cce6-4d86-7fbd-aa269e3f6f3f")
.build())
.relationships(
DomainRelationships.builder()
.organization(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"updated_at": "2019-03-08T01:06:19Z",
"name": "test-domain.com",
"internal": false,
"router_group": { "guid": "5806148f-cce6-4d86-7fbd-aa269e3f6f3f" },
"metadata": {
"labels": {},
"annotations": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ public abstract class _RouterGroup {
* The id of the desired router group to route tcp traffic through
*/
@JsonProperty("guid")
public abstract List<String> getId();
public abstract String getId();

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@

import java.time.Duration;
import org.cloudfoundry.AbstractIntegrationTest;
import org.cloudfoundry.client.CloudFoundryClient;
import org.cloudfoundry.client.v2.ClientV2Exception;
import org.cloudfoundry.client.v3.domains.GetDomainRequest;
import org.cloudfoundry.operations.domains.CreateDomainRequest;
import org.cloudfoundry.operations.domains.CreateSharedDomainRequest;
import org.cloudfoundry.operations.domains.Domain;
import org.cloudfoundry.operations.domains.RouterGroup;
import org.cloudfoundry.operations.domains.ShareDomainRequest;
import org.cloudfoundry.operations.domains.UnshareDomainRequest;
import org.cloudfoundry.operations.organizations.CreateOrganizationRequest;
Expand All @@ -40,6 +43,7 @@ public final class DomainsTest extends AbstractIntegrationTest {
private static final String DEFAULT_ROUTER_GROUP = "default-tcp";

@Autowired private CloudFoundryOperations cloudFoundryOperations;
@Autowired private CloudFoundryClient cloudFoundryClient;

@Autowired private String organizationName;

Expand Down Expand Up @@ -112,9 +116,35 @@ public void createSharedTcp() {
.build())
.thenMany(requestListDomains(this.cloudFoundryOperations))
.filter(domain -> domainName.equals(domain.getName()))
.map(Domain::getType)
.as(StepVerifier::create)
.expectNext("tcp")
.expectNextMatches(domain -> domain.getType().equals("tcp"))
.expectComplete()
.verify(Duration.ofMinutes(5));

this.cloudFoundryOperations
.domains()
.list()
.filter(d -> d.getName().equals(domainName))
.single()
.flatMap(
d ->
this.cloudFoundryClient
.domainsV3()
.get(
GetDomainRequest.builder()
.domainId(d.getId())
.build()))
.map(d -> d.getRouterGroup().getId())
.flatMap(
id ->
this.cloudFoundryOperations
.domains()
.listRouterGroups()
.filter(rg -> rg.getId().equals(id))
.single())
.map(RouterGroup::getName)
.as(StepVerifier::create)
.expectNext(DEFAULT_ROUTER_GROUP)
.expectComplete()
.verify(Duration.ofMinutes(5));
}
Expand Down