You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by cs...@apache.org on 2019/01/06 17:54:24 UTC
[aries-journaled-events] branch master updated: ARIES-1881 - Fixed
indents and test scope
This is an automated email from the ASF dual-hosted git repository.
cschneider pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/aries-journaled-events.git
The following commit(s) were added to refs/heads/master by this push:
new 57eca0b ARIES-1881 - Fixed indents and test scope
57eca0b is described below
commit 57eca0b013211e88c72c0cfe7aafa6fe81554e23
Author: Christian Schneider <cs...@adobe.com>
AuthorDate: Sun Jan 6 18:54:15 2019 +0100
ARIES-1881 - Fixed indents and test scope
---
.../org/apache/aries/events/mongo/MongoMessaging.java | 18 ++++++++----------
pom.xml | 2 ++
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MongoMessaging.java b/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MongoMessaging.java
index cde821e..454efde 100644
--- a/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MongoMessaging.java
+++ b/org.apache.aries.events.mongo/src/main/java/org/apache/aries/events/mongo/MongoMessaging.java
@@ -74,21 +74,19 @@ public class MongoMessaging implements Messaging {
// *******************************************************
private CachingFactory<String, MessageSender> senderFactory;
- private MongoEndpoint config;
private MongoClient client;
private MongoDatabase database;
@Activate
protected void activate(MongoEndpoint config) {
- this.config = config;
- MongoClientURI uri = new MongoClientURI(config.mongoUri());
- client = new MongoClient(uri);
- String dbName = Optional.ofNullable(uri.getDatabase()).orElse(DEFAULT_DB_NAME);
- this.database = client.getDatabase(dbName);
- this.senderFactory = cachingFactory(topic -> {
- MongoCollection<Document> collection = database.getCollection(topic);
- return messageSender(collection, config.maxAge());
- });
+ MongoClientURI uri = new MongoClientURI(config.mongoUri());
+ client = new MongoClient(uri);
+ String dbName = Optional.ofNullable(uri.getDatabase()).orElse(DEFAULT_DB_NAME);
+ this.database = client.getDatabase(dbName);
+ this.senderFactory = cachingFactory(topic -> {
+ MongoCollection<Document> collection = database.getCollection(topic);
+ return messageSender(collection, config.maxAge());
+ });
}
@Deactivate
diff --git a/pom.xml b/pom.xml
index 4bb8f20..821730a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,6 +97,7 @@
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.20.0</version>
+ <scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
@@ -128,6 +129,7 @@
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.hamcrest</artifactId>
<version>1.3_1</version>
+ <scope>test</scope>
</dependency>
</dependencies>