OAK-10016: avoid use of deprecated Mockito methods (removed in 4.*)
diff --git a/oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/datastore/DataStoreBlobStoreTest.java b/oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/datastore/DataStoreBlobStoreTest.java
index b63704b..687d40c 100644
--- a/oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/datastore/DataStoreBlobStoreTest.java
+++ b/oak-blob-plugins/src/test/java/org/apache/jackrabbit/oak/plugins/blob/datastore/DataStoreBlobStoreTest.java
@@ -54,7 +54,7 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
diff --git a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/IndexInfoServiceImplTest.java b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/IndexInfoServiceImplTest.java
index 1e65bd7..5f1a74b 100644
--- a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/IndexInfoServiceImplTest.java
+++ b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/IndexInfoServiceImplTest.java
@@ -35,7 +35,7 @@
import org.junit.Test;
import static org.junit.Assert.*;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
diff --git a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/progress/NodeCounterMBeanEstimatorTest.java b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/progress/NodeCounterMBeanEstimatorTest.java
index 88ca7e5..a9e778c 100644
--- a/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/progress/NodeCounterMBeanEstimatorTest.java
+++ b/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/progress/NodeCounterMBeanEstimatorTest.java
@@ -36,7 +36,7 @@
import static org.apache.jackrabbit.oak.spi.filter.PathFilter.PROP_EXCLUDED_PATHS;
import static org.apache.jackrabbit.oak.spi.filter.PathFilter.PROP_INCLUDED_PATHS;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
diff --git a/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/composite/CompositeAccessControlManagerTest.java b/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/composite/CompositeAccessControlManagerTest.java
index c54891e..2baef9f 100644
--- a/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/composite/CompositeAccessControlManagerTest.java
+++ b/oak-core/src/test/java/org/apache/jackrabbit/oak/security/authorization/composite/CompositeAccessControlManagerTest.java
@@ -60,7 +60,7 @@
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.withSettings;
@@ -317,7 +317,7 @@
JackrabbitAccessControlPolicy[] applicable = composite.getApplicablePolicies(EveryonePrincipal.getInstance());
assertEquals(0, applicable.length);
- verifyZeroInteractions(mgr);
+ verifyNoInteractions(mgr);
}
@Test
@@ -340,7 +340,7 @@
CompositeAccessControlManager composite = createComposite(mgr);
assertEquals(0, composite.getPolicies(EveryonePrincipal.getInstance()).length);
- verifyZeroInteractions(mgr);
+ verifyNoInteractions(mgr);
}
@Test
@@ -375,7 +375,7 @@
CompositeAccessControlManager composite = createComposite(mgr);
assertEquals(0, composite.getEffectivePolicies(principalSet).length);
- verifyZeroInteractions(mgr);
+ verifyNoInteractions(mgr);
}
@Test
diff --git a/oak-it-osgi/src/test/config/org.apache.jackrabbit.oak.jcr.osgi.RepositoryManager.cfg b/oak-it-osgi/src/test/config/org.apache.jackrabbit.oak.jcr.osgi.RepositoryManager.cfg
index 9de8f50..f8181f9 100644
--- a/oak-it-osgi/src/test/config/org.apache.jackrabbit.oak.jcr.osgi.RepositoryManager.cfg
+++ b/oak-it-osgi/src/test/config/org.apache.jackrabbit.oak.jcr.osgi.RepositoryManager.cfg
@@ -1,15 +1,15 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#Empty config to trigger default setup
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#Empty config to trigger default setup
diff --git a/oak-it-osgi/src/test/config/org.apache.jackrabbit.oak.segment.SegmentNodeStoreService.cfg b/oak-it-osgi/src/test/config/org.apache.jackrabbit.oak.segment.SegmentNodeStoreService.cfg
index d052694..ccc6a4f 100644
--- a/oak-it-osgi/src/test/config/org.apache.jackrabbit.oak.segment.SegmentNodeStoreService.cfg
+++ b/oak-it-osgi/src/test/config/org.apache.jackrabbit.oak.segment.SegmentNodeStoreService.cfg
@@ -1,16 +1,16 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-name=Oak
-repository.home=target/tarmk
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+name=Oak
+repository.home=target/tarmk
diff --git a/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java b/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
index cc953fd..a99936a 100644
--- a/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
+++ b/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
@@ -101,7 +101,7 @@
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
-import org.mockito.Matchers;
+import org.mockito.ArgumentMatchers;
import org.slf4j.LoggerFactory;
public class RepositoryTest extends AbstractRepositoryTest {
diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexTrackerTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexTrackerTest.java
index 12271c5..681924c 100644
--- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexTrackerTest.java
+++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexTrackerTest.java
@@ -50,7 +50,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ExternalIndexObserverTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ExternalIndexObserverTest.java
index 345e408..863ab52 100644
--- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ExternalIndexObserverTest.java
+++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ExternalIndexObserverTest.java
@@ -42,9 +42,9 @@
import static org.apache.jackrabbit.oak.InitialContentHelper.INITIAL_CONTENT;
import static org.apache.jackrabbit.oak.stats.StatisticsProvider.NOOP;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
public class ExternalIndexObserverTest {
@@ -69,20 +69,20 @@
@Test
public void internalChange() throws Exception {
observer.contentChanged(INITIAL_CONTENT, CommitInfo.EMPTY);
- verifyZeroInteractions(queue);
+ verifyNoInteractions(queue);
}
@Test
public void externalChangeNullContext() throws Exception {
observer.contentChanged(INITIAL_CONTENT, CommitInfo.EMPTY_EXTERNAL);
- verifyZeroInteractions(queue);
+ verifyNoInteractions(queue);
}
@Test
public void emptyCommitContext() throws Exception {
CommitInfo ci = newCommitInfo();
observer.contentChanged(INITIAL_CONTENT, ci);
- verifyZeroInteractions(queue);
+ verifyNoInteractions(queue);
}
@Test
@@ -95,7 +95,7 @@
CommitInfo ci = newCommitInfo();
observer.contentChanged(INITIAL_CONTENT, ci);
- verifyZeroInteractions(queue);
+ verifyNoInteractions(queue);
}
@Test
@@ -108,7 +108,7 @@
CommitInfo ci = newCommitInfo();
when(tracker.getIndexDefinition("/oak:index/foo")).thenReturn(createNRTIndex("nt:base"));
observer.contentChanged(INITIAL_CONTENT, ci);
- verifyZeroInteractions(queue);
+ verifyNoInteractions(queue);
}
@Test
@@ -126,7 +126,7 @@
nb.child("a");
observer.contentChanged(nb.getNodeState(), ci);
- verifyZeroInteractions(queue);
+ verifyNoInteractions(queue);
}
@Test
@@ -144,7 +144,7 @@
nb.child("a");
observer.contentChanged(nb.getNodeState(), ci);
- verifyZeroInteractions(queue);
+ verifyNoInteractions(queue);
}
@Test
@@ -178,7 +178,7 @@
new ExternalObserverBuilder(queue, tracker,NOOP, MoreExecutors.sameThreadExecutor(), 10);
Observer o = builder.build();
o.contentChanged(INITIAL_CONTENT, CommitInfo.EMPTY_EXTERNAL);
- verifyZeroInteractions(queue);
+ verifyNoInteractions(queue);
}
@Test
diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/LuceneJournalPropertyBuilderTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/LuceneJournalPropertyBuilderTest.java
index 45c1b7f..e683020 100644
--- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/LuceneJournalPropertyBuilderTest.java
+++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/LuceneJournalPropertyBuilderTest.java
@@ -28,7 +28,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
diff --git a/oak-run-commons/src/test/java/org/apache/jackrabbit/oak/run/cli/DocumentFixtureTest.java b/oak-run-commons/src/test/java/org/apache/jackrabbit/oak/run/cli/DocumentFixtureTest.java
index c25c154..63350fb 100644
--- a/oak-run-commons/src/test/java/org/apache/jackrabbit/oak/run/cli/DocumentFixtureTest.java
+++ b/oak-run-commons/src/test/java/org/apache/jackrabbit/oak/run/cli/DocumentFixtureTest.java
@@ -38,7 +38,7 @@
import static java.util.Collections.emptyMap;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
diff --git a/oak-run-commons/src/test/java/org/apache/jackrabbit/oak/run/cli/SegmentTarFixtureTest.java b/oak-run-commons/src/test/java/org/apache/jackrabbit/oak/run/cli/SegmentTarFixtureTest.java
index fc00d1e..1b11cf4 100644
--- a/oak-run-commons/src/test/java/org/apache/jackrabbit/oak/run/cli/SegmentTarFixtureTest.java
+++ b/oak-run-commons/src/test/java/org/apache/jackrabbit/oak/run/cli/SegmentTarFixtureTest.java
@@ -20,7 +20,7 @@
import static java.util.Collections.emptyMap;
import static org.apache.jackrabbit.oak.segment.file.FileStoreBuilder.fileStoreBuilder;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
diff --git a/oak-search-mt/src/test/java/org/apache/jackrabbit/oak/plugins/index/mt/MTFulltextQueryTermsProviderTest.java b/oak-search-mt/src/test/java/org/apache/jackrabbit/oak/plugins/index/mt/MTFulltextQueryTermsProviderTest.java
index 66503f3..0b822c0 100644
--- a/oak-search-mt/src/test/java/org/apache/jackrabbit/oak/plugins/index/mt/MTFulltextQueryTermsProviderTest.java
+++ b/oak-search-mt/src/test/java/org/apache/jackrabbit/oak/plugins/index/mt/MTFulltextQueryTermsProviderTest.java
@@ -32,7 +32,7 @@
import org.apache.lucene.analysis.Analyzer;
import org.junit.Test;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
diff --git a/oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/search/ExtractedTextCacheTest.java b/oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/search/ExtractedTextCacheTest.java
index aafff29..c4ab730 100644
--- a/oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/search/ExtractedTextCacheTest.java
+++ b/oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/search/ExtractedTextCacheTest.java
@@ -37,10 +37,10 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
public class ExtractedTextCacheTest {
@@ -113,7 +113,7 @@
String text = cache.get("/a", "foo", b, false);
assertNull(text);
- verifyZeroInteractions(provider);
+ verifyNoInteractions(provider);
}
@Test
diff --git a/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/ExternalBlobReferenceTest.java b/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/ExternalBlobReferenceTest.java
index 8fde1f6..164da38 100644
--- a/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/ExternalBlobReferenceTest.java
+++ b/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/ExternalBlobReferenceTest.java
@@ -21,7 +21,7 @@
import static org.apache.jackrabbit.oak.segment.file.FileStoreBuilder.fileStoreBuilder;
import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
diff --git a/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentParserTest.java b/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentParserTest.java
index ba34018..7ba79c6 100644
--- a/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentParserTest.java
+++ b/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/SegmentParserTest.java
@@ -39,7 +39,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
diff --git a/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/proc/ReferencesNodeTest.java b/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/proc/ReferencesNodeTest.java
index ff8de3f..c5460e4 100644
--- a/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/proc/ReferencesNodeTest.java
+++ b/oak-segment-tar/src/test/java/org/apache/jackrabbit/oak/segment/file/proc/ReferencesNodeTest.java
@@ -21,7 +21,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
diff --git a/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndexTest.java b/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndexTest.java
index a5ff037..55e0d5f 100644
--- a/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndexTest.java
+++ b/oak-solr-core/src/test/java/org/apache/jackrabbit/oak/plugins/index/solr/query/SolrQueryIndexTest.java
@@ -52,7 +52,7 @@
import static org.apache.jackrabbit.JcrConstants.JCR_PRIMARYTYPE;
import static org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.EMPTY_NODE;
import static org.junit.Assert.*;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;