|
1 | 1 | /* |
2 | | - * Copyright 2013-2021 the original author or authors. |
| 2 | + * Copyright 2013-2025 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -66,17 +66,40 @@ public void create() { |
66 | 66 | SpaceQuotaDefinitionRelationships spaceQuotaDefinitionRelationships = |
67 | 67 | createSpaceQuotaDefinitionRelationships(organizationId); |
68 | 68 |
|
| 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 | + |
69 | 77 | this.cloudFoundryClient |
70 | 78 | .spaceQuotaDefinitionsV3() |
71 | 79 | .create( |
72 | 80 | CreateSpaceQuotaDefinitionRequest.builder() |
73 | 81 | .name(spaceQuotaName) |
| 82 | + .apps(spaceQuotaAppLimits) |
| 83 | + .services(spaceQuotaServiceLimits) |
| 84 | + .routes(spaceQuotaRouteLimits) |
74 | 85 | .relationships(spaceQuotaDefinitionRelationships) |
75 | 86 | .build()) |
76 | 87 | .thenMany(requestListSpaceQuotas(this.cloudFoundryClient, spaceQuotaName)) |
77 | 88 | .single() |
78 | 89 | .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 | + }) |
80 | 103 | .expectComplete() |
81 | 104 | .verify(Duration.ofMinutes(5)); |
82 | 105 | } |
@@ -155,19 +178,19 @@ public void update() { |
155 | 178 | .consumeNextWith( |
156 | 179 | organizationQuotaDefinitionResource -> { |
157 | 180 | assertThat( |
158 | | - organizationQuotaDefinitionResource |
159 | | - .getApps() |
160 | | - .getTotalMemoryInMb()) |
| 181 | + organizationQuotaDefinitionResource |
| 182 | + .getApps() |
| 183 | + .getTotalMemoryInMb()) |
161 | 184 | .isEqualTo(totalMemoryLimit); |
162 | 185 | assertThat( |
163 | | - organizationQuotaDefinitionResource |
164 | | - .getRoutes() |
165 | | - .getTotalRoutes()) |
| 186 | + organizationQuotaDefinitionResource |
| 187 | + .getRoutes() |
| 188 | + .getTotalRoutes()) |
166 | 189 | .isEqualTo(100); |
167 | 190 | assertThat( |
168 | | - organizationQuotaDefinitionResource |
169 | | - .getServices() |
170 | | - .getTotalServiceInstances()) |
| 191 | + organizationQuotaDefinitionResource |
| 192 | + .getServices() |
| 193 | + .getTotalServiceInstances()) |
171 | 194 | .isEqualTo(100); |
172 | 195 | }) |
173 | 196 | .expectComplete() |
|
0 commit comments