use of io.servicecomb.core.Invocation in project java-chassis by ServiceComb.
the class InvokerUtils method syncInvoke.
public static Object syncInvoke(String microserviceName, String microserviceVersion, String transport, String schemaId, String operationName, Object[] args) {
ReferenceConfig referenceConfig = new ReferenceConfig(microserviceName, microserviceVersion, transport);
SchemaMeta schemaMeta = referenceConfig.getMicroserviceMeta().ensureFindSchemaMeta(schemaId);
Invocation invocation = InvocationFactory.forConsumer(referenceConfig, schemaMeta, operationName, args);
return syncInvoke(invocation);
}
use of io.servicecomb.core.Invocation in project java-chassis by ServiceComb.
the class TestVertxRestServer method testSetHttpRequestContext.
@Test
public void testSetHttpRequestContext() {
boolean status = false;
try {
Invocation invocation = Mockito.mock(Invocation.class);
RestServerRequestInternal restRequest = Mockito.mock(RestServerRequestInternal.class);
instance.setHttpRequestContext(invocation, restRequest);
Assert.assertNotNull(instance);
} catch (Exception e) {
status = true;
}
Assert.assertFalse(status);
}
use of io.servicecomb.core.Invocation in project java-chassis by ServiceComb.
the class TestVertxRestTransport method testSendException.
@Test
public void testSendException() {
boolean validAssert;
Invocation invocation = Mockito.mock(Invocation.class);
AsyncResponse asyncResp = Mockito.mock(AsyncResponse.class);
URIEndpointObject endpoint = Mockito.mock(URIEndpointObject.class);
Endpoint end = Mockito.mock(Endpoint.class);
Mockito.when(invocation.getEndpoint()).thenReturn(end);
Mockito.when(invocation.getEndpoint().getAddress()).thenReturn(endpoint);
try {
validAssert = true;
instance.send(invocation, asyncResp);
} catch (Exception e) {
validAssert = false;
}
Assert.assertFalse(validAssert);
}
use of io.servicecomb.core.Invocation in project java-chassis by ServiceComb.
the class TestServletHttpRequestCreator method testCreateMockParam.
@Test
public void testCreateMockParam() {
boolean status = true;
try {
HttpServletRequest httpRequest = Mockito.mock(HttpServletRequest.class);
ProducerServletHttpRequestArgMapper servletHttpRequestCreator = new ProducerServletHttpRequestArgMapper(httpRequest);
Invocation invocation = Mockito.mock(Invocation.class);
servletHttpRequestCreator.createContextArg(invocation);
} catch (Exception ex) {
status = false;
}
Assert.assertTrue(status);
}
use of io.servicecomb.core.Invocation in project java-chassis by ServiceComb.
the class TestServletRestServer method testSetHttpRequestContext.
@Test
public void testSetHttpRequestContext() {
boolean status = true;
try {
Invocation invocation = Mockito.mock(Invocation.class);
RestServerRequestInternal restRequest = Mockito.mock(RestServerRequestInternal.class);
servletRestServer.setHttpRequestContext(invocation, restRequest);
} catch (Exception exce) {
Assert.assertNotNull(exce);
status = false;
}
Assert.assertTrue(status);
}
Aggregations