@Test
public void testInvokeWithIllegalMessage() throws RemotingException {

    mockChannel = mock(Channel.class);
    given(mockChannel.getAttribute("telnet.service")).willReturn(DemoService.class.getName());
    given(mockChannel.getAttribute(InvokeTelnetHandler.INVOKE_METHOD_LIST_KEY)).willReturn(methods);
    given(mockChannel.getLocalAddress()).willReturn(NetUtils.toAddress("127.0.0.1:5555"));
    given(mockChannel.getRemoteAddress()).willReturn(NetUtils.toAddress("127.0.0.1:20886"));
    registerProvider(DemoService.class.getName(), new DemoServiceImpl(), DemoService.class);
    String result = select.telnet(mockChannel, "index");
    assertTrue(result.contains("Illegal index ,please input select 1"));
    result = select.telnet(mockChannel, "0");
    assertTrue(result.contains("Illegal index ,please input select 1"));
    result = select.telnet(mockChannel, "1000");
    assertTrue(result.contains("Illegal index ,please input select 1"));
}