|
17 | 17 | package org.springframework.boot.gradle.plugin;
|
18 | 18 |
|
19 | 19 | import java.io.File;
|
20 |
| -import java.io.IOException; |
21 | 20 |
|
22 | 21 | import org.gradle.api.Project;
|
23 | 22 | import org.gradle.api.artifacts.Configuration;
|
24 | 23 | import org.gradle.testfixtures.ProjectBuilder;
|
25 |
| -import org.junit.jupiter.api.BeforeEach; |
26 | 24 | import org.junit.jupiter.api.Test;
|
27 | 25 | import org.junit.jupiter.api.io.TempDir;
|
28 | 26 |
|
| 27 | +import org.springframework.boot.testsupport.classpath.ClassPathExclusions; |
| 28 | + |
29 | 29 | import static org.assertj.core.api.Assertions.assertThat;
|
30 | 30 |
|
31 | 31 | /**
|
32 |
| - * Tests for expectations about {code bootArchives} Gradle configuration about its |
33 |
| - * purpose. |
| 32 | + * Tests for {@link SpringBootPlugin}. |
34 | 33 | *
|
35 | 34 | * @author Martin Chalupa
|
| 35 | + * @author Andy Wilkinson |
36 | 36 | */
|
37 |
| -public class BootArchivesConfigurationContractTests { |
| 37 | +@ClassPathExclusions("kotlin-daemon-client-*.jar") |
| 38 | +public class SpringBootPluginTests { |
38 | 39 |
|
39 | 40 | @TempDir
|
40 | 41 | File temp;
|
41 | 42 |
|
42 |
| - private Project project; |
43 |
| - |
44 |
| - @BeforeEach |
45 |
| - void createConvention() throws IOException { |
46 |
| - this.project = ProjectBuilder.builder().withProjectDir(this.temp).build(); |
47 |
| - } |
48 |
| - |
49 | 43 | @Test
|
50 | 44 | 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() |
53 | 48 | .getByName(SpringBootPlugin.BOOT_ARCHIVES_CONFIGURATION_NAME);
|
54 | 49 | assertThat(bootArchives.isCanBeResolved()).isFalse();
|
55 | 50 | }
|
|
0 commit comments