@Override
    public boolean isActive() {
        return isActive;
    }
@Test(timeOut = 30000)
    public void handlePartitionMetadataRequestWithServiceNotReady() throws Exception {
        resetChannel();
        setChannelConnected();
        doReturn(false).when(pulsar).isRunning();
        assertTrue(channel.isActive());

        ByteBuf clientCommand = Commands.newPartitionMetadataRequest(successTopicName, 1, true);
        channel.writeInbound(clientCommand);
        Object response = getResponse();
        assertTrue(response instanceof CommandPartitionedTopicMetadataResponse);
        assertEquals(((CommandPartitionedTopicMetadataResponse) response).getError(), ServerError.ServiceNotReady);
        channel.finish();
    }