### Question:
MessageFetchManager { public MessageFetchManager(final ConsumerConfig consumerConfig, final SimplePushMessageConsumer pushConsumer) { this.consumerConfig = consumerConfig; this.pushConsumer = pushConsumer; } MessageFetchManager(final ConsumerConfig consumerConfig,
                               final SimplePushMessageConsumer pushConsumer); void startFetchWorkers(); boolean isShutdown(); void stopFetchWorkers(boolean onlySetStatus);  }### Answer:
@Test public void testMessageFetchManager() throws Exception { TubeClientConfig clientConfig = mock(TubeClientConfig.class); PowerMockito.mockStatic(AddressUtils.class); PowerMockito.when(AddressUtils.getLocalAddress()).thenReturn("127.0.0.1"); when(clientConfig.getMasterInfo()).thenReturn(new MasterInfo("192.168.1.1:18080")); ConsumerConfig config = new ConsumerConfig("182.168.1.2:18080", "192.168.1.1:18080", "test"); ClientFactory clientFactory = new NettyClientFactory(); TubeBaseSessionFactory factory = new TubeBaseSessionFactory(clientFactory, clientConfig); SimplePushMessageConsumer consumer = new SimplePushMessageConsumer(factory, config); MessageFetchManager fetchManager = new MessageFetchManager(config, consumer); Assert.assertFalse(fetchManager.isShutdown()); fetchManager.startFetchWorkers(); fetchManager.stopFetchWorkers(true); Assert.assertTrue(fetchManager.isShutdown()); }
@Test public void testMessageFetchManager() throws Exception { TubeClientConfig clientConfig = mock(TubeClientConfig.class); PowerMockito.mockStatic(AddressUtils.class); PowerMockito.when(AddressUtils.getLocalAddress()).thenReturn("127.0.0.1"); when(clientConfig.getMasterInfo()).thenReturn(new MasterInfo("192.168.1.1:18080")); ConsumerConfig config = new ConsumerConfig("192.168.1.1:18080", "test"); ClientFactory clientFactory = new NettyClientFactory(); TubeBaseSessionFactory factory = new TubeBaseSessionFactory(clientFactory, clientConfig); SimplePushMessageConsumer consumer = new SimplePushMessageConsumer(factory, config); MessageFetchManager fetchManager = new MessageFetchManager(config, consumer); Assert.assertFalse(fetchManager.isShutdown()); fetchManager.startFetchWorkers(); fetchManager.stopFetchWorkers(true); Assert.assertTrue(fetchManager.isShutdown()); }