-
Notifications
You must be signed in to change notification settings - Fork 321
Expand file tree
/
Copy pathStacksTest.java
More file actions
44 lines (39 loc) · 1.56 KB
/
StacksTest.java
File metadata and controls
44 lines (39 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package org.cloudfoundry.operations;
import java.time.Duration;
import org.cloudfoundry.AbstractIntegrationTest;
import org.cloudfoundry.operations.stacks.GetStackRequest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
class StacksTest extends AbstractIntegrationTest {
@Autowired private CloudFoundryOperations cloudFoundryOperations;
@Autowired private Mono<String> stackName;
@Test
public void create() {
this.stackName
.flatMap(
name ->
this.cloudFoundryOperations
.stacks()
.get(GetStackRequest.builder().name(name).build()))
.as(StepVerifier::create)
.expectNextMatches(
s -> s.getDescription().contains("Cloud Foundry Linux-based filesystem"))
.expectComplete()
.verify(Duration.ofMinutes(5));
}
@Test
public void list() {
String stackName = this.stackName.block();
this.cloudFoundryOperations
.stacks()
.list()
.filter(s -> s.getName().equals(stackName))
.as(StepVerifier::create)
.expectNextMatches(
s -> s.getDescription().startsWith("Cloud Foundry Linux-based filesystem"))
.expectComplete()
.verify(Duration.ofMinutes(5));
}
}