Merge branch '2.7.x'

This commit is contained in:
Stephane Nicoll 2022-01-04 08:40:15 +01:00
commit e378705383
3 changed files with 10 additions and 18 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2021 the original author or authors. * Copyright 2012-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -37,7 +37,7 @@ import de.flapdoodle.embed.mongo.distribution.IFeatureAwareVersion;
import de.flapdoodle.embed.mongo.distribution.Version; import de.flapdoodle.embed.mongo.distribution.Version;
import de.flapdoodle.embed.mongo.distribution.Versions; import de.flapdoodle.embed.mongo.distribution.Versions;
import de.flapdoodle.embed.process.config.RuntimeConfig; import de.flapdoodle.embed.process.config.RuntimeConfig;
import de.flapdoodle.embed.process.config.io.ProcessOutput; import de.flapdoodle.embed.process.config.process.ProcessOutput;
import de.flapdoodle.embed.process.config.store.DownloadConfig; import de.flapdoodle.embed.process.config.store.DownloadConfig;
import de.flapdoodle.embed.process.config.store.ImmutableDownloadConfig; import de.flapdoodle.embed.process.config.store.ImmutableDownloadConfig;
import de.flapdoodle.embed.process.distribution.Version.GenericVersion; import de.flapdoodle.embed.process.distribution.Version.GenericVersion;
@ -138,8 +138,8 @@ public class EmbeddedMongoAutoConfiguration {
builder.net(new Net(getHost().getHostAddress(), configuredPort, Network.localhostIsIPv6())); builder.net(new Net(getHost().getHostAddress(), configuredPort, Network.localhostIsIPv6()));
} }
else { else {
builder.net(new Net(getHost().getHostAddress(), Network.getFreeServerPort(getHost()), builder.net(
Network.localhostIsIPv6())); new Net(getHost().getHostAddress(), Network.freeServerPort(getHost()), Network.localhostIsIPv6()));
} }
return builder.build(); return builder.build();
} }
@ -204,9 +204,9 @@ public class EmbeddedMongoAutoConfiguration {
RuntimeConfig embeddedMongoRuntimeConfig( RuntimeConfig embeddedMongoRuntimeConfig(
ObjectProvider<DownloadConfigBuilderCustomizer> downloadConfigBuilderCustomizers) { ObjectProvider<DownloadConfigBuilderCustomizer> downloadConfigBuilderCustomizers) {
Logger logger = LoggerFactory.getLogger(getClass().getPackage().getName() + ".EmbeddedMongo"); Logger logger = LoggerFactory.getLogger(getClass().getPackage().getName() + ".EmbeddedMongo");
ProcessOutput processOutput = new ProcessOutput(Processors.logTo(logger, Slf4jLevel.INFO), ProcessOutput processOutput = ProcessOutput.builder().output(Processors.logTo(logger, Slf4jLevel.INFO))
Processors.logTo(logger, Slf4jLevel.ERROR), .error(Processors.logTo(logger, Slf4jLevel.ERROR))
Processors.named("[console>]", Processors.logTo(logger, Slf4jLevel.DEBUG))); .commands(Processors.named("[console>]", Processors.logTo(logger, Slf4jLevel.DEBUG))).build();
return Defaults.runtimeConfigFor(Command.MongoD, logger).processOutput(processOutput) return Defaults.runtimeConfigFor(Command.MongoD, logger).processOutput(processOutput)
.artifactStore(getArtifactStore(logger, downloadConfigBuilderCustomizers.orderedStream())) .artifactStore(getArtifactStore(logger, downloadConfigBuilderCustomizers.orderedStream()))
.isDaemonProcess(false).build(); .isDaemonProcess(false).build();

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2021 the original author or authors. * Copyright 2012-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -98,11 +98,7 @@ class EmbeddedMongoAutoConfigurationTests {
@Test @Test
void customFeatures() { void customFeatures() {
EnumSet<Feature> features = EnumSet.of(Feature.TEXT_SEARCH, Feature.SYNC_DELAY, Feature.ONLY_WITH_SSL, EnumSet<Feature> features = EnumSet.of(Feature.TEXT_SEARCH, Feature.SYNC_DELAY, Feature.NO_HTTP_INTERFACE_ARG);
Feature.NO_HTTP_INTERFACE_ARG);
if (isWindows()) {
features.add(Feature.ONLY_WINDOWS_2008_SERVER);
}
loadWithValidVersion("spring.mongodb.embedded.features=" loadWithValidVersion("spring.mongodb.embedded.features="
+ features.stream().map(Feature::name).collect(Collectors.joining(", "))); + features.stream().map(Feature::name).collect(Collectors.joining(", ")));
assertThat(this.context.getBean(EmbeddedMongoProperties.class).getFeatures()) assertThat(this.context.getBean(EmbeddedMongoProperties.class).getFeatures())
@ -242,10 +238,6 @@ class EmbeddedMongoAutoConfigurationTests {
this.context = ctx; this.context = ctx;
} }
private boolean isWindows() {
return File.separatorChar == '\\';
}
private int getPort(MongoClient client) { private int getPort(MongoClient client) {
return client.getClusterDescription().getClusterSettings().getHosts().get(0).getPort(); return client.getClusterDescription().getClusterSettings().getHosts().get(0).getPort();
} }

View File

@ -211,7 +211,7 @@ bom {
] ]
} }
} }
library("Embedded Mongo", "3.0.0") { library("Embedded Mongo", "3.2.5") {
group("de.flapdoodle.embed") { group("de.flapdoodle.embed") {
modules = [ modules = [
"de.flapdoodle.embed.mongo" "de.flapdoodle.embed.mongo"