Skip to content

Commit 628e681

Browse files
committed
More CI Fixes
This commit further tweaks what versions of Cloud Foundry some tests will work against, and improves the resilience of some tests. Signed-off-by: Paul Harris <harrisp@vmware.com>
1 parent b274134 commit 628e681

2 files changed

Lines changed: 43 additions & 39 deletions

File tree

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

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void listApplicationRoutesByDomain() {
107107
.flatMap(function((domainId, spaceId) -> Mono.zip(
108108
createApplicationId(this.cloudFoundryClient, applicationName, spaceId),
109109
Mono.just(domainId),
110-
createRouteId(this.cloudFoundryClient, domainId, "listByDomain", spaceId)
110+
createRouteId(this.cloudFoundryClient, domainId, "listApplicationRoutesByDomain", spaceId)
111111
)))
112112
.delayUntil(function((applicationId, domainId, routeId) -> requestReplaceDestinations(this.cloudFoundryClient, applicationId, routeId)))
113113
.flatMapMany(function((applicationId, domainId, ignore) -> PaginationUtils.requestClientV3Resources(page ->
@@ -120,7 +120,7 @@ public void listApplicationRoutesByDomain() {
120120
.map(RouteResource::getMetadata)
121121
.map(Metadata::getLabels)
122122
.as(StepVerifier::create)
123-
.expectNext(Collections.singletonMap("test-listByDomain-key", "test-listByDomain-value"))
123+
.expectNext(Collections.singletonMap("test-listApplicationRoutesByDomain-key", "test-listApplicationRoutesByDomain-value"))
124124
.expectComplete()
125125
.verify(Duration.ofMinutes(5));
126126
}
@@ -139,7 +139,7 @@ public void listApplicationRoutesByHost() {
139139
))
140140
.flatMap(function((domainId, spaceId) -> Mono.zip(
141141
createApplicationId(this.cloudFoundryClient, applicationName, spaceId),
142-
createRouteId(this.cloudFoundryClient, domainId, hostName, "listByHost", null, null, spaceId)
142+
createRouteId(this.cloudFoundryClient, domainId, hostName, "listApplicationRoutesByHost", null, null, spaceId)
143143
)))
144144
.flatMap(function((applicationId, routeId) -> requestReplaceDestinations(this.cloudFoundryClient, applicationId, routeId)
145145
.thenReturn(applicationId)))
@@ -150,11 +150,11 @@ public void listApplicationRoutesByHost() {
150150
.host(hostName)
151151
.page(page)
152152
.build())))
153-
.filter(route -> route.getMetadata().getLabels().containsKey("test-listByHost-key"))
153+
.filter(route -> route.getMetadata().getLabels().containsKey("test-listApplicationRoutesByHost-key"))
154154
.map(RouteResource::getMetadata)
155155
.map(Metadata::getLabels)
156156
.as(StepVerifier::create)
157-
.expectNext(Collections.singletonMap("test-listByHost-key", "test-listByHost-value"))
157+
.expectNext(Collections.singletonMap("test-listApplicationRoutesByHost-key", "test-listApplicationRoutesByHost-value"))
158158
.expectComplete()
159159
.verify(Duration.ofMinutes(5));
160160
}
@@ -164,29 +164,30 @@ public void listApplicationRoutesByHost() {
164164
public void listApplicationRoutesByLabelSelector() {
165165
String applicationName = this.nameFactory.getApplicationName();
166166
String domainName = this.nameFactory.getDomainName();
167+
String spaceName = this.nameFactory.getSpaceName();
167168

168169
this.organizationId
169170
.flatMap(organizationId -> Mono.zip(
170171
createDomainId(this.cloudFoundryClient, domainName, organizationId),
171-
this.spaceId
172+
createSpaceId(this.cloudFoundryClient, organizationId, spaceName)
172173
))
173174
.flatMap(function((domainId, spaceId) -> Mono.zip(
174175
createApplicationId(this.cloudFoundryClient, applicationName, spaceId),
175-
createRouteId(this.cloudFoundryClient, domainId, "listByLabelSelector", spaceId)
176+
createRouteId(this.cloudFoundryClient, domainId, "listApplicationRoutesByLabelSelector", spaceId)
176177
)))
177178
.flatMapMany(function((applicationId, routeId) -> requestReplaceDestinations(this.cloudFoundryClient, applicationId, routeId)
178179
.thenReturn(applicationId)))
179180
.flatMap(applicationId -> PaginationUtils.requestClientV3Resources(page ->
180181
this.cloudFoundryClient.applicationsV3()
181182
.listRoutes(ListApplicationRoutesRequest.builder()
182183
.applicationId(applicationId)
183-
.labelSelector("test-listByLabelSelector-key=test-listByLabelSelector-value")
184+
.labelSelector("test-listApplicationRoutesByLabelSelector-key=test-listApplicationRoutesByLabelSelector-value")
184185
.page(page)
185186
.build())))
186187
.map(RouteResource::getMetadata)
187188
.map(Metadata::getLabels)
188189
.as(StepVerifier::create)
189-
.expectNext(Collections.singletonMap("test-listByLabelSelector-key", "test-listByLabelSelector-value"))
190+
.expectNext(Collections.singletonMap("test-listApplicationRoutesByLabelSelector-key", "test-listApplicationRoutesByLabelSelector-value"))
190191
.expectComplete()
191192
.verify(Duration.ofMinutes(5));
192193
}
@@ -209,7 +210,7 @@ public void listApplicationRoutesByOrganizationId() {
209210
.flatMap(function((domainId, organizationId, spaceId) -> Mono.zip(
210211
createApplicationId(this.cloudFoundryClient, applicationName, spaceId),
211212
Mono.just(organizationId),
212-
createRouteId(this.cloudFoundryClient, domainId, "listByOrganizationId", spaceId)
213+
createRouteId(this.cloudFoundryClient, domainId, "listApplicationRoutesByOrganizationId", spaceId)
213214
)))
214215
.delayUntil(function((applicationId, organizationId, routeId) -> requestReplaceDestinations(this.cloudFoundryClient, applicationId, routeId)))
215216
.flatMapMany(function((applicationId, organizationId, ignore) -> PaginationUtils.requestClientV3Resources(page ->
@@ -222,7 +223,7 @@ public void listApplicationRoutesByOrganizationId() {
222223
.map(RouteResource::getMetadata)
223224
.map(Metadata::getLabels)
224225
.as(StepVerifier::create)
225-
.expectNext(Collections.singletonMap("test-listByOrganizationId-key", "test-listByOrganizationId-value"))
226+
.expectNext(Collections.singletonMap("test-listApplicationRoutesByOrganizationId-key", "test-listApplicationRoutesByOrganizationId-value"))
226227
.expectComplete()
227228
.verify(Duration.ofMinutes(5));
228229
}
@@ -242,7 +243,7 @@ public void listApplicationRoutesByPath() {
242243

243244
.flatMap(function((domainId, spaceId) -> Mono.zip(
244245
createApplicationId(this.cloudFoundryClient, applicationName, spaceId),
245-
createRouteId(this.cloudFoundryClient, domainId, null, "listByPath", path, null, spaceId)
246+
createRouteId(this.cloudFoundryClient, domainId, null, "listApplicationRoutesByPath", path, null, spaceId)
246247
)))
247248
.flatMapMany(function((applicationId, routeId) -> requestReplaceDestinations(this.cloudFoundryClient, applicationId, routeId)
248249
.thenReturn(applicationId)))
@@ -253,11 +254,11 @@ public void listApplicationRoutesByPath() {
253254
.path(path)
254255
.page(page)
255256
.build())))
256-
.filter(route -> route.getMetadata().getLabels().containsKey("test-listByPath-key"))
257+
.filter(route -> route.getMetadata().getLabels().containsKey("test-listApplicationRoutesByPath-key"))
257258
.map(RouteResource::getMetadata)
258259
.map(Metadata::getLabels)
259260
.as(StepVerifier::create)
260-
.expectNext(Collections.singletonMap("test-listByPath-key", "test-listByPath-value"))
261+
.expectNext(Collections.singletonMap("test-listApplicationRoutesByPath-key", "test-listApplicationRoutesByPath-value"))
261262
.expectComplete()
262263
.verify(Duration.ofMinutes(5));
263264
}
@@ -278,7 +279,7 @@ public void listApplicationRoutesByPort() {
278279

279280
.flatMap(function((domainId, spaceId) -> Mono.zip(
280281
createApplicationId(this.cloudFoundryClient, applicationName, spaceId),
281-
createRouteId(this.cloudFoundryClient, domainId, null, "listByPort", null, port, spaceId)
282+
createRouteId(this.cloudFoundryClient, domainId, null, "listApplicationRoutesByPort", null, port, spaceId)
282283
)))
283284
.flatMapMany(function((applicationId, routeId) -> requestReplaceDestinations(this.cloudFoundryClient, applicationId, routeId)
284285
.thenReturn(applicationId)))
@@ -289,11 +290,11 @@ public void listApplicationRoutesByPort() {
289290
.port(port)
290291
.page(page)
291292
.build())))
292-
.filter(route -> route.getMetadata().getLabels().containsKey("test-listByPort-key"))
293+
.filter(route -> route.getMetadata().getLabels().containsKey("test-listApplicationRoutesByPort-key"))
293294
.map(RouteResource::getMetadata)
294295
.map(Metadata::getLabels)
295296
.as(StepVerifier::create)
296-
.expectNext(Collections.singletonMap("test-listByPort-key", "test-listByPort-value"))
297+
.expectNext(Collections.singletonMap("test-listApplicationRoutesByPort-key", "test-listApplicationRoutesByPort-value"))
297298
.expectComplete()
298299
.verify(Duration.ofMinutes(5));
299300
}
@@ -303,16 +304,17 @@ public void listApplicationRoutesByPort() {
303304
public void listApplicationRoutesBySpaceId() {
304305
String applicationName = this.nameFactory.getApplicationName();
305306
String domainName = this.nameFactory.getDomainName();
307+
String spaceName = this.nameFactory.getSpaceName();
306308

307309
this.organizationId
308310
.flatMap(organizationId -> Mono.zip(
309311
createDomainId(this.cloudFoundryClient, domainName, organizationId),
310-
this.spaceId
312+
createSpaceId(this.cloudFoundryClient, organizationId, spaceName)
311313
))
312314

313315
.flatMap(function((domainId, spaceId) -> Mono.zip(
314316
createApplicationId(this.cloudFoundryClient, applicationName, spaceId),
315-
createRouteId(this.cloudFoundryClient, domainId, "listBySpaceId", spaceId),
317+
createRouteId(this.cloudFoundryClient, domainId, "listApplicationRoutesBySpaceId", spaceId),
316318
Mono.just(spaceId)
317319
)))
318320
.delayUntil(function((applicationId, routeId, spaceId) -> requestReplaceDestinations(this.cloudFoundryClient, applicationId, routeId)
@@ -324,11 +326,11 @@ public void listApplicationRoutesBySpaceId() {
324326
.page(page)
325327
.spaceId(spaceId)
326328
.build()))))
327-
.filter(route -> route.getMetadata().getLabels().containsKey("test-listBySpaceId-key"))
329+
.filter(route -> route.getMetadata().getLabels().containsKey("test-listApplicationRoutesBySpaceId-key"))
328330
.map(RouteResource::getMetadata)
329331
.map(Metadata::getLabels)
330332
.as(StepVerifier::create)
331-
.expectNext(Collections.singletonMap("test-listBySpaceId-key", "test-listBySpaceId-value"))
333+
.expectNext(Collections.singletonMap("test-listApplicationRoutesBySpaceId-key", "test-listApplicationRoutesBySpaceId-value"))
332334
.expectComplete()
333335
.verify(Duration.ofMinutes(5));
334336
}

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

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public final class RoutesTest extends AbstractIntegrationTest {
7171
@Autowired
7272
private Mono<String> spaceId;
7373

74-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
74+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
7575
@Test
7676
public void create() {
7777
String domainName = this.nameFactory.getDomainName();
@@ -110,7 +110,7 @@ public void create() {
110110
.verify(Duration.ofMinutes(5));
111111
}
112112

113-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
113+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
114114
@Test
115115
public void get() {
116116
String domainName = this.nameFactory.getDomainName();
@@ -134,7 +134,7 @@ public void get() {
134134
.verify(Duration.ofMinutes(5));
135135
}
136136

137-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
137+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
138138
@Test
139139
public void insertDestinations() {
140140
String applicationName = this.nameFactory.getApplicationName();
@@ -171,7 +171,7 @@ public void insertDestinations() {
171171
.verify(Duration.ofMinutes(5));
172172
}
173173

174-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
174+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
175175
@Test
176176
public void list() {
177177
String domainName = this.nameFactory.getDomainName();
@@ -228,7 +228,7 @@ public void listByApplicationId() {
228228
.verify(Duration.ofMinutes(5));
229229
}
230230

231-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
231+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
232232
@Test
233233
public void listByDomain() {
234234
String domainName = this.nameFactory.getDomainName();
@@ -254,7 +254,7 @@ public void listByDomain() {
254254
.verify(Duration.ofMinutes(5));
255255
}
256256

257-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
257+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
258258
@Test
259259
public void listByHost() {
260260
String domainName = this.nameFactory.getDomainName();
@@ -281,15 +281,16 @@ public void listByHost() {
281281
.verify(Duration.ofMinutes(5));
282282
}
283283

284-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
284+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
285285
@Test
286286
public void listByLabelSelector() {
287287
String domainName = this.nameFactory.getDomainName();
288+
String spaceName = this.nameFactory.getSpaceName();
288289

289290
this.organizationId
290291
.flatMap(organizationId -> Mono.zip(
291292
createDomainId(this.cloudFoundryClient, domainName, organizationId),
292-
this.spaceId
293+
createSpaceId(this.cloudFoundryClient, organizationId, spaceName)
293294
))
294295
.flatMap(function((domainId, spaceId) -> requestCreateRoute(this.cloudFoundryClient, domainId, "listByLabelSelector", spaceId)
295296
.thenReturn(domainId)))
@@ -307,7 +308,7 @@ public void listByLabelSelector() {
307308
.verify(Duration.ofMinutes(5));
308309
}
309310

310-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
311+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
311312
@Test
312313
public void listByOrganizationId() {
313314
String domainName = this.nameFactory.getDomainName();
@@ -336,7 +337,7 @@ public void listByOrganizationId() {
336337
.verify(Duration.ofMinutes(5));
337338
}
338339

339-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
340+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
340341
@Test
341342
public void listByPath() {
342343
String domainName = this.nameFactory.getDomainName();
@@ -389,15 +390,16 @@ public void listByPort() {
389390
.verify(Duration.ofMinutes(5));
390391
}
391392

392-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
393+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
393394
@Test
394395
public void listBySpaceId() {
395396
String domainName = this.nameFactory.getDomainName();
397+
String spaceName = this.nameFactory.getSpaceName();
396398

397399
this.organizationId
398400
.flatMap(organizationId -> Mono.zip(
399401
createDomainId(this.cloudFoundryClient, domainName, organizationId),
400-
this.spaceId
402+
createSpaceId(this.cloudFoundryClient, organizationId, spaceName)
401403
))
402404
.flatMap(function((domainId, spaceId) -> createRouteId(this.cloudFoundryClient, domainId, "listBySpaceId", spaceId)
403405
.thenReturn(spaceId)))
@@ -416,7 +418,7 @@ public void listBySpaceId() {
416418
.verify(Duration.ofMinutes(5));
417419
}
418420

419-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
421+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
420422
@Test
421423
public void listDestinations() {
422424
String applicationName = this.nameFactory.getApplicationName();
@@ -451,7 +453,7 @@ public void listDestinations() {
451453
.verify(Duration.ofMinutes(5));
452454
}
453455

454-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
456+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
455457
@Test
456458
public void listDestinationsByApplicationId() {
457459
String applicationName = this.nameFactory.getApplicationName();
@@ -487,7 +489,7 @@ public void listDestinationsByApplicationId() {
487489
.verify(Duration.ofMinutes(5));
488490
}
489491

490-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
492+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
491493
@Test
492494
public void listDestinationsById() {
493495
String applicationName = this.nameFactory.getApplicationName();
@@ -523,7 +525,7 @@ public void listDestinationsById() {
523525
.verify(Duration.ofMinutes(5));
524526
}
525527

526-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
528+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
527529
@Test
528530
public void removeDestinations() {
529531
String applicationName = this.nameFactory.getApplicationName();
@@ -557,7 +559,7 @@ public void removeDestinations() {
557559
.verify(Duration.ofMinutes(5));
558560
}
559561

560-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
562+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
561563
@Test
562564
public void replaceDestinations() {
563565
String applicationName = this.nameFactory.getApplicationName();
@@ -594,7 +596,7 @@ public void replaceDestinations() {
594596
.verify(Duration.ofMinutes(5));
595597
}
596598

597-
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_8)
599+
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_9)
598600
@Test
599601
public void update() {
600602
String domainName = this.nameFactory.getDomainName();

0 commit comments

Comments
 (0)