use of org.apache.servicecomb.foundation.vertx.client.tcp.AbstractTcpClientPackage in project incubator-servicecomb-java-chassis by apache.
the class TestHighwayClient method testSend_success_decode_failed.
@Test
public void testSend_success_decode_failed(@Mocked Vertx vertx, @Mocked HighwayClientConnectionPool pool, @Mocked HighwayClientConnection tcpClient) throws Exception {
new MockUp<HighwayClientConnection>() {
@Mock
void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) {
callback.success(null);
}
};
Object result = doTestSend(vertx, pool, tcpClient, new InvocationException(Status.BAD_REQUEST, (Object) "failed"));
Assert.assertEquals("failed", ((InvocationException) result).getErrorData());
}
use of org.apache.servicecomb.foundation.vertx.client.tcp.AbstractTcpClientPackage in project incubator-servicecomb-java-chassis by apache.
the class TestHighwayClient method testSend_failed.
@Test
public void testSend_failed(@Mocked Vertx vertx, @Mocked HighwayClientConnectionPool pool, @Mocked HighwayClientConnection tcpClient) throws Exception {
new MockUp<HighwayClientConnection>() {
@Mock
void send(AbstractTcpClientPackage tcpClientPackage, TcpResponseCallback callback) {
callback.fail(new InvocationException(Status.BAD_REQUEST, (Object) "failed"));
}
};
Object result = doTestSend(vertx, pool, tcpClient, null);
Assert.assertEquals("failed", ((InvocationException) result).getErrorData());
}
Aggregations