use of org.apache.servicecomb.transport.rest.vertx.accesslog.AccessLogParam in project incubator-servicecomb-java-chassis by apache.
the class RequestHeaderItemTest method getFormattedElementIfHeaderIsNull.
@Test
public void getFormattedElementIfHeaderIsNull() {
RoutingContext mockContext = Mockito.mock(RoutingContext.class);
AccessLogParam<RoutingContext> param = new AccessLogParam<>();
param.setContextData(mockContext);
HttpServerRequest mockRequest = Mockito.mock(HttpServerRequest.class);
Mockito.when(mockContext.request()).thenReturn(mockRequest);
Mockito.when(mockRequest.headers()).thenReturn(null);
String result = ELEMENT.getFormattedItem(param);
assertEquals("-", result);
}
Aggregations