use of org.apache.dubbo.remoting.telnet.support.command.HelpTelnetHandler in project dubbo by alibaba.
the class HelpTelnetHandlerTest method test.
@Test
public void test() {
Channel channel = Mockito.mock(Channel.class);
Mockito.when(channel.getUrl()).thenReturn(URL.valueOf("dubbo://127.0.0.1:12345"));
HelpTelnetHandler helpTelnetHandler = new HelpTelnetHandler();
// default output
String prompt = "Please input \"help [command]\" show detail.\r\n";
Assertions.assertTrue(helpTelnetHandler.telnet(channel, "").contains(prompt));
// "help" command output
String demoOutput = "Command:\r\n" + " help [command]\r\n" + "Summary:\r\n" + " Show help.\r\n" + "Detail:\r\n" + " Show help.";
Assertions.assertEquals(helpTelnetHandler.telnet(channel, "help"), demoOutput);
}
Aggregations