Use a templated source file for SpringBootVersion

Closes gh-29670
This commit is contained in:
Andy Wilkinson
2022-02-18 15:55:25 +00:00
parent 1f8700fbd1
commit 027093d852
6 changed files with 97 additions and 146 deletions

View File

@@ -83,7 +83,6 @@ class ConventionsPluginTests {
try (JarFile jar = new JarFile(file)) {
assertThatLicenseIsPresent(jar);
assertThatNoticeIsPresent(jar);
assertThatSpringBootPropertiesIsPresent(jar);
Attributes mainAttributes = jar.getManifest().getMainAttributes();
assertThat(mainAttributes.getValue("Implementation-Title"))
.isEqualTo("Test project for manifest customization");
@@ -113,7 +112,6 @@ class ConventionsPluginTests {
try (JarFile jar = new JarFile(file)) {
assertThatLicenseIsPresent(jar);
assertThatNoticeIsPresent(jar);
assertThatSpringBootPropertiesIsPresent(jar);
Attributes mainAttributes = jar.getManifest().getMainAttributes();
assertThat(mainAttributes.getValue("Implementation-Title"))
.isEqualTo("Source for " + this.projectDir.getName());
@@ -143,7 +141,6 @@ class ConventionsPluginTests {
try (JarFile jar = new JarFile(file)) {
assertThatLicenseIsPresent(jar);
assertThatNoticeIsPresent(jar);
assertThatSpringBootPropertiesIsPresent(jar);
Attributes mainAttributes = jar.getManifest().getMainAttributes();
assertThat(mainAttributes.getValue("Implementation-Title"))
.isEqualTo("Javadoc for " + this.projectDir.getName());
@@ -168,13 +165,6 @@ class ConventionsPluginTests {
assertThat(noticeContent).doesNotContain("${");
}
private void assertThatSpringBootPropertiesIsPresent(JarFile jar) throws IOException {
JarEntry properties = jar.getJarEntry("META-INF/spring-boot.properties");
assertThat(properties).isNotNull();
String content = FileCopyUtils.copyToString(new InputStreamReader(jar.getInputStream(properties)));
assertThat(content).contains("version=");
}
@Test
void testRetryIsConfiguredWithThreeRetriesOnCI() throws IOException {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {