Skip to content

Commit

Permalink
Fix code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
patrox committed Apr 4, 2024
1 parent 778d533 commit e5852d0
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,16 @@ private RunningDevService startMongo(DockerStatusBuildItem dockerStatusBuildItem
timeout.ifPresent(mongoDBContainer::withStartupTimeout);
mongoDBContainer.withEnv(capturedProperties.containerEnv);
mongoDBContainer.start();
final String effectiveUrl = getEffectiveUrl(configPrefix, mongoDBContainer.getHost(), mongoDBContainer.getMappedPort(MONGO_EXPOSED_PORT), capturedProperties);
final String effectiveUrl = getEffectiveUrl(configPrefix, mongoDBContainer.getHost(),
mongoDBContainer.getMappedPort(MONGO_EXPOSED_PORT), capturedProperties);
return new RunningDevService(Feature.MONGODB_CLIENT.getName(), mongoDBContainer.getContainerId(),
mongoDBContainer::close, getConfigPrefix(connectionName) + "connection-string", effectiveUrl);
};

return mongoContainerLocator.locateContainer(capturedProperties.serviceName(), capturedProperties.shared(), launchMode)
.map(containerAddress -> {
final String effectiveUrl = getEffectiveUrl(configPrefix, containerAddress.getHost(), containerAddress.getPort(), capturedProperties);
final String effectiveUrl = getEffectiveUrl(configPrefix, containerAddress.getHost(),
containerAddress.getPort(), capturedProperties);

return new RunningDevService(Feature.MONGODB_CLIENT.getName(), containerAddress.getId(),
null, getConfigPrefix(connectionName) + "connection-string", effectiveUrl);
Expand All @@ -211,10 +213,10 @@ private String getEffectiveUrl(String configPrefix, String host, int port, Captu
if ((capturedProperties.connectionProperties != null) && !capturedProperties.connectionProperties.isEmpty()) {
effectiveUrl = effectiveUrl + "?"
+ URLEncodedUtils.format(
capturedProperties.connectionProperties.entrySet().stream()
.map(e -> new BasicNameValuePair(e.getKey(), e.getValue()))
.collect(Collectors.toList()),
StandardCharsets.UTF_8);
capturedProperties.connectionProperties.entrySet().stream()
.map(e -> new BasicNameValuePair(e.getKey(), e.getValue()))
.collect(Collectors.toList()),
StandardCharsets.UTF_8);
}
return effectiveUrl;
}
Expand Down

0 comments on commit e5852d0

Please sign in to comment.