Skip to content

Commit 9dc5b88

Browse files
committed
Polish "Mark bootArchives configuration as unresolvable"
See gh-22943
1 parent 796307a commit 9dc5b88

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ dependencies {
4242
testImplementation("org.junit.jupiter:junit-jupiter")
4343
testImplementation("org.mockito:mockito-core")
4444
testImplementation("org.testcontainers:testcontainers")
45+
46+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
4547
}
4648

4749
gradlePlugin {
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,39 +17,34 @@
1717
package org.springframework.boot.gradle.plugin;
1818

1919
import java.io.File;
20-
import java.io.IOException;
2120

2221
import org.gradle.api.Project;
2322
import org.gradle.api.artifacts.Configuration;
2423
import org.gradle.testfixtures.ProjectBuilder;
25-
import org.junit.jupiter.api.BeforeEach;
2624
import org.junit.jupiter.api.Test;
2725
import org.junit.jupiter.api.io.TempDir;
2826

27+
import org.springframework.boot.testsupport.classpath.ClassPathExclusions;
28+
2929
import static org.assertj.core.api.Assertions.assertThat;
3030

3131
/**
32-
* Tests for expectations about {code bootArchives} Gradle configuration about its
33-
* purpose.
32+
* Tests for {@link SpringBootPlugin}.
3433
*
3534
* @author Martin Chalupa
35+
* @author Andy Wilkinson
3636
*/
37-
public class BootArchivesConfigurationContractTests {
37+
@ClassPathExclusions("kotlin-daemon-client-*.jar")
38+
public class SpringBootPluginTests {
3839

3940
@TempDir
4041
File temp;
4142

42-
private Project project;
43-
44-
@BeforeEach
45-
void createConvention() throws IOException {
46-
this.project = ProjectBuilder.builder().withProjectDir(this.temp).build();
47-
}
48-
4943
@Test
5044
void bootArchivesConfigurationsCannotBeResolved() {
51-
this.project.getPlugins().apply(SpringBootPlugin.class);
52-
Configuration bootArchives = this.project.getConfigurations()
45+
Project project = ProjectBuilder.builder().withProjectDir(this.temp).build();
46+
project.getPlugins().apply(SpringBootPlugin.class);
47+
Configuration bootArchives = project.getConfigurations()
5348
.getByName(SpringBootPlugin.BOOT_ARCHIVES_CONFIGURATION_NAME);
5449
assertThat(bootArchives.isCanBeResolved()).isFalse();
5550
}

0 commit comments

Comments
 (0)