Search in sources :

Example 1 with ServerAccessLogEvent

use of org.apache.servicecomb.core.event.ServerAccessLogEvent in project java-chassis by ServiceComb.

the class RequestProtocolItemTest 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);
    urlEndpoint = Mockito.mock(URIEndpointObject.class);
    endpoint = Mockito.mock(Endpoint.class);
    accessLogEvent = new ServerAccessLogEvent();
    accessLogEvent.setRoutingContext(routingContext);
    strBuilder = new StringBuilder();
}
Also used : RoutingContext(io.vertx.ext.web.RoutingContext) InvocationFinishEvent(org.apache.servicecomb.core.event.InvocationFinishEvent) ServerAccessLogEvent(org.apache.servicecomb.core.event.ServerAccessLogEvent) Invocation(org.apache.servicecomb.core.Invocation) Endpoint(org.apache.servicecomb.core.Endpoint) HttpServerRequest(io.vertx.core.http.HttpServerRequest) URIEndpointObject(org.apache.servicecomb.foundation.common.net.URIEndpointObject) Before(org.junit.Before)

Example 2 with ServerAccessLogEvent

use of org.apache.servicecomb.core.event.ServerAccessLogEvent in project java-chassis by ServiceComb.

the class VertxRestAccessLogPatternParserTest method initStrBuilder.

@Before
public void initStrBuilder() {
    routingContext = Mockito.mock(RoutingContext.class);
    accessLogEvent = new ServerAccessLogEvent();
    accessLogEvent.setRoutingContext(routingContext);
}
Also used : RoutingContext(io.vertx.ext.web.RoutingContext) ServerAccessLogEvent(org.apache.servicecomb.core.event.ServerAccessLogEvent) Before(org.junit.Before)

Example 3 with ServerAccessLogEvent

use of org.apache.servicecomb.core.event.ServerAccessLogEvent in project java-chassis by ServiceComb.

the class LocalPortItemTest 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();
}
Also used : Invocation(org.apache.servicecomb.core.Invocation) HttpConnection(io.vertx.core.http.HttpConnection) HashMap(java.util.HashMap) HttpServerRequest(io.vertx.core.http.HttpServerRequest) RestClientRequestImpl(org.apache.servicecomb.common.rest.codec.param.RestClientRequestImpl) RoutingContext(io.vertx.ext.web.RoutingContext) HttpClientRequest(io.vertx.core.http.HttpClientRequest) ServerAccessLogEvent(org.apache.servicecomb.core.event.ServerAccessLogEvent) InvocationFinishEvent(org.apache.servicecomb.core.event.InvocationFinishEvent) SocketAddress(io.vertx.core.net.SocketAddress) Before(org.junit.Before)

Example 4 with ServerAccessLogEvent

use of org.apache.servicecomb.core.event.ServerAccessLogEvent in project java-chassis by ServiceComb.

the class RequestHeaderItemTest 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);
    headers = Mockito.mock(MultiMap.class);
    accessLogEvent = new ServerAccessLogEvent();
    accessLogEvent.setRoutingContext(routingContext);
    strBuilder = new StringBuilder();
}
Also used : MultiMap(io.vertx.core.MultiMap) HeadersMultiMap(io.vertx.core.http.impl.headers.HeadersMultiMap) RoutingContext(io.vertx.ext.web.RoutingContext) HttpClientRequest(io.vertx.core.http.HttpClientRequest) InvocationFinishEvent(org.apache.servicecomb.core.event.InvocationFinishEvent) ServerAccessLogEvent(org.apache.servicecomb.core.event.ServerAccessLogEvent) Invocation(org.apache.servicecomb.core.Invocation) HttpServerRequest(io.vertx.core.http.HttpServerRequest) RestClientRequestImpl(org.apache.servicecomb.common.rest.codec.param.RestClientRequestImpl) Before(org.junit.Before)

Example 5 with ServerAccessLogEvent

use of org.apache.servicecomb.core.event.ServerAccessLogEvent 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();
}
Also used : RoutingContext(io.vertx.ext.web.RoutingContext) HttpClientRequest(io.vertx.core.http.HttpClientRequest) ServerAccessLogEvent(org.apache.servicecomb.core.event.ServerAccessLogEvent) InvocationFinishEvent(org.apache.servicecomb.core.event.InvocationFinishEvent) Invocation(org.apache.servicecomb.core.Invocation) HttpServerRequest(io.vertx.core.http.HttpServerRequest) SchemaMeta(org.apache.servicecomb.core.definition.SchemaMeta) Swagger(io.swagger.models.Swagger) RestClientRequestImpl(org.apache.servicecomb.common.rest.codec.param.RestClientRequestImpl) OperationMeta(org.apache.servicecomb.core.definition.OperationMeta) Before(org.junit.Before)

Aggregations

ServerAccessLogEvent (org.apache.servicecomb.core.event.ServerAccessLogEvent)48 Before (org.junit.Before)44 InvocationFinishEvent (org.apache.servicecomb.core.event.InvocationFinishEvent)42 RoutingContext (io.vertx.ext.web.RoutingContext)36 Invocation (org.apache.servicecomb.core.Invocation)34 HttpServerRequest (io.vertx.core.http.HttpServerRequest)20 RestClientRequestImpl (org.apache.servicecomb.common.rest.codec.param.RestClientRequestImpl)16 HttpClientRequest (io.vertx.core.http.HttpClientRequest)14 Endpoint (org.apache.servicecomb.core.Endpoint)10 HashMap (java.util.HashMap)8 URIEndpointObject (org.apache.servicecomb.foundation.common.net.URIEndpointObject)8 HttpServerResponse (io.vertx.core.http.HttpServerResponse)6 SocketAddress (io.vertx.core.net.SocketAddress)6 InvocationStageTrace (org.apache.servicecomb.core.invocation.InvocationStageTrace)6 HttpConnection (io.vertx.core.http.HttpConnection)4 Response (org.apache.servicecomb.swagger.invocation.Response)4 Swagger (io.swagger.models.Swagger)2 MultiMap (io.vertx.core.MultiMap)2 HeadersMultiMap (io.vertx.core.http.impl.headers.HeadersMultiMap)2 SimpleDateFormat (java.text.SimpleDateFormat)2