Skip to content

Commit aaefd89

Browse files
committed
ci: fix missing dependencies in integration tests
1 parent 0649422 commit aaefd89

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,27 @@
1818

1919
import java.time.Duration;
2020
import org.cloudfoundry.AbstractIntegrationTest;
21+
import org.cloudfoundry.ApplicationUtils;
2122
import org.cloudfoundry.CloudFoundryVersion;
2223
import org.cloudfoundry.IfCloudFoundryVersion;
2324
import org.cloudfoundry.client.CloudFoundryClient;
2425
import org.cloudfoundry.client.v3.admin.ClearBuildpackCacheRequest;
2526
import org.cloudfoundry.util.JobUtils;
2627
import org.junit.jupiter.api.Test;
2728
import org.springframework.beans.factory.annotation.Autowired;
29+
30+
import reactor.core.publisher.Mono;
2831
import reactor.test.StepVerifier;
2932

3033
public final class AdminTest extends AbstractIntegrationTest {
3134

3235
@Autowired private CloudFoundryClient cloudFoundryClient;
3336

37+
// The buildpacks cache needs to be non-empty for the DELETE call to succeed.
38+
// We pull the "testLogCacheApp" bean, which ensures the bean will be initialized,
39+
// the app will be pushed, and it will add some data to the cache.
40+
@Autowired private Mono<ApplicationUtils.ApplicationMetadata> testLogCacheApp;
41+
3442
@IfCloudFoundryVersion(greaterThanOrEqualTo = CloudFoundryVersion.PCF_2_10)
3543
@Test
3644
public void clearBuildpackCache() {

integration-test/src/test/java/org/cloudfoundry/operations/ApplicationsTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
import org.cloudfoundry.util.FluentMap;
8888
import org.junit.jupiter.api.Test;
8989
import org.springframework.beans.factory.annotation.Autowired;
90+
import org.springframework.beans.factory.annotation.Qualifier;
9091
import org.springframework.core.io.ClassPathResource;
9192
import reactor.core.publisher.Flux;
9293
import reactor.core.publisher.Mono;
@@ -106,6 +107,10 @@ public final class ApplicationsTest extends AbstractIntegrationTest {
106107

107108
@Autowired private LogCacheClient logCacheClient;
108109

110+
// To create a service in #pushBindService, the Service Broker must be installed first.
111+
// We ensure it is by loading the serviceBrokerId @Lazy bean.
112+
@Qualifier("serviceBrokerId") @Autowired private Mono<String> serviceBrokerId;
113+
109114
@Test
110115
public void copySource() throws IOException {
111116
String sourceName = this.nameFactory.getApplicationName();

integration-test/src/test/java/org/cloudfoundry/operations/ServiceAdminTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import org.cloudfoundry.util.ResourceUtils;
3434
import org.junit.jupiter.api.Test;
3535
import org.springframework.beans.factory.annotation.Autowired;
36+
import org.springframework.beans.factory.annotation.Qualifier;
37+
3638
import reactor.core.publisher.Flux;
3739
import reactor.core.publisher.Mono;
3840
import reactor.test.StepVerifier;
@@ -53,6 +55,10 @@ public final class ServiceAdminTest extends AbstractIntegrationTest {
5355

5456
@Autowired private String serviceName;
5557

58+
// To create a service in #pushBindService, the Service Broker must be installed first.
59+
// We ensure it is by loading the serviceBrokerId @Lazy bean.
60+
@Qualifier("serviceBrokerId") @Autowired private Mono<String> serviceBrokerId;
61+
5662
@Test
5763
public void disableServiceAccess() {
5864
String planName = this.nameFactory.getPlanName();

0 commit comments

Comments
 (0)