test(broker): fix conflicts in test after rebase

1. fix conflicts in test after rebase
This commit is contained in:
TheR1sing3un
2023-03-14 09:40:15 +08:00
committed by rongtong
parent d802231163
commit dcf51d715c
2 changed files with 6 additions and 0 deletions
@@ -20,6 +20,7 @@ package org.apache.rocketmq.broker.controller;
import org.apache.rocketmq.broker.BrokerController;
import org.apache.rocketmq.broker.out.BrokerOuterAPI;
import org.apache.rocketmq.broker.slave.SlaveSynchronize;
import org.apache.rocketmq.broker.topic.TopicConfigManager;
import org.apache.rocketmq.common.BrokerConfig;
import org.apache.rocketmq.common.UtilAll;
import org.apache.rocketmq.remoting.protocol.header.controller.ElectMasterResponseHeader;
@@ -105,9 +106,11 @@ public class ReplicasManagerRegisterTest {
this.mockedMessageStore = Mockito.mock(DefaultMessageStore.class);
this.mockedBrokerOuterAPI = Mockito.mock(BrokerOuterAPI.class);
this.mockedAutoSwitchHAService = Mockito.mock(AutoSwitchHAService.class);
TopicConfigManager mockedTopicConfigManager = new TopicConfigManager();
when(mockedBrokerController.getBrokerOuterAPI()).thenReturn(mockedBrokerOuterAPI);
when(mockedBrokerController.getMessageStore()).thenReturn(mockedMessageStore);
when(mockedBrokerController.getBrokerConfig()).thenReturn(BROKER_CONFIG);
when(mockedBrokerController.getTopicConfigManager()).thenReturn(mockedTopicConfigManager);
when(mockedMessageStore.getHaService()).thenReturn(mockedAutoSwitchHAService);
when(mockedBrokerController.getSlaveSynchronize()).thenReturn(new SlaveSynchronize(mockedBrokerController));
@@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.rocketmq.broker.BrokerController;
import org.apache.rocketmq.broker.out.BrokerOuterAPI;
import org.apache.rocketmq.broker.slave.SlaveSynchronize;
import org.apache.rocketmq.broker.topic.TopicConfigManager;
import org.apache.rocketmq.common.BrokerConfig;
import org.apache.rocketmq.common.Pair;
import org.apache.rocketmq.common.UtilAll;
@@ -139,6 +140,7 @@ public class ReplicasManagerTest {
getReplicaInfoResponseHeader.setMasterEpoch(NEW_MASTER_EPOCH);
syncStateSet = new SyncStateSet(Sets.newLinkedHashSet(SYNC_STATE), NEW_MASTER_EPOCH);
result = new Pair<>(getReplicaInfoResponseHeader, syncStateSet);
TopicConfigManager topicConfigManager = new TopicConfigManager();
when(defaultMessageStore.getMessageStoreConfig()).thenReturn(messageStoreConfig);
when(brokerController.getMessageStore()).thenReturn(defaultMessageStore);
when(brokerController.getMessageStore().getHaService()).thenReturn(autoSwitchHAService);
@@ -147,6 +149,7 @@ public class ReplicasManagerTest {
when(brokerController.getSlaveSynchronize()).thenReturn(slaveSynchronize);
when(brokerController.getBrokerOuterAPI()).thenReturn(brokerOuterAPI);
when(brokerController.getBrokerAddr()).thenReturn(OLD_MASTER_ADDRESS);
when(brokerController.getTopicConfigManager()).thenReturn(topicConfigManager);
when(brokerOuterAPI.getControllerMetaData(any())).thenReturn(getMetaDataResponseHeader);
when(brokerOuterAPI.checkAddressReachable(any())).thenReturn(true);
when(brokerOuterAPI.getNextBrokerId(any(), any(), any())).thenReturn(getNextBrokerIdResponseHeader);