mirror of
https://gitee.com/dcren/initializr.git
synced 2026-09-19 06:17:42 +08:00
Polish "Add support for webflux in spring-cloud-function"
Closes gh-733
This commit is contained in:
+2
-2
@@ -42,7 +42,7 @@ class SpringCloudFunctionRequestPostProcessor
|
|||||||
static final Dependency WEB_ADAPTER = Dependency.withId("cloud-function-web",
|
static final Dependency WEB_ADAPTER = Dependency.withId("cloud-function-web",
|
||||||
"org.springframework.cloud", "spring-cloud-function-web");
|
"org.springframework.cloud", "spring-cloud-function-web");
|
||||||
|
|
||||||
static final Version BOOT_21 = Version.parse("2.1.0.x");
|
static final Version VERSION_2_1_0_M1 = Version.parse("2.1.0.M1");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postProcessAfterResolution(ProjectRequest request,
|
public void postProcessAfterResolution(ProjectRequest request,
|
||||||
@@ -58,7 +58,7 @@ class SpringCloudFunctionRequestPostProcessor
|
|||||||
swap.add(WEB_ADAPTER);
|
swap.add(WEB_ADAPTER);
|
||||||
}
|
}
|
||||||
if (hasDependency(request, "webflux")
|
if (hasDependency(request, "webflux")
|
||||||
&& Version.parse(request.getBootVersion()).compareTo(BOOT_21) >= 0) {
|
&& isSpringBootVersionAtLeastAfter(request, VERSION_2_1_0_M1)) {
|
||||||
swap.add(WEB_ADAPTER);
|
swap.add(WEB_ADAPTER);
|
||||||
}
|
}
|
||||||
if (!swap.isEmpty()) {
|
if (!swap.isEmpty()) {
|
||||||
|
|||||||
+8
@@ -71,4 +71,12 @@ public class SpringCloudFunctionRequestPostProcessorTests
|
|||||||
.hasDependenciesCount(4);
|
.hasDependenciesCount(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void webfluxNotAvailableIn20() {
|
||||||
|
ProjectRequest request = createProjectRequest("webflux", "cloud-function");
|
||||||
|
request.setBootVersion("2.0.5.RELEASE");
|
||||||
|
generateMavenPom(request).hasDependency(getDependency("webflux"))
|
||||||
|
.hasDependency(getDependency("cloud-function")).hasDependenciesCount(4);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user