Use Windows-specific custom features so download URI is correct
Closes gh-14690
This commit is contained in:
parent
bdd8e53124
commit
4d1fc196de
|
@ -17,6 +17,8 @@
|
||||||
package org.springframework.boot.autoconfigure.mongo.embedded;
|
package org.springframework.boot.autoconfigure.mongo.embedded;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.mongodb.MongoClient;
|
import com.mongodb.MongoClient;
|
||||||
import de.flapdoodle.embed.mongo.config.IMongodConfig;
|
import de.flapdoodle.embed.mongo.config.IMongodConfig;
|
||||||
|
@ -70,10 +72,15 @@ public class EmbeddedMongoAutoConfigurationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void customFeatures() {
|
public void customFeatures() {
|
||||||
load("spring.mongodb.embedded.features=TEXT_SEARCH, SYNC_DELAY, ONLY_WITH_SSL, NO_HTTP_INTERFACE_ARG");
|
EnumSet<Feature> features = EnumSet.of(Feature.TEXT_SEARCH, Feature.SYNC_DELAY,
|
||||||
|
Feature.ONLY_WITH_SSL, Feature.NO_HTTP_INTERFACE_ARG);
|
||||||
|
if (isWindows()) {
|
||||||
|
features.add(Feature.ONLY_WINDOWS_2008_SERVER);
|
||||||
|
}
|
||||||
|
load("spring.mongodb.embedded.features=" + String.join(", ",
|
||||||
|
features.stream().map(Feature::name).collect(Collectors.toList())));
|
||||||
assertThat(this.context.getBean(EmbeddedMongoProperties.class).getFeatures())
|
assertThat(this.context.getBean(EmbeddedMongoProperties.class).getFeatures())
|
||||||
.containsExactly(Feature.TEXT_SEARCH, Feature.SYNC_DELAY,
|
.containsExactlyElementsOf(features);
|
||||||
Feature.ONLY_WITH_SSL, Feature.NO_HTTP_INTERFACE_ARG);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -193,6 +200,10 @@ public class EmbeddedMongoAutoConfigurationTests {
|
||||||
this.context = ctx;
|
this.context = ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isWindows() {
|
||||||
|
return File.separatorChar == '\\';
|
||||||
|
}
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
static class MongoClientConfiguration {
|
static class MongoClientConfiguration {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue