|
|
|
@ -24,6 +24,7 @@ import java.util.Arrays; |
|
|
|
import java.util.Collection; |
|
|
|
import java.util.Collection; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Locale; |
|
|
|
import java.util.Locale; |
|
|
|
|
|
|
|
import java.util.Objects; |
|
|
|
import java.util.Optional; |
|
|
|
import java.util.Optional; |
|
|
|
|
|
|
|
|
|
|
|
import org.reactivestreams.Publisher; |
|
|
|
import org.reactivestreams.Publisher; |
|
|
|
@ -64,10 +65,10 @@ public final class MockServerHttpRequest extends AbstractServerHttpRequest { |
|
|
|
private final MultiValueMap<String, HttpCookie> cookies; |
|
|
|
private final MultiValueMap<String, HttpCookie> cookies; |
|
|
|
|
|
|
|
|
|
|
|
@Nullable |
|
|
|
@Nullable |
|
|
|
private final InetSocketAddress remoteAddress; |
|
|
|
private final InetSocketAddress localAddress; |
|
|
|
|
|
|
|
|
|
|
|
@Nullable |
|
|
|
@Nullable |
|
|
|
private final InetSocketAddress localAddress; |
|
|
|
private final InetSocketAddress remoteAddress; |
|
|
|
|
|
|
|
|
|
|
|
@Nullable |
|
|
|
@Nullable |
|
|
|
private final SslInfo sslInfo; |
|
|
|
private final SslInfo sslInfo; |
|
|
|
@ -98,25 +99,24 @@ public final class MockServerHttpRequest extends AbstractServerHttpRequest { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@SuppressWarnings("ConstantConditions") |
|
|
|
|
|
|
|
public String getMethodValue() { |
|
|
|
public String getMethodValue() { |
|
|
|
return (this.httpMethod != null ? this.httpMethod.name() : this.customHttpMethod); |
|
|
|
return (this.httpMethod != null ? this.httpMethod.name() : Objects.requireNonNull(this.customHttpMethod)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Nullable |
|
|
|
@Nullable |
|
|
|
public InetSocketAddress getRemoteAddress() { |
|
|
|
|
|
|
|
return this.remoteAddress; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Nullable |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public InetSocketAddress getLocalAddress() { |
|
|
|
public InetSocketAddress getLocalAddress() { |
|
|
|
return this.localAddress; |
|
|
|
return this.localAddress; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Nullable |
|
|
|
@Nullable |
|
|
|
|
|
|
|
public InetSocketAddress getRemoteAddress() { |
|
|
|
|
|
|
|
return this.remoteAddress; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
|
|
|
|
@Nullable |
|
|
|
protected SslInfo initSslInfo() { |
|
|
|
protected SslInfo initSslInfo() { |
|
|
|
return this.sslInfo; |
|
|
|
return this.sslInfo; |
|
|
|
} |
|
|
|
} |
|
|
|
|