JAVA-26733 Upgrade wiremock to the latest version (#15206)
This commit is contained in:
parent
a7ab16d81e
commit
40315beb0d
|
@ -58,11 +58,16 @@
|
|||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.tomakehurst</groupId>
|
||||
<groupId>org.wiremock</groupId>
|
||||
<artifactId>wiremock</artifactId>
|
||||
<version>${wiremock.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>${httpclient.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -77,11 +82,12 @@
|
|||
|
||||
<properties>
|
||||
<mockserver.version>5.6.1</mockserver.version>
|
||||
<wiremock.version>2.5.1</wiremock.version>
|
||||
<wiremock.version>3.3.1</wiremock.version>
|
||||
<!-- http client & core 5 -->
|
||||
<httpcore5.version>5.2</httpcore5.version>
|
||||
<httpclient5.version>5.2</httpclient5.version>
|
||||
<httpclient5-fluent.version>5.2</httpclient5-fluent.version>
|
||||
<httpclient.version>4.5.14</httpclient.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -8,7 +8,7 @@ import static org.mockserver.model.HttpResponse.response;
|
|||
import java.io.IOException;
|
||||
import java.net.ServerSocket;
|
||||
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.hc.core5.http.HttpStatus;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.mockserver.client.MockServerClient;
|
||||
|
|
|
@ -38,8 +38,6 @@ import org.junit.jupiter.api.Test;
|
|||
|
||||
|
||||
class HttpAsyncClientLiveTest extends GetRequestMockServer {
|
||||
|
||||
private static final String HOST = "http://www.google.com";
|
||||
private static final String HOST_WITH_SSL = "https://mms.nw.ru/";
|
||||
private static final String HOST_WITH_PROXY = "http://httpbin.org/";
|
||||
private static final String URL_SECURED_BY_BASIC_AUTHENTICATION = "http://browserspy.dk/password-ok.php";// "http://localhost:8080/spring-security-rest-basic-auth/api/foos/1";
|
||||
|
@ -136,7 +134,7 @@ class HttpAsyncClientLiveTest extends GetRequestMockServer {
|
|||
|
||||
client.start();
|
||||
|
||||
final SimpleHttpRequest request = new SimpleHttpRequest("GET",HOST_WITH_SSL);
|
||||
final SimpleHttpRequest request = new SimpleHttpRequest("GET", HOST_WITH_SSL);
|
||||
final Future<SimpleHttpResponse> future = client.execute(request, null);
|
||||
|
||||
final HttpResponse response = future.get();
|
||||
|
@ -201,7 +199,7 @@ class HttpAsyncClientLiveTest extends GetRequestMockServer {
|
|||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
final Future<SimpleHttpResponse> future = client.execute(SimpleHttpRequest.copy(request), context, null);
|
||||
final Future<SimpleHttpResponse> future = client.execute(SimpleRequestBuilder.copy(request).build(), context, null);
|
||||
final HttpResponse response = future.get();
|
||||
assertThat(response.getCode(), equalTo(200));
|
||||
} catch (final Exception ex) {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package com.baeldung.httpclient;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
|
||||
import org.apache.hc.core5.http.HttpEntity;
|
||||
|
||||
public final class ResponseUtil {
|
||||
private ResponseUtil() {
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ class HttpClientAdvancedConfigurationIntegrationTest {
|
|||
void givenServerThatIsBehindProxy_whenClientIsConfiguredToSendRequestViaProxy_shouldReturn200() throws IOException {
|
||||
//given
|
||||
proxyMock.stubFor(get(urlMatching(".*"))
|
||||
.willReturn(aResponse().proxiedFrom("http://localhost:8089/")));
|
||||
.willReturn(aResponse().proxiedFrom("http://localhost:8089")));
|
||||
|
||||
serviceMock.stubFor(get(urlEqualTo("/private"))
|
||||
.willReturn(aResponse().withStatus(200)));
|
||||
|
@ -129,7 +129,7 @@ class HttpClientAdvancedConfigurationIntegrationTest {
|
|||
public void givenServerThatIsBehindAuthorizationProxy_whenClientSendRequest_shouldAuthorizeProperly() throws IOException {
|
||||
//given
|
||||
proxyMock.stubFor(get(urlMatching("/private"))
|
||||
.willReturn(aResponse().proxiedFrom("http://localhost:8089/")));
|
||||
.willReturn(aResponse().proxiedFrom("http://localhost:8089")));
|
||||
serviceMock.stubFor(get(urlEqualTo("/private"))
|
||||
.willReturn(aResponse().withStatus(200)));
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@
|
|||
<version>${mockserver.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.tomakehurst</groupId>
|
||||
<groupId>org.wiremock</groupId>
|
||||
<artifactId>wiremock</artifactId>
|
||||
<version>${wiremock.version}</version>
|
||||
<scope>test</scope>
|
||||
|
@ -237,7 +237,7 @@
|
|||
<commons-codec.version>1.16.0</commons-codec.version>
|
||||
<httpasyncclient.version>4.1.5</httpasyncclient.version>
|
||||
<!-- testing -->
|
||||
<wiremock.version>2.5.1</wiremock.version>
|
||||
<wiremock.version>3.3.1</wiremock.version>
|
||||
<httpcore.version>4.4.16</httpcore.version>
|
||||
<httpclient.version>4.5.14</httpclient.version>
|
||||
<mockserver.version>5.11.2</mockserver.version>
|
||||
|
|
|
@ -102,7 +102,7 @@ class HttpClientAdvancedConfigurationIntegrationTest {
|
|||
void givenServerThatIsBehindProxy_whenClientIsConfiguredToSendRequestViaProxy_shouldReturn200() throws IOException {
|
||||
//given
|
||||
proxyMock.stubFor(get(urlMatching(".*"))
|
||||
.willReturn(aResponse().proxiedFrom("http://localhost:8089/")));
|
||||
.willReturn(aResponse().proxiedFrom("http://localhost:8089")));
|
||||
|
||||
serviceMock.stubFor(get(urlEqualTo("/private"))
|
||||
.willReturn(aResponse().withStatus(200)));
|
||||
|
@ -128,7 +128,7 @@ class HttpClientAdvancedConfigurationIntegrationTest {
|
|||
void givenServerThatIsBehindAuthorizationProxy_whenClientSendRequest_shouldAuthorizeProperly() throws IOException {
|
||||
//given
|
||||
proxyMock.stubFor(get(urlMatching("/private"))
|
||||
.willReturn(aResponse().proxiedFrom("http://localhost:8089/")));
|
||||
.willReturn(aResponse().proxiedFrom("http://localhost:8089")));
|
||||
serviceMock.stubFor(get(urlEqualTo("/private"))
|
||||
.willReturn(aResponse().withStatus(200)));
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.tomakehurst</groupId>
|
||||
<groupId>org.wiremock</groupId>
|
||||
<artifactId>wiremock</artifactId>
|
||||
<version>${wiremock.version}</version>
|
||||
<scope>test</scope>
|
||||
|
@ -58,7 +58,7 @@
|
|||
<maven.compiler.target.version>11</maven.compiler.target.version>
|
||||
<assertj.version>3.22.0</assertj.version>
|
||||
<mockserver.version>5.11.2</mockserver.version>
|
||||
<wiremock.version>2.27.2</wiremock.version>
|
||||
<wiremock.version>3.3.1</wiremock.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -31,9 +31,8 @@
|
|||
<artifactId>log4j-over-slf4j</artifactId>
|
||||
<version>${org.slf4j.version}</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.github.tomakehurst/wiremock -->
|
||||
<dependency>
|
||||
<groupId>com.github.tomakehurst</groupId>
|
||||
<groupId>org.wiremock</groupId>
|
||||
<artifactId>wiremock</artifactId>
|
||||
<version>${wiremock.version}</version>
|
||||
<scope>test</scope>
|
||||
|
@ -63,7 +62,7 @@
|
|||
|
||||
<properties>
|
||||
<maven-javadoc-plugin.version>3.0.0-M1</maven-javadoc-plugin.version>
|
||||
<wiremock.version>2.26.3</wiremock.version>
|
||||
<wiremock.version>3.3.1</wiremock.version>
|
||||
</properties>
|
||||
|
||||
</project>
|
|
@ -99,7 +99,7 @@
|
|||
<version>${commons-codec.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.tomakehurst</groupId>
|
||||
<groupId>org.wiremock</groupId>
|
||||
<artifactId>wiremock</artifactId>
|
||||
<version>${wiremock.version}</version>
|
||||
<scope>test</scope>
|
||||
|
@ -207,7 +207,7 @@
|
|||
<!-- util -->
|
||||
<commons-codec.version>1.16.0</commons-codec.version>
|
||||
<!-- testing -->
|
||||
<wiremock.version>2.5.1</wiremock.version>
|
||||
<wiremock.version>3.3.1</wiremock.version>
|
||||
<!-- http client & core 5 -->
|
||||
<httpcore5.version>5.2</httpcore5.version>
|
||||
<httpclient5.version>5.2</httpclient5.version>
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
<version>${jersey.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.tomakehurst</groupId>
|
||||
<groupId>org.wiremock</groupId>
|
||||
<artifactId>wiremock</artifactId>
|
||||
<version>${wiremock.version}</version>
|
||||
<scope>test</scope>
|
||||
|
@ -219,7 +219,7 @@
|
|||
<cargo-maven2-plugin.version>1.6.1</cargo-maven2-plugin.version>
|
||||
<httpcore.version>4.4.9</httpcore.version>
|
||||
<httpclient.version>4.5.5</httpclient.version>
|
||||
<wiremock.version>2.27.2</wiremock.version>
|
||||
<wiremock.version>3.3.1</wiremock.version>
|
||||
<spring-boot.version>1.5.10.RELEASE</spring-boot.version>
|
||||
</properties>
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</dependency>
|
||||
<!-- test scoped -->
|
||||
<dependency>
|
||||
<groupId>com.github.tomakehurst</groupId>
|
||||
<groupId>org.wiremock</groupId>
|
||||
<artifactId>wiremock</artifactId>
|
||||
<version>${wiremock.version}</version>
|
||||
<scope>test</scope>
|
||||
|
@ -135,7 +135,7 @@
|
|||
<!-- testing -->
|
||||
<rest-assured.version>2.9.0</rest-assured.version>
|
||||
<cucumber.version>6.8.0</cucumber.version>
|
||||
<wiremock.version>2.21.0</wiremock.version>
|
||||
<wiremock.version>3.3.1</wiremock.version>
|
||||
<karate.version>1.3.1</karate.version>
|
||||
<jbehave.version>4.1</jbehave.version>
|
||||
</properties>
|
||||
|
|
Loading…
Reference in New Issue