use of org.apache.servicecomb.core.event.ServerAccessLogEvent in project incubator-servicecomb-java-chassis by apache.
the class DurationSecondItemTest 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(1000_000L);
accessLogEvent = new ServerAccessLogEvent();
accessLogEvent.setMilliStartTime(1L);
strBuilder = new StringBuilder();
}
use of org.apache.servicecomb.core.event.ServerAccessLogEvent in project incubator-servicecomb-java-chassis by apache.
the class HttpMethodItemTest method initStrBuilder.
@Before
public void initStrBuilder() {
routingContext = 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(invocation.getEndpoint()).thenReturn(endpoint);
when(endpoint.getAddress()).thenReturn(urlEndpoint);
accessLogEvent = new ServerAccessLogEvent();
accessLogEvent.setRoutingContext(routingContext);
strBuilder = new StringBuilder();
}
use of org.apache.servicecomb.core.event.ServerAccessLogEvent in project incubator-servicecomb-java-chassis by apache.
the class HttpStatusItemTest method initStrBuilder.
@Before
public void initStrBuilder() {
routingContext = Mockito.mock(RoutingContext.class);
finishEvent = Mockito.mock(InvocationFinishEvent.class);
response = Mockito.mock(Response.class);
serverResponse = Mockito.mock(HttpServerResponse.class);
accessLogEvent = new ServerAccessLogEvent();
accessLogEvent.setRoutingContext(routingContext);
strBuilder = new StringBuilder();
}
use of org.apache.servicecomb.core.event.ServerAccessLogEvent in project incubator-servicecomb-java-chassis by apache.
the class PlainTextItemTest method initStrBuilder.
@Before
public void initStrBuilder() {
accessLogEvent = new ServerAccessLogEvent();
finishEvent = Mockito.mock(InvocationFinishEvent.class);
strBuilder = new StringBuilder();
}
use of org.apache.servicecomb.core.event.ServerAccessLogEvent in project java-chassis by ServiceComb.
the class QueryStringItemTest method initStrBuilder.
@Before
public void initStrBuilder() {
routingContext = Mockito.mock(RoutingContext.class);
finishEvent = Mockito.mock(InvocationFinishEvent.class);
invocation = Mockito.mock(Invocation.class);
serverRequest = Mockito.mock(HttpServerRequest.class);
restClientRequest = Mockito.mock(RestClientRequestImpl.class);
clientRequest = Mockito.mock(HttpClientRequest.class);
accessLogEvent = new ServerAccessLogEvent();
accessLogEvent.setRoutingContext(routingContext);
strBuilder = new StringBuilder();
}
Aggregations