Skip to content

fix junit tests when jdk11 is used. #1255 #1259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
34 changes: 0 additions & 34 deletions .github/workflows/ci-java-17-and-21.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8, 11 ]
java: [ 8, 11, 17, 21 ]
name: Java ${{ matrix.java }} build
steps:
- uses: actions/checkout@v4
Expand All @@ -35,7 +35,7 @@ jobs:
run: ./mvnw clean package -Dgpg.skip
- name: Compile integration tests
run: ./mvnw -Pintegration-test test-compile compile
- if: ${{ matrix.java != 8 }}
- if: ${{ matrix.java == 11 }}
name: Check style with Spotless
run: ./mvnw spotless:check -Pintegration-test

Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,12 @@ void pushExistingApplication() throws IOException {
requestSpace(this.cloudFoundryClient, TEST_SPACE_ID, TEST_ORGANIZATION_ID);
requestApplications(
this.cloudFoundryClient, "test-name", TEST_SPACE_ID, "test-application-id");
requestCreateApplication(
cloudFoundryClient,
ApplicationManifest.builder().name("test-name").build(),
TEST_SPACE_ID,
null,
"test-application-id");
requestUpdateApplication(
this.cloudFoundryClient,
"test-application-id",
Expand Down Expand Up @@ -1599,6 +1605,15 @@ void pushExistingApplicationWithEnvironmentVariables() throws IOException {
TEST_SPACE_ID,
"test-application-id",
Collections.singletonMap("test-key-1", "test-value-1"));
requestCreateApplication(
cloudFoundryClient,
ApplicationManifest.builder()
.name("test-name")
.environmentVariable("test-key-2", "test-value-2")
.build(),
TEST_SPACE_ID,
null,
"test-application-id");
requestUpdateApplication(
this.cloudFoundryClient,
"test-application-id",
Expand Down Expand Up @@ -1669,6 +1684,16 @@ void pushExistingApplicationWithNullEnvironment() throws IOException {
requestSpace(this.cloudFoundryClient, TEST_SPACE_ID, TEST_ORGANIZATION_ID);
requestApplications(
this.cloudFoundryClient, "test-name", TEST_SPACE_ID, "test-application-id", null);
requestCreateApplication(
cloudFoundryClient,
ApplicationManifest.builder()
.name("test-name")
.environmentVariable("test-key-1", "test-value-1")
.environmentVariable("test-key-2", "test-value-2")
.build(),
TEST_SPACE_ID,
null,
"test-application-id");
requestUpdateApplication(
this.cloudFoundryClient,
"test-application-id",
Expand Down Expand Up @@ -1756,11 +1781,20 @@ void pushExistingRouteWithHost() throws IOException {
requestSharedDomains(
this.cloudFoundryClient, "test-shared-domain", "test-shared-domain-id");
requestApplicationRoutes(this.cloudFoundryClient, "test-application-id", "test-route-id");
requestCreateRoute(
this.cloudFoundryClient,
"test-shared-domain-id",
"test-host",
null,
null,
"test-space-id",
"test-route-id");
requestRoutes(
this.cloudFoundryClient,
"test-shared-domain-id",
"test-host",
null,
null,
"test-route-id");
requestListMatchingResources(
this.cloudFoundryClient,
Expand Down Expand Up @@ -1817,7 +1851,16 @@ void pushExistingRouteWithNoHost() throws IOException {
requestSharedDomains(
this.cloudFoundryClient, "test-shared-domain", "test-shared-domain-id");
requestApplicationRoutes(this.cloudFoundryClient, "test-application-id", "test-route-id");
requestRoutes(this.cloudFoundryClient, "test-shared-domain-id", "", null, "test-route-id");
requestRoutes(
this.cloudFoundryClient, "test-shared-domain-id", "", null, null, "test-route-id");
requestCreateRoute(
this.cloudFoundryClient,
"test-shared-domain-id",
"",
null,
null,
"test-space-id",
"test-route-id");
requestListMatchingResources(
this.cloudFoundryClient,
Arrays.asList(
Expand Down Expand Up @@ -2952,6 +2995,7 @@ void pushStartFailsStaging() throws IOException {
requestUpdateApplicationState(this.cloudFoundryClient, "test-application-id", "STOPPED");
requestUpdateApplicationState(this.cloudFoundryClient, "test-application-id", "STARTED");
requestGetApplicationFailing(this.cloudFoundryClient, "test-application-id");
requestInstancesApplicationFailing(this.cloudFoundryClient, "test-application-id");

StepVerifier.withVirtualTime(
() ->
Expand Down Expand Up @@ -3244,6 +3288,7 @@ void restageStagingFailure() {
"test-metadata-id");
requestRestageApplication(this.cloudFoundryClient, "test-metadata-id");
requestGetApplicationFailing(this.cloudFoundryClient, "test-metadata-id");
requestInstancesApplicationFailing(this.cloudFoundryClient, "test-metadata-id");

this.applications
.restage(RestageApplicationRequest.builder().name("test-application-name").build())
Expand Down Expand Up @@ -3317,6 +3362,7 @@ void restageTimeout() {
"test-metadata-id");
requestRestageApplication(this.cloudFoundryClient, "test-metadata-id");
requestGetApplicationTimeout(this.cloudFoundryClient, "test-metadata-id");
requestInstancesApplicationFailing(this.cloudFoundryClient, "test-metadata-id");

this.applications
.restage(
Expand Down Expand Up @@ -4983,6 +5029,29 @@ private static void requestGetApplicationFailing(
.build()));
}

private static void requestInstancesApplicationFailing(
CloudFoundryClient cloudFoundryClient, String applicationId) {
when(cloudFoundryClient
.applicationsV2()
.instances(
ApplicationInstancesRequest.builder()
.applicationId(applicationId)
.build()))
.thenReturn(
Mono.just(
fill(
ApplicationInstancesResponse.builder(),
"application-instances-")
.instance(
"instance-0",
fill(
ApplicationInstanceInfo.builder(),
"application-instance-info-")
.state("FAILED")
.build())
.build()));
}

private static void requestGetApplicationTimeout(
CloudFoundryClient cloudFoundryClient, String applicationId) {
when(cloudFoundryClient
Expand Down Expand Up @@ -5452,11 +5521,13 @@ private static void requestRoutes(
CloudFoundryClient cloudFoundryClient,
String domainId,
String host,
Integer port,
String routePath,
String routeId) {
ListRoutesRequest.Builder requestBuilder = ListRoutesRequest.builder();

Optional.ofNullable(host).ifPresent(requestBuilder::host);
Optional.ofNullable(port).ifPresent(requestBuilder::port);
Optional.ofNullable(routePath).ifPresent(requestBuilder::path);

when(cloudFoundryClient.routes().list(requestBuilder.domainId(domainId).page(1).build()))
Expand All @@ -5472,6 +5543,7 @@ private static void requestRoutes(
.entity(
RouteEntity.builder()
.host(host)
.port(port)
.path(
routePath == null
? ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ void createSetRolesByUsernameDisabled() {
@Test
void createWithQuota() {
requestOrganizationQuotaDefinitions(this.cloudFoundryClient, "test-quota-definition-name");

requestCreateOrganization(this.cloudFoundryClient, TEST_ORGANIZATION_NAME, null);
requestCreateOrganization(
this.cloudFoundryClient,
TEST_ORGANIZATION_NAME,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ void createRouteInvalidDomain() {
void createRouteInvalidSpace() {
requestSpacesEmpty(this.cloudFoundryClient, TEST_ORGANIZATION_ID, TEST_SPACE_NAME);
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");

this.routes
.create(
Expand All @@ -236,6 +237,7 @@ void createRouteInvalidSpace() {
void createRouteNoHost() {
requestSpaces(this.cloudFoundryClient, TEST_ORGANIZATION_ID, TEST_SPACE_NAME);
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");
requestCreateRoute(
this.cloudFoundryClient,
"test-private-domain-metadata-id",
Expand All @@ -262,6 +264,7 @@ void createRouteNoHost() {
void createRouteNoPath() {
requestSpaces(this.cloudFoundryClient, TEST_ORGANIZATION_ID, TEST_SPACE_NAME);
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");
requestCreateRoute(
this.cloudFoundryClient,
"test-private-domain-metadata-id",
Expand All @@ -288,6 +291,7 @@ void createRouteNoPath() {
void createRoutePrivateDomain() {
requestSpaces(this.cloudFoundryClient, TEST_ORGANIZATION_ID, TEST_SPACE_NAME);
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");
requestCreateRoute(
this.cloudFoundryClient,
"test-private-domain-metadata-id",
Expand Down Expand Up @@ -365,6 +369,7 @@ private static void mockDeleteOrphanedRoutes(CloudFoundryClient cloudFoundryClie
@Test
void deleteRoute() {
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");
requestRoutes(
this.cloudFoundryClient,
"test-private-domain-metadata-id",
Expand Down Expand Up @@ -531,6 +536,7 @@ void mapRouteAssignedPort() {
void mapRouteExists() {
requestApplications(this.cloudFoundryClient, "test-application-name", TEST_SPACE_ID);
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");
requestRoutes(
this.cloudFoundryClient,
"test-private-domain-metadata-id",
Expand All @@ -556,6 +562,7 @@ void mapRouteExists() {
void mapRouteInvalidApplicationName() {
requestApplicationsEmpty(this.cloudFoundryClient, "test-application-name", TEST_SPACE_ID);
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");
requestRoutesEmpty(
this.cloudFoundryClient,
"test-private-domain-metadata-id",
Expand Down Expand Up @@ -616,6 +623,7 @@ void mapRouteInvalidDomain() {
void mapRouteNoHost() {
requestApplications(this.cloudFoundryClient, "test-application-name", TEST_SPACE_ID);
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");
requestRoutesEmpty(
this.cloudFoundryClient,
"test-private-domain-metadata-id",
Expand Down Expand Up @@ -648,6 +656,7 @@ void mapRouteNoHost() {
void mapRoutePath() {
requestApplications(this.cloudFoundryClient, "test-application-name", TEST_SPACE_ID);
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");
requestRoutesTwo(
this.cloudFoundryClient,
"test-private-domain-metadata-id",
Expand All @@ -672,6 +681,7 @@ void mapRoutePath() {
void mapRoutePrivateDomain() {
requestApplications(this.cloudFoundryClient, "test-application-name", TEST_SPACE_ID);
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");
requestRoutesEmpty(
this.cloudFoundryClient,
"test-private-domain-metadata-id",
Expand Down Expand Up @@ -760,6 +770,7 @@ void unmapRouteAssignedPort() {
void unmapRouteInvalidApplicationName() {
requestApplicationsEmpty(this.cloudFoundryClient, "test-application-name", TEST_SPACE_ID);
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");

this.routes
.unmap(
Expand Down Expand Up @@ -804,6 +815,7 @@ void unmapRouteInvalidDomain() {
void unmapRouteInvalidRoute() {
requestApplications(this.cloudFoundryClient, "test-application-name", TEST_SPACE_ID);
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");
requestRoutesEmpty(
this.cloudFoundryClient,
"test-private-domain-metadata-id",
Expand Down Expand Up @@ -832,6 +844,7 @@ void unmapRouteInvalidRoute() {
void unmapRoutePrivateDomain() {
requestApplications(this.cloudFoundryClient, "test-application-name", TEST_SPACE_ID);
requestPrivateDomains(this.cloudFoundryClient, TEST_ORGANIZATION_ID, "test-domain");
requestSharedDomains(cloudFoundryClient, "test-domain");
requestRoutes(
this.cloudFoundryClient,
"test-private-domain-metadata-id",
Expand Down
Loading
Loading