This is an automated email from the ASF dual-hosted git repository.

reschke pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 8adf6aa2d9 OAK-10940: oak-jcr: improve error message when mongo test 
fixture fails (#1574)
8adf6aa2d9 is described below

commit 8adf6aa2d931e562ec8e69bf4261a250c53fe6f3
Author: Julian Reschke <[email protected]>
AuthorDate: Tue Jul 9 18:08:43 2024 +0200

    OAK-10940: oak-jcr: improve error message when mongo test fixture fails 
(#1574)
---
 .../java/org/apache/jackrabbit/oak/jcr/OakMongoNSRepositoryStub.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoNSRepositoryStub.java
 
b/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoNSRepositoryStub.java
index dcf10f54bf..7c7f3bd7c2 100644
--- 
a/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoNSRepositoryStub.java
+++ 
b/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoNSRepositoryStub.java
@@ -16,6 +16,7 @@
  */
 package org.apache.jackrabbit.oak.jcr;
 
+import java.util.Objects;
 import java.util.Properties;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
@@ -51,7 +52,7 @@ public class OakMongoNSRepositoryStub extends 
BaseRepositoryStub {
         super(settings);
         final DocumentNodeStore store;
         try {
-            this.connection = MongoUtils.getConnection();
+            this.connection = 
Objects.requireNonNull(MongoUtils.getConnection(), "Couldn't obtain 
MongoConnection.");
             store = new DocumentMK.Builder().
                     memoryCacheSize(64 * 1024 * 1024).
                     setPersistentCache("target/persistentCache,time").

Reply via email to