public Request build() {
        int localPort = this.localPort != null ? this.localPort : 8080;
        HttpConnection connection = mock(HttpConnection.class);
        JDiscServerConnector connector = mock(JDiscServerConnector.class);
        when(connector.connectorConfig()).thenReturn(new ConnectorConfig(
                new ConnectorConfig.Builder().listenPort(localPort)
                        .accessLog(new ConnectorConfig.AccessLog.Builder()
                                           .remoteAddressHeaders(List.of("x-forwarded-for", "y-ra"))
                                           .remotePortHeaders(List.of("X-Forwarded-Port", "y-rp")))));
        when(connector.getLocalPort()).thenReturn(localPort);
        when(connection.getCreatedTimeStamp()).thenReturn(System.currentTimeMillis());
        when(connection.getConnector()).thenReturn(connector);
        return new DummyRequest(this, connector, connection);
    }
Builder for creating a mock instance of Jetty's {@link Request} type.

@author bjorncs
container-core/src/test/java/com/yahoo/jdisc/http/server/jetty/JettyMockRequestBuilder.java