You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sd...@apache.org on 2023/06/07 08:45:20 UTC

[ignite-3] branch main updated: IGNITE-19658 Fix NPE in ItMetaStorageServiceTest (#2158)

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

sdanilov pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/main by this push:
     new 620e7ead8a IGNITE-19658 Fix NPE in ItMetaStorageServiceTest (#2158)
620e7ead8a is described below

commit 620e7ead8add213a997c93cdd13b859dea250a7e
Author: Alexander Polovtcev <al...@gmail.com>
AuthorDate: Wed Jun 7 11:45:14 2023 +0300

    IGNITE-19658 Fix NPE in ItMetaStorageServiceTest (#2158)
---
 .../ignite/internal/metastorage/impl/ItMetaStorageServiceTest.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageServiceTest.java b/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageServiceTest.java
index 8768c13233..be06fc06a2 100644
--- a/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageServiceTest.java
+++ b/modules/metastorage/src/integrationTest/java/org/apache/ignite/internal/metastorage/impl/ItMetaStorageServiceTest.java
@@ -33,6 +33,7 @@ import static org.apache.ignite.internal.testframework.flow.TestFlowUtils.subscr
 import static org.apache.ignite.internal.testframework.matchers.CompletableFutureExceptionMatcher.willThrowFast;
 import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willBe;
 import static org.apache.ignite.internal.testframework.matchers.CompletableFutureMatcher.willCompleteSuccessfully;
+import static org.apache.ignite.internal.util.CursorUtils.emptyCursor;
 import static org.apache.ignite.utils.ClusterServiceTestUtils.findLocalAddresses;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.is;
@@ -628,7 +629,7 @@ public class ItMetaStorageServiceTest {
 
         ByteArray expKeyFrom = new ByteArray(new byte[]{1});
 
-        when(node.mockStorage.range(expKeyFrom.bytes(), null)).thenReturn(mock(Cursor.class));
+        when(node.mockStorage.range(expKeyFrom.bytes(), null)).thenReturn(emptyCursor());
 
         node.metaStorageService.range(expKeyFrom, null, false).subscribe(singleElementSubscriber());