()
| 112 | } |
| 113 | |
| 114 | @Test |
| 115 | public void sendHello() throws Exception { |
| 116 | PowerMockito.doAnswer(new Answer<byte[]>() { |
| 117 | @Override |
| 118 | public byte[] answer(InvocationOnMock invocation) throws Throwable { |
| 119 | return new byte[] { 42 }; |
| 120 | } |
| 121 | }).when(sasl_client).evaluateChallenge(any(byte[].class)); |
| 122 | helper.sendHello(channel); |
| 123 | assertEquals(2, buffers.size()); |
| 124 | assertArrayEquals(new byte[] { 's', 'r', 'p', 'c', 4, 81 }, |
| 125 | buffers.get(0).array()); |
| 126 | assertArrayEquals(new byte[] { 0, 0, 0, 1, 42 }, |
| 127 | buffers.get(1).array()); |
| 128 | verify(region_client, never()).sendVersion(channel); |
| 129 | } |
| 130 | |
| 131 | @Test |
| 132 | public void sendHelloNoInitialResponse() throws Exception { |
no test coverage detected