Expand Gradle plugin's docs on setting bootRun's system properties

Closes gh-23578
This commit is contained in:
Andy Wilkinson
2020-10-06 14:34:39 +01:00
parent 4dad8c221a
commit 7ac14203ab
4 changed files with 79 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -68,4 +68,17 @@ class RunningDocumentationTests {
.build("optimizedLaunch").getOutput()).contains("false");
}
@TestTemplate
void bootRunSystemPropertyDefaultValue() throws IOException {
assertThat(this.gradleBuild.script("src/main/gradle/running/boot-run-system-property")
.build("configuredSystemProperties").getOutput()).contains("com.example.property = default");
}
@TestTemplate
void bootRunSystemPropetry() throws IOException {
assertThat(this.gradleBuild.script("src/main/gradle/running/boot-run-system-property")
.build("-Pexample=custom", "configuredSystemProperties").getOutput())
.contains("com.example.property = custom");
}
}