use of org.apache.dubbo.remoting.telnet.support.command.StatusTelnetHandler in project dubbo by alibaba.
the class StatusTelnetHandlerTest 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"));
StatusTelnetHandler statusTelnetHandler = new StatusTelnetHandler();
Assertions.assertNotNull(statusTelnetHandler.telnet(channel, ""));
Assertions.assertNotNull(statusTelnetHandler.telnet(channel, "-l"));
String errorPrompt = "Unsupported parameter ";
Assertions.assertTrue(statusTelnetHandler.telnet(channel, "other").contains(errorPrompt));
Mockito.when(channel.getUrl()).thenReturn(URL.valueOf("dubbo://127.0.0.1:12345?status=load,memory"));
Assertions.assertNotNull(statusTelnetHandler.telnet(channel, ""));
Assertions.assertNotNull(statusTelnetHandler.telnet(channel, "-l"));
}
Aggregations