use of io.pravega.shared.protocol.netty.WireCommands.ErrorMessage in project pravega by pravega.
the class RawClientTest method testRecvErrorMessage.
@Test
public void testRecvErrorMessage() {
PravegaNodeUri endpoint = new PravegaNodeUri("localhost", -1);
@Cleanup MockConnectionFactoryImpl connectionFactory = new MockConnectionFactoryImpl();
@Cleanup MockController controller = new MockController(endpoint.getEndpoint(), endpoint.getPort(), connectionFactory, true);
ClientConnection connection = Mockito.mock(ClientConnection.class);
connectionFactory.provideConnection(endpoint, connection);
Segment segment = new Segment("scope", "testHello", 0);
@Cleanup RawClient rawClient = new RawClient(controller, connectionFactory, segment);
ReplyProcessor processor = connectionFactory.getProcessor(endpoint);
WireCommands.ErrorMessage reply = new ErrorMessage(requestId, segment.getScopedName(), "error.", ErrorMessage.ErrorCode.ILLEGAL_ARGUMENT_EXCEPTION);
processor.process(reply);
Mockito.verify(connection).close();
}
Aggregations