Merge branch '2.7.x' into 3.0.x · spring-projects/spring-boot@03dd666 (original) (raw)

`@@ -47,53 +47,46 @@ class JavaPluginActionIntegrationTests {

`

47

47

``

48

48

`@TestTemplate

`

49

49

`void noBootJarTaskWithoutJavaPluginApplied() {

`

50

``

`-

assertThat(this.gradleBuild.build("taskExists", "-PtaskName=bootJar").getOutput())

`

51

``

`-

.contains("bootJar exists = false");

`

``

50

`+

assertThat(this.gradleBuild.build("tasks").getOutput()).doesNotContain("bootJar");

`

52

51

` }

`

53

52

``

54

53

`@TestTemplate

`

55

54

`void applyingJavaPluginCreatesBootJarTask() {

`

56

``

`-

assertThat(this.gradleBuild.build("taskExists", "-PtaskName=bootJar", "-PapplyJavaPlugin").getOutput())

`

57

``

`-

.contains("bootJar exists = true");

`

``

55

`+

assertThat(this.gradleBuild.build("tasks").getOutput()).contains("bootJar");

`

58

56

` }

`

59

57

``

60

58

`@TestTemplate

`

61

59

`void noBootRunTaskWithoutJavaPluginApplied() {

`

62

``

`-

assertThat(this.gradleBuild.build("taskExists", "-PtaskName=bootRun").getOutput())

`

63

``

`-

.contains("bootRun exists = false");

`

``

60

`+

assertThat(this.gradleBuild.build("tasks").getOutput()).doesNotContain("bootRun");

`

64

61

` }

`

65

62

``

66

63

`@TestTemplate

`

67

64

`void applyingJavaPluginCreatesBootRunTask() {

`

68

``

`-

assertThat(this.gradleBuild.build("taskExists", "-PtaskName=bootRun", "-PapplyJavaPlugin").getOutput())

`

69

``

`-

.contains("bootRun exists = true");

`

``

65

`+

assertThat(this.gradleBuild.build("tasks").getOutput()).contains("bootRun");

`

70

66

` }

`

71

67

``

72

68

`@TestTemplate

`

73

69

`void javaCompileTasksUseUtf8Encoding() {

`

74

``

`-

assertThat(this.gradleBuild.build("javaCompileEncoding", "-PapplyJavaPlugin").getOutput())

`

75

``

`-

.contains("compileJava = UTF-8")

`

``

70

`+

assertThat(this.gradleBuild.build("build").getOutput()).contains("compileJava = UTF-8")

`

76

71

` .contains("compileTestJava = UTF-8");

`

77

72

` }

`

78

73

``

79

74

`@TestTemplate

`

80

75

`void javaCompileTasksUseParametersCompilerFlagByDefault() {

`

81

``

`-

assertThat(this.gradleBuild.build("javaCompileTasksCompilerArgs").getOutput())

`

82

``

`-

.contains("compileJava compiler args: [-parameters]")

`

``

76

`+

assertThat(this.gradleBuild.build("build").getOutput()).contains("compileJava compiler args: [-parameters]")

`

83

77

` .contains("compileTestJava compiler args: [-parameters]");

`

84

78

` }

`

85

79

``

86

80

`@TestTemplate

`

87

81

`void javaCompileTasksUseParametersAndAdditionalCompilerFlags() {

`

88

``

`-

assertThat(this.gradleBuild.build("javaCompileTasksCompilerArgs").getOutput())

`

``

82

`+

assertThat(this.gradleBuild.build("build").getOutput())

`

89

83

` .contains("compileJava compiler args: [-parameters, -Xlint:all]")

`

90

84

` .contains("compileTestJava compiler args: [-parameters, -Xlint:all]");

`

91

85

` }

`

92

86

``

93

87

`@TestTemplate

`

94

88

`void javaCompileTasksCanOverrideDefaultParametersCompilerFlag() {

`

95

``

`-

assertThat(this.gradleBuild.build("javaCompileTasksCompilerArgs").getOutput())

`

96

``

`-

.contains("compileJava compiler args: [-Xlint:all]")

`

``

89

`+

assertThat(this.gradleBuild.build("build").getOutput()).contains("compileJava compiler args: [-Xlint:all]")

`

97

90

` .contains("compileTestJava compiler args: [-Xlint:all]");

`

98

91

` }

`

99

92

``

`@@ -139,35 +132,24 @@ void additionalMetadataLocationsNotConfiguredWhenProcessorIsAbsent() throws IOEx

`

139

132

``

140

133

`@TestTemplate

`

141

134

`void applyingJavaPluginCreatesDevelopmentOnlyConfiguration() {

`

142

``

`-

assertThat(this.gradleBuild

`

143

``

`-

.build("configurationExists", "-PconfigurationName=developmentOnly", "-PapplyJavaPlugin")

`

144

``

`-

.getOutput()).contains("developmentOnly exists = true");

`

``

135

`+

assertThat(this.gradleBuild.build("build").getOutput()).contains("developmentOnly exists = true");

`

145

136

` }

`

146

137

``

147

138

`@TestTemplate

`

148

139

`void productionRuntimeClasspathIsConfiguredWithAttributes() {

`

149

``

`-

assertThat(this.gradleBuild

`

150

``

`-

.build("configurationAttributes", "-PconfigurationName=productionRuntimeClasspath", "-PapplyJavaPlugin")

`

151

``

`-

.getOutput()).contains("3 productionRuntimeClasspath attributes:")

`

``

140

`+

assertThat(this.gradleBuild.build("build").getOutput()).contains("3 productionRuntimeClasspath attributes:")

`

152

141

` .contains("org.gradle.usage: java-runtime")

`

153

142

` .contains("org.gradle.libraryelements: jar")

`

154

143

` .contains("org.gradle.dependency.bundling: external");

`

155

144

` }

`

156

145

``

157

146

`@TestTemplate

`

158

147

`void productionRuntimeClasspathIsConfiguredWithResolvabilityAndConsumabilityThatMatchesRuntimeClasspath() {

`

159

``

`-

String runtime = this.gradleBuild

`

160

``

`-

.build("configurationResolvabilityAndConsumability", "-PconfigurationName=runtimeClasspath",

`

161

``

`-

"-PapplyJavaPlugin")

`

162

``

`-

.getOutput();

`

163

``

`-

assertThat(runtime).contains("canBeResolved: true");

`

164

``

`-

assertThat(runtime).contains("canBeConsumed: false");

`

165

``

`-

String productionRuntime = this.gradleBuild

`

166

``

`-

.build("configurationResolvabilityAndConsumability", "-PconfigurationName=productionRuntimeClasspath",

`

167

``

`-

"-PapplyJavaPlugin")

`

168

``

`-

.getOutput();

`

169

``

`-

assertThat(productionRuntime).contains("canBeResolved: true");

`

170

``

`-

assertThat(productionRuntime).contains("canBeConsumed: false");

`

``

148

`+

String output = this.gradleBuild.build("build").getOutput();

`

``

149

`+

assertThat(output).contains("runtimeClasspath canBeResolved: true");

`

``

150

`+

assertThat(output).contains("runtimeClasspath canBeConsumed: false");

`

``

151

`+

assertThat(output).contains("productionRuntimeClasspath canBeResolved: true");

`

``

152

`+

assertThat(output).contains("productionRuntimeClasspath canBeConsumed: false");

`

171

153

` }

`

172

154

``

173

155

`@TestTemplate

`