Skip to content

Commit 0db8b78

Browse files
enhancing SpaceQuotaDefinitionsTest integration test
1 parent d9e98fb commit 0db8b78

File tree

1 file changed

+34
-11
lines changed

1 file changed

+34
-11
lines changed

integration-test/src/test/java/org/cloudfoundry/client/v3/SpaceQuotaDefinitionsTest.java

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2021 the original author or authors.
2+
* Copyright 2013-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -66,17 +66,40 @@ public void create() {
6666
SpaceQuotaDefinitionRelationships spaceQuotaDefinitionRelationships =
6767
createSpaceQuotaDefinitionRelationships(organizationId);
6868

69+
Apps spaceQuotaAppLimits = Apps.builder()
70+
.perProcessMemoryInMb(1024)
71+
.totalMemoryInMb(2048)
72+
.logRateLimitInBytesPerSecond(0)
73+
.build();
74+
Services spaceQuotaServiceLimits = Services.builder().isPaidServicesAllowed(false).totalServiceInstances(10).build();
75+
Routes spaceQuotaRouteLimits = Routes.builder().totalRoutes(10).build();
76+
6977
this.cloudFoundryClient
7078
.spaceQuotaDefinitionsV3()
7179
.create(
7280
CreateSpaceQuotaDefinitionRequest.builder()
7381
.name(spaceQuotaName)
82+
.apps(spaceQuotaAppLimits)
83+
.services(spaceQuotaServiceLimits)
84+
.routes(spaceQuotaRouteLimits)
7485
.relationships(spaceQuotaDefinitionRelationships)
7586
.build())
7687
.thenMany(requestListSpaceQuotas(this.cloudFoundryClient, spaceQuotaName))
7788
.single()
7889
.as(StepVerifier::create)
79-
.expectNextCount(1)
90+
.assertNext(
91+
spaceQuotaDefinitionResource -> {
92+
assertThat(spaceQuotaDefinitionResource).isNotNull();
93+
assertThat(spaceQuotaDefinitionResource.getId()).isNotNull();
94+
assertThat(spaceQuotaDefinitionResource.getName())
95+
.isEqualTo(spaceQuotaName);
96+
assertThat(spaceQuotaDefinitionResource.getApps())
97+
.isEqualTo(spaceQuotaAppLimits);
98+
assertThat(spaceQuotaDefinitionResource.getServices())
99+
.isEqualTo(spaceQuotaServiceLimits);
100+
assertThat(spaceQuotaDefinitionResource.getRoutes())
101+
.isEqualTo(spaceQuotaRouteLimits);
102+
})
80103
.expectComplete()
81104
.verify(Duration.ofMinutes(5));
82105
}
@@ -155,19 +178,19 @@ public void update() {
155178
.consumeNextWith(
156179
organizationQuotaDefinitionResource -> {
157180
assertThat(
158-
organizationQuotaDefinitionResource
159-
.getApps()
160-
.getTotalMemoryInMb())
181+
organizationQuotaDefinitionResource
182+
.getApps()
183+
.getTotalMemoryInMb())
161184
.isEqualTo(totalMemoryLimit);
162185
assertThat(
163-
organizationQuotaDefinitionResource
164-
.getRoutes()
165-
.getTotalRoutes())
186+
organizationQuotaDefinitionResource
187+
.getRoutes()
188+
.getTotalRoutes())
166189
.isEqualTo(100);
167190
assertThat(
168-
organizationQuotaDefinitionResource
169-
.getServices()
170-
.getTotalServiceInstances())
191+
organizationQuotaDefinitionResource
192+
.getServices()
193+
.getTotalServiceInstances())
171194
.isEqualTo(100);
172195
})
173196
.expectComplete()

0 commit comments

Comments
 (0)