Skip to content

Commit 59ffe28

Browse files
Ignore buildpack deprecation warnings in Paketo system tests
Fixes gh-29885
1 parent acd1ba0 commit 59ffe28

File tree

2 files changed

+15
-1
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit
  • spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo

2 files changed

+15
-1
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public class GradleBuild {
8080

8181
private GradleVersion expectDeprecationWarnings;
8282

83+
private String[] expectedDeprecationMessages;
84+
8385
private boolean configurationCache = false;
8486

8587
private Map<String, String> scriptProperties = new HashMap<>();
@@ -152,6 +154,11 @@ public GradleBuild expectDeprecationWarningsWithAtLeastVersion(String gradleVers
152154
return this;
153155
}
154156

157+
public GradleBuild expectDeprecationMessages(String... messages) {
158+
this.expectedDeprecationMessages = messages;
159+
return this;
160+
}
161+
155162
public GradleBuild configurationCache() {
156163
this.configurationCache = true;
157164
return this;
@@ -167,7 +174,13 @@ public BuildResult build(String... arguments) {
167174
BuildResult result = prepareRunner(arguments).build();
168175
if (this.expectDeprecationWarnings == null || (this.gradleVersion != null
169176
&& this.expectDeprecationWarnings.compareTo(GradleVersion.version(this.gradleVersion)) > 0)) {
170-
assertThat(result.getOutput()).doesNotContain("Deprecated").doesNotContain("deprecated");
177+
String buildOutput = result.getOutput();
178+
if (this.expectedDeprecationMessages != null) {
179+
for (String message : this.expectedDeprecationMessages) {
180+
buildOutput = buildOutput.replaceAll(message, "");
181+
}
182+
}
183+
assertThat(buildOutput).doesNotContain("Deprecated").doesNotContain("deprecated");
171184
}
172185
return result;
173186
}

spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/paketo/PaketoBuilderTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ void executableJarAppBuiltTwiceWithCaching() throws Exception {
122122
container.waitingFor(Wait.forHttp("/test")).start();
123123
container.stop();
124124
}
125+
this.gradleBuild.expectDeprecationMessages("BOM table is deprecated in this buildpack api version");
125126
result = buildImage(imageName);
126127
assertThat(result.task(":bootBuildImage").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
127128
try (GenericContainer<?> container = new GenericContainer<>(imageName).withExposedPorts(8080)) {

0 commit comments

Comments
 (0)