Skip to content

Commit

Permalink
fix(store): fix NPE in ReviveServiceTest
Browse files Browse the repository at this point in the history
1. fix NPE in ReviveServiceTest

Signed-off-by: TheR1sing3un <[email protected]>
  • Loading branch information
TheR1sing3un committed Oct 12, 2023
1 parent a1f0445 commit 8aceb57
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.automq.rocketmq.store.service.api.KVService;
import com.automq.rocketmq.store.service.api.OperationLogService;
import com.automq.rocketmq.store.util.SerializeUtil;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -84,7 +85,7 @@ public void setUp() throws StoreException {
logicQueue = new StreamLogicQueue(new StoreConfig(), TOPIC_ID, QUEUE_ID,
metadataService, stateMachine, streamStore, operationLogService, inflightService);
TopicQueueManager manager = Mockito.mock(TopicQueueManager.class);
Mockito.when(manager.getOrCreate(TOPIC_ID, QUEUE_ID)).thenReturn(CompletableFuture.completedFuture(logicQueue));
Mockito.when(manager.get(TOPIC_ID, QUEUE_ID)).thenReturn(CompletableFuture.completedFuture(Optional.of(logicQueue)));
reviveService = new ReviveService(KV_NAMESPACE_CHECK_POINT, KV_NAMESPACE_TIMER_TAG, kvService, metadataService, inflightService, manager);
logicQueue.open().join();
}
Expand Down

0 comments on commit 8aceb57

Please sign in to comment.