Skip to content

Commit b274134

Browse files
committed
Merge branch 'fix-ci' into 3.x
2 parents 7f4cf2a + 8940067 commit b274134

1 file changed

Lines changed: 27 additions & 20 deletions

File tree

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

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public final class ApplicationsTest extends AbstractIntegrationTest {
6262
@Autowired
6363
private Mono<String> spaceId;
6464

65+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
6566
@Test
6667
public void listApplicationRoutes() {
6768
String applicationName = this.nameFactory.getApplicationName();
@@ -92,6 +93,7 @@ public void listApplicationRoutes() {
9293
.verify(Duration.ofMinutes(5));
9394
}
9495

96+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
9597
@Test
9698
public void listApplicationRoutesByDomain() {
9799
String applicationName = this.nameFactory.getApplicationName();
@@ -123,6 +125,7 @@ public void listApplicationRoutesByDomain() {
123125
.verify(Duration.ofMinutes(5));
124126
}
125127

128+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
126129
@Test
127130
public void listApplicationRoutesByHost() {
128131
String applicationName = this.nameFactory.getApplicationName();
@@ -156,6 +159,7 @@ public void listApplicationRoutesByHost() {
156159
.verify(Duration.ofMinutes(5));
157160
}
158161

162+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
159163
@Test
160164
public void listApplicationRoutesByLabelSelector() {
161165
String applicationName = this.nameFactory.getApplicationName();
@@ -187,6 +191,7 @@ public void listApplicationRoutesByLabelSelector() {
187191
.verify(Duration.ofMinutes(5));
188192
}
189193

194+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
190195
@Test
191196
public void listApplicationRoutesByOrganizationId() {
192197
String applicationName = this.nameFactory.getApplicationName();
@@ -222,6 +227,7 @@ public void listApplicationRoutesByOrganizationId() {
222227
.verify(Duration.ofMinutes(5));
223228
}
224229

230+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
225231
@Test
226232
public void listApplicationRoutesByPath() {
227233
String applicationName = this.nameFactory.getApplicationName();
@@ -256,10 +262,13 @@ public void listApplicationRoutesByPath() {
256262
.verify(Duration.ofMinutes(5));
257263
}
258264

265+
//TODO: Test has not been validated
266+
@IfCloudFoundryVersion(greaterThan = CloudFoundryVersion.PCF_2_9)
259267
@Test
260-
public void listApplicationRoutesBySpaceId() {
268+
public void listApplicationRoutesByPort() {
261269
String applicationName = this.nameFactory.getApplicationName();
262270
String domainName = this.nameFactory.getDomainName();
271+
Integer port = this.nameFactory.getPort();
263272

264273
this.organizationId
265274
.flatMap(organizationId -> Mono.zip(
@@ -269,34 +278,31 @@ public void listApplicationRoutesBySpaceId() {
269278

270279
.flatMap(function((domainId, spaceId) -> Mono.zip(
271280
createApplicationId(this.cloudFoundryClient, applicationName, spaceId),
272-
createRouteId(this.cloudFoundryClient, domainId, "listBySpaceId", spaceId),
273-
Mono.just(spaceId)
281+
createRouteId(this.cloudFoundryClient, domainId, null, "listByPort", null, port, spaceId)
274282
)))
275-
.delayUntil(function((applicationId, routeId, spaceId) -> requestReplaceDestinations(this.cloudFoundryClient, applicationId, routeId)
283+
.flatMapMany(function((applicationId, routeId) -> requestReplaceDestinations(this.cloudFoundryClient, applicationId, routeId)
276284
.thenReturn(applicationId)))
277-
.flatMapMany(function((applicationId, ignore, spaceId) -> PaginationUtils.requestClientV3Resources(page ->
285+
.flatMap(applicationId -> PaginationUtils.requestClientV3Resources(page ->
278286
this.cloudFoundryClient.applicationsV3()
279287
.listRoutes(ListApplicationRoutesRequest.builder()
280288
.applicationId(applicationId)
289+
.port(port)
281290
.page(page)
282-
.spaceId(spaceId)
283-
.build()))))
284-
.filter(route -> route.getMetadata().getLabels().containsKey("test-listBySpaceId-key"))
291+
.build())))
292+
.filter(route -> route.getMetadata().getLabels().containsKey("test-listByPort-key"))
285293
.map(RouteResource::getMetadata)
286294
.map(Metadata::getLabels)
287295
.as(StepVerifier::create)
288-
.expectNext(Collections.singletonMap("test-listBySpaceId-key", "test-listBySpaceId-value"))
296+
.expectNext(Collections.singletonMap("test-listByPort-key", "test-listByPort-value"))
289297
.expectComplete()
290298
.verify(Duration.ofMinutes(5));
291299
}
292300

293-
//TODO: Test has not been validated
294-
@IfCloudFoundryVersion(greaterThan = CloudFoundryVersion.PCF_2_9)
301+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
295302
@Test
296-
public void listByPort() {
303+
public void listApplicationRoutesBySpaceId() {
297304
String applicationName = this.nameFactory.getApplicationName();
298305
String domainName = this.nameFactory.getDomainName();
299-
Integer port = this.nameFactory.getPort();
300306

301307
this.organizationId
302308
.flatMap(organizationId -> Mono.zip(
@@ -306,22 +312,23 @@ public void listByPort() {
306312

307313
.flatMap(function((domainId, spaceId) -> Mono.zip(
308314
createApplicationId(this.cloudFoundryClient, applicationName, spaceId),
309-
createRouteId(this.cloudFoundryClient, domainId, null, "listByPort", null, port, spaceId)
315+
createRouteId(this.cloudFoundryClient, domainId, "listBySpaceId", spaceId),
316+
Mono.just(spaceId)
310317
)))
311-
.flatMapMany(function((applicationId, routeId) -> requestReplaceDestinations(this.cloudFoundryClient, applicationId, routeId)
318+
.delayUntil(function((applicationId, routeId, spaceId) -> requestReplaceDestinations(this.cloudFoundryClient, applicationId, routeId)
312319
.thenReturn(applicationId)))
313-
.flatMap(applicationId -> PaginationUtils.requestClientV3Resources(page ->
320+
.flatMapMany(function((applicationId, ignore, spaceId) -> PaginationUtils.requestClientV3Resources(page ->
314321
this.cloudFoundryClient.applicationsV3()
315322
.listRoutes(ListApplicationRoutesRequest.builder()
316323
.applicationId(applicationId)
317-
.port(port)
318324
.page(page)
319-
.build())))
320-
.filter(route -> route.getMetadata().getLabels().containsKey("test-listByPort-key"))
325+
.spaceId(spaceId)
326+
.build()))))
327+
.filter(route -> route.getMetadata().getLabels().containsKey("test-listBySpaceId-key"))
321328
.map(RouteResource::getMetadata)
322329
.map(Metadata::getLabels)
323330
.as(StepVerifier::create)
324-
.expectNext(Collections.singletonMap("test-listByPort-key", "test-listByPort-value"))
331+
.expectNext(Collections.singletonMap("test-listBySpaceId-key", "test-listBySpaceId-value"))
325332
.expectComplete()
326333
.verify(Duration.ofMinutes(5));
327334
}

0 commit comments

Comments
 (0)