Home / Class/ KotlinPluginActionIntegrationTests Class — spring-boot Architecture

KotlinPluginActionIntegrationTests Class — spring-boot Architecture

Architecture documentation for the KotlinPluginActionIntegrationTests class in KotlinPluginActionIntegrationTests.java from the spring-boot codebase.

Entity Profile

Relationship Graph

Source Code

build-plugin/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/KotlinPluginActionIntegrationTests.java lines 44–122

@DisabledForJreRange(min = JRE.JAVA_20)
@ExtendWith(GradleBuildExtension.class)
class KotlinPluginActionIntegrationTests {

	GradleBuild gradleBuild = new PluginClasspathGradleBuild(new BuildOutput(getClass())).kotlin();

	@Test
	void noKotlinVersionPropertyWithoutKotlinPlugin() {
		assertThat(this.gradleBuild.build("kotlinVersion").getOutput()).contains("Kotlin version: none");
	}

	@Test
	void kotlinVersionPropertyIsSet() {
		expectConfigurationCacheRequestedDeprecationWarning();
		String output = this.gradleBuild.build("kotlinVersion", "dependencies", "--configuration", "compileClasspath")
			.getOutput();
		assertThat(output).containsPattern("Kotlin version: [0-9]\\.[0-9]\\.[0-9]+");
	}

	@Test
	void kotlinCompileTasksUseJavaParametersFlagByDefault() {
		expectConfigurationCacheRequestedDeprecationWarning();
		assertThat(this.gradleBuild.build("kotlinCompileTasksJavaParameters").getOutput())
			.contains("compileKotlin java parameters: true")
			.contains("compileTestKotlin java parameters: true");
	}

	@Test
	void kotlinCompileTasksCanOverrideDefaultJavaParametersFlag() {
		expectConfigurationCacheRequestedDeprecationWarning();
		assertThat(this.gradleBuild.build("kotlinCompileTasksJavaParameters").getOutput())
			.contains("compileKotlin java parameters: false")
			.contains("compileTestKotlin java parameters: false");
	}

	@Test
	void taskConfigurationIsAvoided() throws IOException {
		expectConfigurationCacheRequestedDeprecationWarning();
		BuildResult result = this.gradleBuild.build("help");
		String output = result.getOutput();
		BufferedReader reader = new BufferedReader(new StringReader(output));
		String line;
		Set<String> configured = new HashSet<>();
		while ((line = reader.readLine()) != null) {
			if (line.startsWith("Configuring :")) {
				configured.add(line.substring("Configuring :".length()));
			}
		}
		assertThat(configured).containsExactlyInAnyOrder("help", "clean");
	}

	@Test
	void compileAotJavaHasTransitiveRuntimeDependenciesOnItsClasspathWhenUsingKotlin() {
		expectConfigurationCacheRequestedDeprecationWarning();
		expectResolvableUsageIsAlreadyAllowedWarning();
		String output = this.gradleBuild.build("compileAotJavaClasspath").getOutput();
		assertThat(output).contains("org.jboss.logging" + File.separatorChar + "jboss-logging");
	}

	@Test
	void compileAotTestJavaHasTransitiveRuntimeDependenciesOnItsClasspathWhenUsingKotlin() {
		expectConfigurationCacheRequestedDeprecationWarning();
		expectResolvableUsageIsAlreadyAllowedWarning();
		String output = this.gradleBuild.build("compileAotTestJavaClasspath").getOutput();
		assertThat(output).contains("org.jboss.logging" + File.separatorChar + "jboss-logging");
	}

	private void expectConfigurationCacheRequestedDeprecationWarning() {
		this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("8.14")
			.expectDeprecationMessages("The StartParameter.isConfigurationCacheRequested property has been deprecated");
	}

	private void expectResolvableUsageIsAlreadyAllowedWarning() {
		this.gradleBuild.expectDeprecationWarningsWithAtLeastVersion("8.4")
			.expectDeprecationMessages("The resolvable usage is already allowed on configuration "
					+ "':aotRuntimeClasspath'. This behavior has been deprecated.");
	}

}

Domain

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free