DefaultPeerMasterChooseAction implements PeerMasterChooseAction { @Override public void choosePeerMaster(String dcId, String clusterId, String shardId) { MasterChooseCommand chooseCommand = masterChooseCommandFactory.buildPeerMasterChooserCommand(dcId, clusterId, shardId); if (null != chooseCommand) this.peerMasterChooseExecutors.execute(Pair.of(clusterId, shardId), chooseCommand); } @Autowired  DefaultPeerMasterChooseAction(MasterChooseCommandFactory masterChooseCommandFactory,
                                         @Qualifier(PEER_MASTER_CHOOSE_EXECUTOR) KeyedOneThreadTaskExecutor<Pair<String, String> > peerMasterChooseExecutors); @Override void choosePeerMaster(String dcId, String clusterId, String shardId);  }
@Test public void testChoosePeerMaster() { peerMasterChooseAction.choosePeerMaster(getDc(), getClusterId(), getShardId()); Mockito.verify(peerMasterChooseExecutors, Mockito.times(1)).execute(Pair.of(getClusterId(), getShardId()), command); }