Skip to content

Commit 2d2230f

Browse files
issue-1168 running spotless:apply to fix formatting issues
1 parent a1e23cb commit 2d2230f

File tree

2 files changed

+67
-26
lines changed

2 files changed

+67
-26
lines changed

integration-test/src/test/java/org/cloudfoundry/NameFactory.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ default String getOrganizationQuotaName() {
200200
return getName(ORGANIZATION_QUOTA_PREFIX);
201201
}
202202

203-
204203
/**
205204
* Creates a password
206205
*

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

Lines changed: 67 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
package org.cloudfoundry.client.v3;
1818

19+
import static org.assertj.core.api.Assertions.assertThat;
20+
21+
import java.time.Duration;
1922
import org.cloudfoundry.AbstractIntegrationTest;
2023
import org.cloudfoundry.CloudFoundryVersion;
2124
import org.cloudfoundry.IfCloudFoundryVersion;
@@ -39,23 +42,23 @@
3942
import reactor.core.publisher.Mono;
4043
import reactor.test.StepVerifier;
4144

42-
import java.time.Duration;
43-
44-
import static org.assertj.core.api.Assertions.assertThat;
45-
4645
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
4746
public final class OrganizationQuotaDefinitionsTest extends AbstractIntegrationTest {
4847

49-
@Autowired
50-
private CloudFoundryClient cloudFoundryClient;
48+
@Autowired private CloudFoundryClient cloudFoundryClient;
5149

5250
@Test
5351
public void create() {
5452
String organizationQuotaName = this.nameFactory.getOrganizationQuotaName();
5553
this.cloudFoundryClient
5654
.organizationQuotaDefinitionsV3()
57-
.create(CreateOrganizationQuotaDefinitionRequest.builder().name(organizationQuotaName).build())
58-
.thenMany(requestListOrganizationQuotas(this.cloudFoundryClient, organizationQuotaName))
55+
.create(
56+
CreateOrganizationQuotaDefinitionRequest.builder()
57+
.name(organizationQuotaName)
58+
.build())
59+
.thenMany(
60+
requestListOrganizationQuotas(
61+
this.cloudFoundryClient, organizationQuotaName))
5962
.single()
6063
.as(StepVerifier::create)
6164
.expectNextCount(1)
@@ -76,15 +79,18 @@ public void delete() {
7679
.organizationQuotaDefinitionsV3()
7780
.delete(
7881
DeleteOrganizationQuotaDefinitionRequest.builder()
79-
.organizationQuotaDefinitionId(organizationId)
82+
.organizationQuotaDefinitionId(
83+
organizationId)
8084
.build())
8185
.flatMap(
8286
job ->
8387
JobUtils.waitForCompletion(
8488
this.cloudFoundryClient,
8589
Duration.ofMinutes(5),
8690
job)))
87-
.thenMany(requestListOrganizationQuotas(this.cloudFoundryClient, organizationQuotaName))
91+
.thenMany(
92+
requestListOrganizationQuotas(
93+
this.cloudFoundryClient, organizationQuotaName))
8894
.as(StepVerifier::create)
8995
.expectComplete()
9096
.verify(Duration.ofMinutes(5));
@@ -101,7 +107,8 @@ public void get() {
101107
.organizationQuotaDefinitionsV3()
102108
.get(
103109
GetOrganizationQuotaDefinitionRequest.builder()
104-
.organizationQuotaDefinitionId(organizationQuotaId)
110+
.organizationQuotaDefinitionId(
111+
organizationQuotaId)
105112
.build()))
106113
.map(GetOrganizationQuotaDefinitionResponse::getName)
107114
.as(StepVerifier::create)
@@ -123,7 +130,8 @@ public void list() {
123130
this.cloudFoundryClient
124131
.organizationQuotaDefinitionsV3()
125132
.list(
126-
ListOrganizationQuotaDefinitionsRequest.builder()
133+
ListOrganizationQuotaDefinitionsRequest
134+
.builder()
127135
.page(page)
128136
.build())))
129137
.filter(resource -> organizationQuotaName.equals(resource.getName()))
@@ -138,7 +146,7 @@ public void list() {
138146
@Test
139147
public void update() {
140148
String organizationQuotaName = this.nameFactory.getOrganizationQuotaName();
141-
int totalMemoryLimit = 64 * 1024; // 64 GB
149+
int totalMemoryLimit = 64 * 1024; // 64 GB
142150

143151
createOrganizationQuotaId(this.cloudFoundryClient, organizationQuotaName)
144152
.flatMap(
@@ -147,18 +155,44 @@ public void update() {
147155
.organizationQuotaDefinitionsV3()
148156
.update(
149157
UpdateOrganizationQuotaDefinitionRequest.builder()
150-
.organizationQuotaDefinitionId(organizationQuotaId)
151-
.apps(Apps.builder().totalMemoryInMb(totalMemoryLimit).build())
152-
.routes(Routes.builder().totalRoutes(100).build())
153-
.services(Services.builder().isPaidServicesAllowed(true).totalServiceInstances(100).build())
158+
.organizationQuotaDefinitionId(
159+
organizationQuotaId)
160+
.apps(
161+
Apps.builder()
162+
.totalMemoryInMb(
163+
totalMemoryLimit)
164+
.build())
165+
.routes(
166+
Routes.builder()
167+
.totalRoutes(100)
168+
.build())
169+
.services(
170+
Services.builder()
171+
.isPaidServicesAllowed(true)
172+
.totalServiceInstances(100)
173+
.build())
154174
.build()))
155-
.thenMany(requestListOrganizationQuotas(this.cloudFoundryClient, organizationQuotaName))
175+
.thenMany(
176+
requestListOrganizationQuotas(
177+
this.cloudFoundryClient, organizationQuotaName))
156178
.as(StepVerifier::create)
157179
.consumeNextWith(
158180
organizationQuotaDefinitionResource -> {
159-
assertThat(organizationQuotaDefinitionResource.getApps().getTotalMemoryInMb()).isEqualTo(totalMemoryLimit);
160-
assertThat(organizationQuotaDefinitionResource.getRoutes().getTotalRoutes()).isEqualTo(100);
161-
assertThat(organizationQuotaDefinitionResource.getServices().getTotalServiceInstances()).isEqualTo(100);
181+
assertThat(
182+
organizationQuotaDefinitionResource
183+
.getApps()
184+
.getTotalMemoryInMb())
185+
.isEqualTo(totalMemoryLimit);
186+
assertThat(
187+
organizationQuotaDefinitionResource
188+
.getRoutes()
189+
.getTotalRoutes())
190+
.isEqualTo(100);
191+
assertThat(
192+
organizationQuotaDefinitionResource
193+
.getServices()
194+
.getTotalServiceInstances())
195+
.isEqualTo(100);
162196
})
163197
.expectComplete()
164198
.verify(Duration.ofMinutes(5));
@@ -175,7 +209,10 @@ private static Mono<String> createOrganizationQuotaId(
175209
private static Mono<String> getOrganizationQuotaId(
176210
CloudFoundryClient cloudFoundryClient, String organizationQuotaName) {
177211
return requestListOrganizationQuotas(cloudFoundryClient, organizationQuotaName)
178-
.filter(organizationQuotaDefinitionResource -> organizationQuotaName.equals(organizationQuotaDefinitionResource.getName()))
212+
.filter(
213+
organizationQuotaDefinitionResource ->
214+
organizationQuotaName.equals(
215+
organizationQuotaDefinitionResource.getName()))
179216
.single()
180217
.map(OrganizationQuotaDefinitionResource::getId);
181218
}
@@ -184,7 +221,10 @@ private static Mono<CreateOrganizationQuotaDefinitionResponse> requestCreateOrga
184221
CloudFoundryClient cloudFoundryClient, String organizationQuotaName) {
185222
return cloudFoundryClient
186223
.organizationQuotaDefinitionsV3()
187-
.create(CreateOrganizationQuotaDefinitionRequest.builder().name(organizationQuotaName).build());
224+
.create(
225+
CreateOrganizationQuotaDefinitionRequest.builder()
226+
.name(organizationQuotaName)
227+
.build());
188228
}
189229

190230
private static Flux<OrganizationQuotaDefinitionResource> requestListOrganizationQuotas(
@@ -200,7 +240,8 @@ private static Flux<OrganizationQuotaDefinitionResource> requestListOrganization
200240
.build()));
201241
}
202242

203-
private static void deleteOrganizationQuotaId(CloudFoundryClient cloudFoundryClient, String organizationQuotaName) {
243+
private static void deleteOrganizationQuotaId(
244+
CloudFoundryClient cloudFoundryClient, String organizationQuotaName) {
204245

205246
getOrganizationQuotaId(cloudFoundryClient, organizationQuotaName)
206247
.flatMap(
@@ -209,7 +250,8 @@ private static void deleteOrganizationQuotaId(CloudFoundryClient cloudFoundryCli
209250
.organizationQuotaDefinitionsV3()
210251
.delete(
211252
DeleteOrganizationQuotaDefinitionRequest.builder()
212-
.organizationQuotaDefinitionId(organizationId)
253+
.organizationQuotaDefinitionId(
254+
organizationId)
213255
.build())
214256
.flatMap(
215257
job ->

0 commit comments

Comments
 (0)