public HARuntimeInfo getBrokerHAStatus(final String brokerAddr, final long timeoutMillis)
        throws RemotingConnectException, RemotingSendRequestException, RemotingTimeoutException,
        InterruptedException, MQBrokerException {
        RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_BROKER_HA_STATUS, null);
        RemotingCommand response = this.remotingClient.invokeSync(brokerAddr, request, timeoutMillis);
        assert response != null;

        switch (response.getCode()) {
            case ResponseCode.SUCCESS: {
                return HARuntimeInfo.decode(response.getBody(), HARuntimeInfo.class);
            }
            default:
                break;
        }

        throw new MQBrokerException(response.getCode(), response.getRemark());
    }
@Test
    public void assertGetBrokerHAStatus() throws RemotingException, InterruptedException, MQBrokerException {
        mockInvokeSync();
        HARuntimeInfo responseBody = new HARuntimeInfo();
        responseBody.setMaster(true);
        responseBody.setMasterCommitLogMaxOffset(1L);
        setResponseBody(responseBody);
        HARuntimeInfo actual = mqClientAPI.getBrokerHAStatus(defaultBrokerAddr, defaultTimeout);
        assertNotNull(actual);
        assertEquals(1L, actual.getMasterCommitLogMaxOffset());
        assertTrue(actual.isMaster());
    }