File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ public class GradleBuild {
80
80
81
81
private GradleVersion expectDeprecationWarnings ;
82
82
83
+ private String [] expectedDeprecationMessages ;
84
+
83
85
private boolean configurationCache = false ;
84
86
85
87
private Map <String , String > scriptProperties = new HashMap <>();
@@ -152,6 +154,11 @@ public GradleBuild expectDeprecationWarningsWithAtLeastVersion(String gradleVers
152
154
return this ;
153
155
}
154
156
157
+ public GradleBuild expectDeprecationMessages (String ... messages ) {
158
+ this .expectedDeprecationMessages = messages ;
159
+ return this ;
160
+ }
161
+
155
162
public GradleBuild configurationCache () {
156
163
this .configurationCache = true ;
157
164
return this ;
@@ -167,7 +174,13 @@ public BuildResult build(String... arguments) {
167
174
BuildResult result = prepareRunner (arguments ).build ();
168
175
if (this .expectDeprecationWarnings == null || (this .gradleVersion != null
169
176
&& 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" );
171
184
}
172
185
return result ;
173
186
}
Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ void executableJarAppBuiltTwiceWithCaching() throws Exception {
122
122
container .waitingFor (Wait .forHttp ("/test" )).start ();
123
123
container .stop ();
124
124
}
125
+ this .gradleBuild .expectDeprecationMessages ("BOM table is deprecated in this buildpack api version" );
125
126
result = buildImage (imageName );
126
127
assertThat (result .task (":bootBuildImage" ).getOutcome ()).isEqualTo (TaskOutcome .SUCCESS );
127
128
try (GenericContainer <?> container = new GenericContainer <>(imageName ).withExposedPorts (8080 )) {
You can’t perform that action at this time.
0 commit comments