mirror of
https://gitee.com/dcren/initializr.git
synced 2026-06-29 10:23:11 +08:00
Upgrade to Spring Boot 2.4.0
Closes gh-1145
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,7 +35,7 @@ class GradleAnnotationProcessorScopeBuildCustomizerTests {
|
||||
build.dependencies().add("lib", "com.example", "lib", DependencyScope.COMPILE);
|
||||
build.dependencies().add("ap", "com.example", "model-generator", DependencyScope.ANNOTATION_PROCESSOR);
|
||||
customize(build);
|
||||
assertThat(build.configurations().customizations()).hasOnlyOneElementSatisfying((configuration) -> {
|
||||
assertThat(build.configurations().customizations()).singleElement().satisfies((configuration) -> {
|
||||
assertThat(configuration.getName()).isEqualTo("compileOnly");
|
||||
assertThat(configuration.getExtendsFrom()).containsOnly("annotationProcessor");
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -52,7 +52,7 @@ class DefaultMavenBuildCustomizerTests {
|
||||
void customizeRegisterSpringBootPlugin() {
|
||||
InitializrMetadata metadata = InitializrMetadataTestBuilder.withDefaults().build();
|
||||
MavenBuild build = customizeBuild(metadata);
|
||||
assertThat(build.plugins().values()).hasOnlyOneElementSatisfying((mavenPlugin) -> {
|
||||
assertThat(build.plugins().values()).singleElement().satisfies((mavenPlugin) -> {
|
||||
assertThat(mavenPlugin.getGroupId()).isEqualTo("org.springframework.boot");
|
||||
assertThat(mavenPlugin.getArtifactId()).isEqualTo("spring-boot-maven-plugin");
|
||||
assertThat(mavenPlugin.getVersion()).isNull();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -50,8 +50,8 @@ class SourceCodeProjectGenerationConfigurationTests {
|
||||
return type;
|
||||
});
|
||||
assertThat(declaration.getAnnotations()).hasSize(1);
|
||||
assertThat(declaration.getAnnotations())
|
||||
.hasOnlyOneElementSatisfying((annotation) -> assertThat(annotation.getName())
|
||||
assertThat(declaration.getAnnotations()).singleElement()
|
||||
.satisfies((annotation) -> assertThat(annotation.getName())
|
||||
.isEqualTo("org.springframework.boot.autoconfigure.SpringBootApplication"));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,8 +32,8 @@ class GroovyGradleBuildCustomizerTests {
|
||||
void groovyPluginIsConfigured() {
|
||||
GradleBuild build = new GradleBuild();
|
||||
new GroovyGradleBuildCustomizer().customize(build);
|
||||
assertThat(build.plugins().values())
|
||||
.hasOnlyOneElementSatisfying((plugin) -> assertThat(plugin.getId()).isEqualTo("groovy"));
|
||||
assertThat(build.plugins().values()).singleElement()
|
||||
.satisfies((plugin) -> assertThat(plugin.getId()).isEqualTo("groovy"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ class GroovyMavenBuildCustomizerTests {
|
||||
void groovyMavenPluginIsConfigured() {
|
||||
MavenBuild build = new MavenBuild();
|
||||
new GroovyMavenBuildCustomizer().customize(build);
|
||||
assertThat(build.plugins().values()).hasOnlyOneElementSatisfying((groovyPlugin) -> {
|
||||
assertThat(build.plugins().values()).singleElement().satisfies((groovyPlugin) -> {
|
||||
assertThat(groovyPlugin.getGroupId()).isEqualTo("org.codehaus.gmavenplus");
|
||||
assertThat(groovyPlugin.getArtifactId()).isEqualTo("gmavenplus-plugin");
|
||||
assertThat(groovyPlugin.getVersion()).isEqualTo("1.11.0");
|
||||
|
||||
@@ -45,7 +45,7 @@ class GroovyDslKotlinGradleBuildCustomizerTests {
|
||||
GradleBuild build = new GradleBuild();
|
||||
new GroovyDslKotlinGradleBuildCustomizer(new SimpleKotlinProjectSettings("1.2.70", "11")).customize(build);
|
||||
assertThat(build.tasks().importedTypes()).contains("org.jetbrains.kotlin.gradle.tasks.KotlinCompile");
|
||||
assertThat(build.tasks().values()).hasOnlyOneElementSatisfying((task) -> {
|
||||
assertThat(build.tasks().values()).singleElement().satisfies((task) -> {
|
||||
assertThat(task.getName()).isEqualTo("KotlinCompile");
|
||||
assertKotlinOptions(task, "11");
|
||||
});
|
||||
|
||||
@@ -44,7 +44,7 @@ class KotlinDslKotlinGradleBuildCustomizerTests {
|
||||
GradleBuild build = new GradleBuild();
|
||||
new KotlinDslKotlinGradleBuildCustomizer(new SimpleKotlinProjectSettings("1.2.70", "11")).customize(build);
|
||||
assertThat(build.tasks().importedTypes()).contains("org.jetbrains.kotlin.gradle.tasks.KotlinCompile");
|
||||
assertThat(build.tasks().values()).hasOnlyOneElementSatisfying((task) -> {
|
||||
assertThat(build.tasks().values()).singleElement().satisfies((task) -> {
|
||||
assertThat(task.getName()).isEqualTo("KotlinCompile");
|
||||
assertKotlinOptions(task, "11");
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -43,7 +43,7 @@ class KotlinJpaGradleBuildCustomizerTests {
|
||||
dependency.setFacets(Collections.singletonList("jpa"));
|
||||
GradleBuild build = getCustomizedBuild(dependency);
|
||||
assertThat(build.plugins().values().filter(GradlePlugin::isApply)).isEmpty();
|
||||
assertThat(build.plugins().values()).hasOnlyOneElementSatisfying((plugin) -> {
|
||||
assertThat(build.plugins().values()).singleElement().satisfies((plugin) -> {
|
||||
assertThat(plugin.getId()).isEqualTo("org.jetbrains.kotlin.plugin.jpa");
|
||||
assertThat(((StandardGradlePlugin) plugin).getVersion()).isEqualTo("1.2.70");
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -42,7 +42,7 @@ class KotlinJpaMavenBuildCustomizerTests {
|
||||
Dependency dependency = Dependency.withId("foo");
|
||||
dependency.setFacets(Collections.singletonList("jpa"));
|
||||
MavenBuild build = getCustomizedBuild(dependency);
|
||||
assertThat(build.plugins().values()).hasOnlyOneElementSatisfying((plugin) -> {
|
||||
assertThat(build.plugins().values()).singleElement().satisfies((plugin) -> {
|
||||
assertThat(plugin.getGroupId()).isEqualTo("org.jetbrains.kotlin");
|
||||
assertThat(plugin.getArtifactId()).isEqualTo("kotlin-maven-plugin");
|
||||
MavenPlugin.Setting settings = plugin.getConfiguration().getSettings().get(0);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2019 the original author or authors.
|
||||
* Copyright 2012-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -56,7 +56,7 @@ class KotlinMavenBuildCustomizerTests {
|
||||
void kotlinMavenPluginIsConfigured() {
|
||||
MavenBuild build = new MavenBuild();
|
||||
new KotlinMavenBuildCustomizer(new SimpleKotlinProjectSettings("1.2.70")).customize(build);
|
||||
assertThat(build.plugins().values()).hasOnlyOneElementSatisfying((kotlinPlugin) -> {
|
||||
assertThat(build.plugins().values()).singleElement().satisfies((kotlinPlugin) -> {
|
||||
assertThat(kotlinPlugin.getGroupId()).isEqualTo("org.jetbrains.kotlin");
|
||||
assertThat(kotlinPlugin.getArtifactId()).isEqualTo("kotlin-maven-plugin");
|
||||
assertThat(kotlinPlugin.getVersion()).isNull();
|
||||
@@ -86,7 +86,7 @@ class KotlinMavenBuildCustomizerTests {
|
||||
void kotlinMavenPluginWithSeveralArgs() {
|
||||
MavenBuild build = new MavenBuild();
|
||||
new KotlinMavenBuildCustomizer(new TestKotlinProjectSettings()).customize(build);
|
||||
assertThat(build.plugins().values()).hasOnlyOneElementSatisfying((kotlinPlugin) -> {
|
||||
assertThat(build.plugins().values()).singleElement().satisfies((kotlinPlugin) -> {
|
||||
Configuration configuration = kotlinPlugin.getConfiguration();
|
||||
Setting args = configuration.getSettings().get(0);
|
||||
assertThat(args.getName()).isEqualTo("args");
|
||||
|
||||
@@ -54,7 +54,7 @@ class KotlinMavenFullBuildCustomizerTests {
|
||||
void kotlinMavenPluginIsConfigured() {
|
||||
MavenBuild build = new MavenBuild();
|
||||
new KotlinMavenFullBuildCustomizer(new SimpleKotlinProjectSettings("1.2.70", "1.6")).customize(build);
|
||||
assertThat(build.plugins().values()).hasOnlyOneElementSatisfying((kotlinPlugin) -> {
|
||||
assertThat(build.plugins().values()).singleElement().satisfies((kotlinPlugin) -> {
|
||||
assertThat(kotlinPlugin.getGroupId()).isEqualTo("org.jetbrains.kotlin");
|
||||
assertThat(kotlinPlugin.getArtifactId()).isEqualTo("kotlin-maven-plugin");
|
||||
assertThat(kotlinPlugin.getVersion()).isEqualTo("${kotlin.version}");
|
||||
|
||||
Reference in New Issue
Block a user