use of org.apache.servicecomb.core.Invocation in project java-chassis by ServiceComb.
the class UrlPathItemTest method initStrBuilder.
@Before
public void initStrBuilder() {
accessLogEvent = new ServerAccessLogEvent();
routingContext = Mockito.mock(RoutingContext.class);
finishEvent = Mockito.mock(InvocationFinishEvent.class);
invocation = Mockito.mock(Invocation.class);
serverRequest = Mockito.mock(HttpServerRequest.class);
operationMeta = Mockito.mock(OperationMeta.class);
schemaMeta = Mockito.mock(SchemaMeta.class);
swagger = Mockito.mock(Swagger.class);
restClientRequest = Mockito.mock(RestClientRequestImpl.class);
clientRequest = Mockito.mock(HttpClientRequest.class);
accessLogEvent.setRoutingContext(routingContext);
strBuilder = new StringBuilder();
}
use of org.apache.servicecomb.core.Invocation in project java-chassis by ServiceComb.
the class UrlPathWithQueryAccessItem method appendClientFormattedItem.
@Override
public void appendClientFormattedItem(InvocationFinishEvent finishEvent, StringBuilder builder) {
Invocation invocation = finishEvent.getInvocation();
if (null == invocation || null == invocation.getLocalContext(REST_CLIENT_REQUEST_PATH) || StringUtils.isEmpty(invocation.getLocalContext(REST_CLIENT_REQUEST_PATH).toString())) {
builder.append(EMPTY_RESULT);
return;
}
builder.append(invocation.getLocalContext(REST_CLIENT_REQUEST_PATH).toString());
}
use of org.apache.servicecomb.core.Invocation in project java-chassis by ServiceComb.
the class CookieItemTest method initStrBuilder.
@Before
public void initStrBuilder() {
mockContext = Mockito.mock(RoutingContext.class);
finishEvent = Mockito.mock(InvocationFinishEvent.class);
invocation = Mockito.mock(Invocation.class);
restClientRequest = Mockito.mock(RestClientRequestImpl.class);
accessLogEvent = new ServerAccessLogEvent();
strBuilder = new StringBuilder();
}
use of org.apache.servicecomb.core.Invocation in project java-chassis by ServiceComb.
the class DurationMillisecondItemTest method initStrBuilder.
@Before
public void initStrBuilder() {
finishEvent = Mockito.mock(InvocationFinishEvent.class);
invocation = Mockito.mock(Invocation.class);
invocationStageTrace = Mockito.mock(InvocationStageTrace.class);
when(finishEvent.getInvocation()).thenReturn(invocation);
when(invocation.getInvocationStageTrace()).thenReturn(invocationStageTrace);
when(invocationStageTrace.getStartSend()).thenReturn(0L);
when(invocationStageTrace.getFinish()).thenReturn(1000_000L);
accessLogEvent = new ServerAccessLogEvent();
accessLogEvent.setMilliStartTime(1L);
accessLogEvent.setMilliEndTime(2L);
strBuilder = new StringBuilder();
}
use of org.apache.servicecomb.core.Invocation in project java-chassis by ServiceComb.
the class TestServiceCombServerStats method testGlobalAllowIsolatedServerTryingFlag_apply_with_null_precondition.
@Test
public void testGlobalAllowIsolatedServerTryingFlag_apply_with_null_precondition() {
Invocation invocation = new Invocation();
Assert.assertTrue(ServiceCombServerStats.applyForTryingChance(invocation));
Assert.assertSame(invocation, ServiceCombServerStats.globalAllowIsolatedServerTryingFlag.get().getInvocation());
}
Aggregations