From 35a9a7fee2f6f62754ef8f8c504afb5fa4f4efc7 Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Fri, 11 Mar 2022 15:19:53 -0600 Subject: [PATCH] Ignore deprecation warnings in Paketo system tests Closes gh-30194 --- .../boot/testsupport/gradle/testkit/GradleBuild.java | 4 ++-- .../springframework/boot/image/paketo/PaketoBuilderTests.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java index e080e0fc9c..6955990d8c 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java @@ -80,7 +80,7 @@ public class GradleBuild { private GradleVersion expectDeprecationWarnings; - private String[] expectedDeprecationMessages; + private List expectedDeprecationMessages = new ArrayList<>(); private boolean configurationCache = false; @@ -155,7 +155,7 @@ public class GradleBuild { } public GradleBuild expectDeprecationMessages(String... messages) { - this.expectedDeprecationMessages = messages; + this.expectedDeprecationMessages.addAll(Arrays.asList(messages)); return this; } diff --git a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java index 5b06954f6d..281d4b5e90 100644 --- a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java +++ b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java @@ -67,6 +67,7 @@ class PaketoBuilderTests { void configureGradleBuild() { this.gradleBuild.scriptProperty("systemTestMavenRepository", new File("build/system-test-maven-repository").getAbsoluteFile().toURI().toASCIIString()); + this.gradleBuild.expectDeprecationMessages("BPL_SPRING_CLOUD_BINDINGS_ENABLED.*true.*Deprecated"); } @Test @@ -122,7 +123,7 @@ class PaketoBuilderTests { container.waitingFor(Wait.forHttp("/test")).start(); container.stop(); } - this.gradleBuild.expectDeprecationMessages("BOM table is deprecated in this buildpack api version"); + this.gradleBuild.expectDeprecationMessages("BOM table is deprecated"); result = buildImage(imageName); assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS); try (GenericContainer container = new GenericContainer<>(imageName).withExposedPorts(8080)) {