use of org.apache.servicecomb.core.event.ServerAccessLogEvent in project incubator-servicecomb-java-chassis by apache.
the class DatetimeConfigurableItemTest 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.getStart()).thenReturn(0L);
when(invocationStageTrace.getStartTimeMillis()).thenReturn(START_MILLISECOND);
accessLogEvent = new ServerAccessLogEvent();
accessLogEvent.setMilliStartTime(START_MILLISECOND);
strBuilder = new StringBuilder();
}
use of org.apache.servicecomb.core.event.ServerAccessLogEvent in project incubator-servicecomb-java-chassis by apache.
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.event.ServerAccessLogEvent in project incubator-servicecomb-java-chassis by apache.
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.event.ServerAccessLogEvent in project incubator-servicecomb-java-chassis by apache.
the class FirstLineOfRequestItemTest 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);
clientRequest = Mockito.mock(HttpClientRequest.class);
endpoint = Mockito.mock(Endpoint.class);
urlEndpoint = Mockito.mock(URIEndpointObject.class);
Map<String, Object> handlerMap = new HashMap<>();
handlerMap.put(RestConst.INVOCATION_HANDLER_REQUESTCLIENT, restClientRequest);
when(finishEvent.getInvocation()).thenReturn(invocation);
when(invocation.getHandlerContext()).thenReturn(handlerMap);
when(restClientRequest.getRequest()).thenReturn(clientRequest);
when(invocation.getEndpoint()).thenReturn(endpoint);
when(endpoint.getAddress()).thenReturn(urlEndpoint);
accessLogEvent = new ServerAccessLogEvent();
accessLogEvent.setRoutingContext(mockContext);
strBuilder = new StringBuilder();
}
use of org.apache.servicecomb.core.event.ServerAccessLogEvent in project incubator-servicecomb-java-chassis by apache.
the class LocalHostItemTest method initStrBuilder.
@Before
public void initStrBuilder() {
accessLogEvent = new ServerAccessLogEvent();
routingContext = Mockito.mock(RoutingContext.class);
finishEvent = Mockito.mock(InvocationFinishEvent.class);
serverRequest = Mockito.mock(HttpServerRequest.class);
socketAddress = Mockito.mock(SocketAddress.class);
invocation = Mockito.mock(Invocation.class);
restClientRequest = Mockito.mock(RestClientRequestImpl.class);
clientRequest = Mockito.mock(HttpClientRequest.class);
connection = Mockito.mock(HttpConnection.class);
Map<String, Object> handlerMap = new HashMap<>();
handlerMap.put(RestConst.INVOCATION_HANDLER_REQUESTCLIENT, restClientRequest);
when(finishEvent.getInvocation()).thenReturn(invocation);
when(invocation.getHandlerContext()).thenReturn(handlerMap);
accessLogEvent.setRoutingContext(routingContext);
strBuilder = new StringBuilder();
}
Aggregations