Skip to content

Commit 62174c0

Browse files
Bruce Irschickbirschick-bq
Bruce Irschick
andauthored
[AD-512] Update flapdoodle usage to remove usage of deprecated components after upgrade of library. (#247)
### Summary [AD-512] Update flapdoodle usage to remove usage of deprecated components after upgrade of library. ### Description * Remove deprecated calls. ### Related Issue https://bitquill.atlassian.net/browse/AD-512 * [AD-512] Update flapdoodle usage to remove usage of deprecated components after upgrade of library. * [AD-512] Update flapdoodle usage to remove usage of deprecated components after upgrade of library. * Update flapdoodle version to latest. * Commit Code Coverage Badge * [AD-512] Update flapdoodle usage to remove usage of deprecated components after upgrade of library. * Update flapdoodle version to latest. * Commit Code Coverage Badge Co-authored-by: birschick-bq <[email protected]>
1 parent 02f762f commit 62174c0

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ dependencies {
314314
testCompileOnly group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1'
315315
testCompileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.16'
316316
testAnnotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.16'
317-
testImplementation group: 'de.flapdoodle.embed', name: 'de.flapdoodle.embed.mongo', version: '3.2.4'
317+
testImplementation group: 'de.flapdoodle.embed', name: 'de.flapdoodle.embed.mongo', version: '3.2.6'
318318
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
319319
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.8.1'
320320
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.8.2'

common/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ dependencies {
206206
testCompileOnly group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1'
207207

208208
testFixturesImplementation group: 'com.google.guava', name: 'guava', version: '29.0-jre'
209-
testFixturesImplementation group: 'de.flapdoodle.embed', name: 'de.flapdoodle.embed.mongo', version: '3.2.4'
209+
testFixturesImplementation group: 'de.flapdoodle.embed', name: 'de.flapdoodle.embed.mongo', version: '3.2.6'
210210
testFixturesImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
211211
testFixturesImplementation group: 'org.mongodb', name: 'mongodb-driver-sync', version: '4.1.1'
212212
testFixturesImplementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.17.1'

common/src/testFixtures/java/software/amazon/documentdb/jdbc/common/test/DocumentDbFlapDoodleExtensionBase.java

+11-8
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import de.flapdoodle.embed.mongo.config.Net;
3131
import de.flapdoodle.embed.mongo.distribution.Version.Main;
3232
import de.flapdoodle.embed.process.config.RuntimeConfig;
33-
import de.flapdoodle.embed.process.config.io.ProcessOutput;
33+
import de.flapdoodle.embed.process.config.process.ProcessOutput;
3434
import de.flapdoodle.embed.process.io.LogWatchStreamProcessor;
3535
import de.flapdoodle.embed.process.io.NamedOutputStreamProcessor;
3636
import de.flapdoodle.embed.process.io.Processors;
@@ -152,7 +152,7 @@ private ExtensionContext.Store getStore(final ExtensionContext context) {
152152
* @throws IOException if unable to start the mongod.
153153
*/
154154
protected static boolean startMongoDbInstance() throws IOException {
155-
return startMongoDbInstance(Network.getFreeServerPort());
155+
return startMongoDbInstance(Network.freeServerPort(Network.getLocalHost()));
156156
}
157157

158158
/**
@@ -171,8 +171,10 @@ protected static boolean startMongoDbInstance(final int port) throws IOException
171171
* @return returns true if the mongod is started, or false if already started.
172172
* @throws IOException if unable to start the mongod.
173173
*/
174-
protected static boolean startMongoDbInstance(final boolean enableAuthentication) throws IOException {
175-
return startMongoDbInstance(Network.getFreeServerPort(), enableAuthentication);
174+
protected static boolean startMongoDbInstance(final boolean enableAuthentication)
175+
throws IOException {
176+
return startMongoDbInstance(Network.freeServerPort(Network.getLocalHost()),
177+
enableAuthentication);
176178
}
177179

178180
/**
@@ -278,10 +280,11 @@ private static void runScriptAndWait(
278280
mongoOutput = new NamedOutputStreamProcessor("[mongo shell output]", Processors.console());
279281
}
280282
final RuntimeConfig runtimeConfig = Defaults.runtimeConfigFor(Command.Mongo)
281-
.processOutput(new ProcessOutput(
282-
mongoOutput,
283-
namedConsole("[mongo shell error]"),
284-
Processors.console()))
283+
.processOutput(ProcessOutput.builder()
284+
.output(mongoOutput)
285+
.error(Processors.namedConsole("[mongo shell error]"))
286+
.commands(Processors.console())
287+
.build())
285288
.build();
286289
final MongoShellStarter starter = MongoShellStarter.getInstance(runtimeConfig);
287290
final File scriptFile = writeTmpScriptFile(scriptText);

common/src/testFixtures/java/software/amazon/documentdb/jdbc/common/test/DocumentDbMongoTestEnvironment.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import de.flapdoodle.embed.mongo.config.Net;
3131
import de.flapdoodle.embed.mongo.distribution.Version.Main;
3232
import de.flapdoodle.embed.process.config.RuntimeConfig;
33-
import de.flapdoodle.embed.process.config.io.ProcessOutput;
33+
import de.flapdoodle.embed.process.config.process.ProcessOutput;
3434
import de.flapdoodle.embed.process.io.LogWatchStreamProcessor;
3535
import de.flapdoodle.embed.process.io.NamedOutputStreamProcessor;
3636
import de.flapdoodle.embed.process.io.Processors;
@@ -107,7 +107,7 @@ protected boolean startEnvironment() throws Exception {
107107
return false;
108108
}
109109

110-
port = Network.getFreeServerPort();
110+
port = Network.freeServerPort(Network.getLocalHost());
111111
final MongoCmdOptions cmdOptions = MongoCmdOptions.builder()
112112
.auth(enableAuthentication)
113113
.build();
@@ -226,10 +226,11 @@ private void runScriptAndWait(
226226
mongoOutput = new NamedOutputStreamProcessor("[mongo shell output]", Processors.console());
227227
}
228228
final RuntimeConfig runtimeConfig = Defaults.runtimeConfigFor(Command.Mongo)
229-
.processOutput(new ProcessOutput(
230-
mongoOutput,
231-
namedConsole("[mongo shell error]"),
232-
Processors.console()))
229+
.processOutput(ProcessOutput.builder()
230+
.output(mongoOutput)
231+
.error(Processors.namedConsole("[mongo shell error]"))
232+
.commands(Processors.console())
233+
.build())
233234
.build();
234235
final MongoShellStarter starter = MongoShellStarter.getInstance(runtimeConfig);
235236
final File scriptFile = writeTmpScriptFile(scriptText);

0 commit comments

Comments
 (0)