use of io.servicecomb.core.AsyncResponse in project java-chassis by ServiceComb.
the class TestVertxPostMethod method testVertxPostMethod.
@Test
public void testVertxPostMethod() {
Invocation invocation = Mockito.mock(Invocation.class);
HttpClient client = Mockito.mock(HttpClient.class);
IpPort ipPort = Mockito.mock(IpPort.class);
RestOperationMeta operation = Mockito.mock(RestOperationMeta.class);
AsyncResponse asyncResp = Mockito.mock(AsyncResponse.class);
Mockito.when(ipPort.getPort()).thenReturn(23);
assertEquals(23, ipPort.getPort());
Mockito.when(ipPort.getHostOrIp()).thenReturn("testCall");
assertNotNull("testCall", ipPort.getHostOrIp());
HttpClientRequest obj = VertxPostMethod.INSTANCE.createRequest(client, invocation, ipPort, "test", operation, asyncResp);
Assert.assertNull(obj);
}
use of io.servicecomb.core.AsyncResponse in project java-chassis by ServiceComb.
the class TestServletRestTransport method testSendException.
@Test
public void testSendException() {
boolean status = true;
Invocation invocation = Mockito.mock(Invocation.class);
AsyncResponse asyncResp = Mockito.mock(AsyncResponse.class);
URIEndpointObject endpoint = Mockito.mock(URIEndpointObject.class);
Endpoint endpoint1 = Mockito.mock(Endpoint.class);
Mockito.when(invocation.getEndpoint()).thenReturn(endpoint1);
Mockito.when(invocation.getEndpoint().getAddress()).thenReturn(endpoint);
try {
transport.send(invocation, asyncResp);
} catch (Exception exce) {
Assert.assertNotNull(exce);
status = false;
}
Assert.assertFalse(status);
}
Aggregations