Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,15 @@ public void info() {
.consumeNextWith(
response -> {
Version expected = Version.valueOf(SUPPORTED_API_VERSION);
Version actual = Version.valueOf(response.getApiVersion());

Version actual;
String version = response.getApiVersion();
if (version == null || version.isEmpty()) {
assertThat("CF API v2 is disabled")
.isEqualTo(response.getSupport());
actual = Version.of(0, 0, 0);
} else {
actual = Version.valueOf(version);
}
assertThat(actual).isLessThanOrEqualTo(expected);
})
.expectComplete()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.time.Instant;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.function.Function;
import java.util.function.UnaryOperator;
import org.cloudfoundry.AbstractIntegrationTest;
Expand Down Expand Up @@ -109,7 +110,6 @@
import org.cloudfoundry.util.JobUtils;
import org.cloudfoundry.util.PaginationUtils;
import org.cloudfoundry.util.ResourceUtils;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import reactor.core.publisher.Flux;
Expand Down Expand Up @@ -1885,13 +1885,9 @@ public void listServicesFilterByLabel() {
.verify(Duration.ofMinutes(5));
}

// TODO: Await https://github.com/cloudfoundry/cloud_controller_ng/issues/856 for this test to
// work
@Disabled(
"Await https://github.com/cloudfoundry/cloud_controller_ng/issues/856 for this test to"
+ " work")
@Test
public void listServicesFilterByServiceBrokerId() {
List<String> expectedValues = List.of(this.serviceName, this.serviceName + "-shareable");
Mono.zip(this.serviceBrokerId, this.spaceId)
.flatMapMany(
function(
Expand All @@ -1903,9 +1899,10 @@ public void listServicesFilterByServiceBrokerId() {
builder.serviceBrokerId(serviceBrokerId))))
.map(response -> response.getEntity().getLabel())
.as(StepVerifier::create)
.expectNext(this.serviceName)
.consumeNextWith(element -> assertThat(element).isIn(expectedValues))
.consumeNextWith(element -> assertThat(element).isIn(expectedValues))
.expectComplete()
.verify(Duration.ofMinutes(5));
.verify(Duration.ofMinutes(10));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,21 @@ public void getDefaultDomain() {
.map(GetOrganizationDefaultDomainResponse::getName)
.as(StepVerifier::create)
.consumeNextWith(
name -> assertThat(name).contains("apps.", ".shepherd.tanzu.broadcom.net"))
name -> {
assertThat(name)
.satisfiesAnyOf(
nameParam ->
assertThat(nameParam)
.contains(
"apps.",
".shepherd.tanzu.broadcom.net"),
nameParam ->
assertThat(nameParam)
.contains(
"apps.",
".127-0-0-1.nip.io")); // when
// testing with kind-deploy.
})
.expectComplete()
.verify(Duration.ofMinutes(5));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,16 @@
import org.cloudfoundry.client.v3.packages.CreatePackageRequest;
import org.cloudfoundry.client.v3.packages.GetPackageRequest;
import org.cloudfoundry.client.v3.packages.Package;
import org.cloudfoundry.client.v3.packages.PackageRelationships;
import org.cloudfoundry.client.v3.packages.PackageType;
import org.cloudfoundry.client.v3.packages.UploadPackageRequest;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.ClassPathResource;
import reactor.core.Exceptions;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;

@Disabled("Until Packages are no longer experimental")
public final class PackagesTest extends AbstractIntegrationTest {

@Autowired private CloudFoundryClient cloudFoundryClient;
Expand Down Expand Up @@ -81,6 +80,19 @@ public void upload() {
.create(
CreatePackageRequest.builder()
.type(PackageType.BITS)
.relationships(
PackageRelationships.builder()
.application(
ToOneRelationship
.builder()
.data(
Relationship
.builder()
.id(
applicationId)
.build())
.build())
.build())
.build()))
.map(Package::getId)
.flatMap(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,7 @@ private static Mono<Void> createDockerApplication(
.push(
PushApplicationRequest.builder()
.diskQuota(512)
.dockerImage("cloudfoundry/lattice-app")
.dockerImage("cloudfoundry/grace")
.healthCheckType(ApplicationHealthCheck.PORT)
.memory(64)
.name(name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ public void getTokenByClientCredentials() {
.verify(Duration.ofMinutes(5));
}

// TODO: Ready to Implement - Await https://github.com/cloudfoundry/cf-java-client/issues/862 to
// get passcode
@Disabled(
"Ready to Implement - Await https://github.com/cloudfoundry/cf-java-client/issues/862"
+ " to get passcode")
// When implemented, will fix issue: https://github.com/cloudfoundry/cf-java-client/issues/910.
// Could be done similarly to "getTokenByAuthorizationCode".
// First user_token grant type must be implented.
// See: https://docs.cloudfoundry.org/api/uaa/index.html#user-token-grant
// Then this endpoint must be called first, to create the token.
// See: https://docs.cloudfoundry.org/api/uaa/index.html#saml2-bearer-grant
@Disabled("Ready to Implement")
@Test
public void getTokenByOneTimePasscode() {
this.uaaClient
Expand Down