Skip to content

Commit 6d55b68

Browse files
committed
Merge pull request #28543 from juherr
* pr/28543: Polish "Upgrade to Embedded Mongo 3.2.5" Upgrade to Embedded Mongo 3.2.5 Closes gh-28543
2 parents c5817f2 + f26bee1 commit 6d55b68

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfiguration.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,7 +37,7 @@
3737
import de.flapdoodle.embed.mongo.distribution.Version;
3838
import de.flapdoodle.embed.mongo.distribution.Versions;
3939
import de.flapdoodle.embed.process.config.RuntimeConfig;
40-
import de.flapdoodle.embed.process.config.io.ProcessOutput;
40+
import de.flapdoodle.embed.process.config.process.ProcessOutput;
4141
import de.flapdoodle.embed.process.config.store.DownloadConfig;
4242
import de.flapdoodle.embed.process.config.store.ImmutableDownloadConfig;
4343
import de.flapdoodle.embed.process.distribution.Version.GenericVersion;
@@ -138,8 +138,8 @@ public MongodConfig embeddedMongoConfiguration(EmbeddedMongoProperties embeddedP
138138
builder.net(new Net(getHost().getHostAddress(), configuredPort, Network.localhostIsIPv6()));
139139
}
140140
else {
141-
builder.net(new Net(getHost().getHostAddress(), Network.getFreeServerPort(getHost()),
142-
Network.localhostIsIPv6()));
141+
builder.net(
142+
new Net(getHost().getHostAddress(), Network.freeServerPort(getHost()), Network.localhostIsIPv6()));
143143
}
144144
return builder.build();
145145
}
@@ -204,9 +204,9 @@ static class RuntimeConfigConfiguration {
204204
RuntimeConfig embeddedMongoRuntimeConfig(
205205
ObjectProvider<DownloadConfigBuilderCustomizer> downloadConfigBuilderCustomizers) {
206206
Logger logger = LoggerFactory.getLogger(getClass().getPackage().getName() + ".EmbeddedMongo");
207-
ProcessOutput processOutput = new ProcessOutput(Processors.logTo(logger, Slf4jLevel.INFO),
208-
Processors.logTo(logger, Slf4jLevel.ERROR),
209-
Processors.named("[console>]", Processors.logTo(logger, Slf4jLevel.DEBUG)));
207+
ProcessOutput processOutput = ProcessOutput.builder().output(Processors.logTo(logger, Slf4jLevel.INFO))
208+
.error(Processors.logTo(logger, Slf4jLevel.ERROR))
209+
.commands(Processors.named("[console>]", Processors.logTo(logger, Slf4jLevel.DEBUG))).build();
210210
return Defaults.runtimeConfigFor(Command.MongoD, logger).processOutput(processOutput)
211211
.artifactStore(getArtifactStore(logger, downloadConfigBuilderCustomizers.orderedStream()))
212212
.isDaemonProcess(false).build();

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/embedded/EmbeddedMongoAutoConfigurationTests.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -98,11 +98,7 @@ void customUnknownVersion() {
9898

9999
@Test
100100
void customFeatures() {
101-
EnumSet<Feature> features = EnumSet.of(Feature.TEXT_SEARCH, Feature.SYNC_DELAY, Feature.ONLY_WITH_SSL,
102-
Feature.NO_HTTP_INTERFACE_ARG);
103-
if (isWindows()) {
104-
features.add(Feature.ONLY_WINDOWS_2008_SERVER);
105-
}
101+
EnumSet<Feature> features = EnumSet.of(Feature.TEXT_SEARCH, Feature.SYNC_DELAY, Feature.NO_HTTP_INTERFACE_ARG);
106102
loadWithValidVersion("spring.mongodb.embedded.features="
107103
+ features.stream().map(Feature::name).collect(Collectors.joining(", ")));
108104
assertThat(this.context.getBean(EmbeddedMongoProperties.class).getFeatures())
@@ -242,10 +238,6 @@ private void loadWithValidVersion(Class<?> config, String... environment) {
242238
this.context = ctx;
243239
}
244240

245-
private boolean isWindows() {
246-
return File.separatorChar == '\\';
247-
}
248-
249241
private int getPort(MongoClient client) {
250242
return client.getClusterDescription().getClusterSettings().getHosts().get(0).getPort();
251243
}

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ bom {
307307
]
308308
}
309309
}
310-
library("Embedded Mongo", "3.0.0") {
310+
library("Embedded Mongo", "3.2.5") {
311311
group("de.flapdoodle.embed") {
312312
modules = [
313313
"de.flapdoodle.embed.mongo"

0 commit comments

Comments
 (0)