Skip to content

Commit 30814a1

Browse files
authored
Breaking change with Alpha version of OkHttp3 Library (#2318)
* Breaking change with Alpha version of OkHttp3 Library * Add mockwebserver3-junit5 dependency * Revert mockwebserver3-junit5 * Run license:format * Fix useHttps method call
1 parent 04c130b commit 30814a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+111
-111
lines changed

annotation-error-decoder/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
<dependency>
4848
<groupId>com.squareup.okhttp3</groupId>
49-
<artifactId>mockwebserver3-junit5</artifactId>
49+
<artifactId>mockwebserver</artifactId>
5050
<scope>test</scope>
5151
</dependency>
5252
<dependency>

benchmark/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
</dependency>
6767
<dependency>
6868
<groupId>com.squareup.okhttp3</groupId>
69-
<artifactId>mockwebserver3-junit5</artifactId>
69+
<artifactId>mockwebserver</artifactId>
7070
</dependency>
7171
<dependency>
7272
<groupId>io.netty</groupId>

core/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<dependencies>
3535
<dependency>
3636
<groupId>com.squareup.okhttp3</groupId>
37-
<artifactId>mockwebserver3-junit5</artifactId>
37+
<artifactId>mockwebserver</artifactId>
3838
<scope>test</scope>
3939
</dependency>
4040
<dependency>

core/src/test/java/feign/AsyncFeignTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -62,8 +62,8 @@
6262
import feign.codec.StringDecoder;
6363
import feign.querymap.BeanQueryMapEncoder;
6464
import feign.querymap.FieldQueryMapEncoder;
65-
import mockwebserver3.MockResponse;
66-
import mockwebserver3.MockWebServer;
65+
import okhttp3.mockwebserver.MockResponse;
66+
import okhttp3.mockwebserver.MockWebServer;
6767
import okio.Buffer;
6868

6969
public class AsyncFeignTest {

core/src/test/java/feign/BaseApiTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -20,8 +20,8 @@
2020
import org.junit.jupiter.api.AfterEach;
2121
import org.junit.jupiter.api.Test;
2222
import com.google.gson.reflect.TypeToken;
23-
import mockwebserver3.MockResponse;
24-
import mockwebserver3.MockWebServer;
23+
import okhttp3.mockwebserver.MockResponse;
24+
import okhttp3.mockwebserver.MockWebServer;
2525

2626
public class BaseApiTest {
2727

core/src/test/java/feign/ContractWithRuntimeInjectionTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -25,8 +25,8 @@
2525
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
2626
import org.springframework.context.annotation.Bean;
2727
import org.springframework.context.annotation.Configuration;
28-
import mockwebserver3.MockResponse;
29-
import mockwebserver3.MockWebServer;
28+
import okhttp3.mockwebserver.MockResponse;
29+
import okhttp3.mockwebserver.MockWebServer;
3030

3131
public class ContractWithRuntimeInjectionTest {
3232

core/src/test/java/feign/FeignBuilderTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -39,8 +39,8 @@
3939
import org.junit.jupiter.api.Test;
4040
import feign.codec.Decoder;
4141
import feign.codec.Encoder;
42-
import mockwebserver3.MockResponse;
43-
import mockwebserver3.MockWebServer;
42+
import okhttp3.mockwebserver.MockResponse;
43+
import okhttp3.mockwebserver.MockWebServer;
4444

4545
public class FeignBuilderTest {
4646

core/src/test/java/feign/FeignTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -63,9 +63,9 @@
6363
import feign.codec.StringDecoder;
6464
import feign.querymap.BeanQueryMapEncoder;
6565
import feign.querymap.FieldQueryMapEncoder;
66-
import mockwebserver3.MockResponse;
67-
import mockwebserver3.MockWebServer;
68-
import mockwebserver3.SocketPolicy;
66+
import okhttp3.mockwebserver.MockResponse;
67+
import okhttp3.mockwebserver.MockWebServer;
68+
import okhttp3.mockwebserver.SocketPolicy;
6969
import okio.Buffer;
7070

7171
@SuppressWarnings("deprecation")

core/src/test/java/feign/FeignUnderAsyncTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -53,9 +53,9 @@
5353
import feign.codec.StringDecoder;
5454
import feign.querymap.BeanQueryMapEncoder;
5555
import feign.querymap.FieldQueryMapEncoder;
56-
import mockwebserver3.MockResponse;
57-
import mockwebserver3.MockWebServer;
58-
import mockwebserver3.SocketPolicy;
56+
import okhttp3.mockwebserver.MockResponse;
57+
import okhttp3.mockwebserver.MockWebServer;
58+
import okhttp3.mockwebserver.SocketPolicy;
5959
import okio.Buffer;
6060

6161
@SuppressWarnings("deprecation")

core/src/test/java/feign/LoggerTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -28,8 +28,8 @@
2828
import org.junit.jupiter.params.provider.MethodSource;
2929
import feign.Logger.Level;
3030
import feign.Request.ProtocolVersion;
31-
import mockwebserver3.MockResponse;
32-
import mockwebserver3.MockWebServer;
31+
import okhttp3.mockwebserver.MockResponse;
32+
import okhttp3.mockwebserver.MockWebServer;
3333

3434
public class LoggerTest {
3535
public final MockWebServer server = new MockWebServer();

core/src/test/java/feign/MethodMetadataPresenceTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -22,8 +22,8 @@
2222
import feign.FeignBuilderTest.TestInterface;
2323
import feign.codec.Decoder;
2424
import feign.codec.Encoder;
25-
import mockwebserver3.MockResponse;
26-
import mockwebserver3.MockWebServer;
25+
import okhttp3.mockwebserver.MockResponse;
26+
import okhttp3.mockwebserver.MockWebServer;
2727

2828
public class MethodMetadataPresenceTest {
2929

core/src/test/java/feign/OptionsTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -20,8 +20,8 @@
2020
import java.util.concurrent.TimeUnit;
2121
import java.util.concurrent.atomic.AtomicReference;
2222
import org.junit.jupiter.api.Test;
23-
import mockwebserver3.MockResponse;
24-
import mockwebserver3.MockWebServer;
23+
import okhttp3.mockwebserver.MockResponse;
24+
import okhttp3.mockwebserver.MockWebServer;
2525

2626
/**
2727
* @author pengfei.zhao

core/src/test/java/feign/TargetTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -19,8 +19,8 @@
1919
import org.junit.jupiter.api.AfterEach;
2020
import org.junit.jupiter.api.Test;
2121
import feign.Target.HardCodedTarget;
22-
import mockwebserver3.MockResponse;
23-
import mockwebserver3.MockWebServer;
22+
import okhttp3.mockwebserver.MockResponse;
23+
import okhttp3.mockwebserver.MockWebServer;
2424

2525
@SuppressWarnings("deprecation")
2626
public class TargetTest {

core/src/test/java/feign/assertj/MockWebServerAssertions.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -14,7 +14,7 @@
1414
package feign.assertj;
1515

1616
import org.assertj.core.api.Assertions;
17-
import mockwebserver3.RecordedRequest;
17+
import okhttp3.mockwebserver.RecordedRequest;
1818

1919
public class MockWebServerAssertions extends Assertions {
2020

core/src/test/java/feign/assertj/RecordedRequestAssert.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -33,7 +33,7 @@
3333
import org.assertj.core.internal.Maps;
3434
import org.assertj.core.internal.Objects;
3535
import feign.Util;
36-
import mockwebserver3.RecordedRequest;
36+
import okhttp3.mockwebserver.RecordedRequest;
3737
import okhttp3.Headers;
3838

3939
public final class RecordedRequestAssert

core/src/test/java/feign/client/AbstractClientTest.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -40,9 +40,9 @@
4040
import feign.Response;
4141
import feign.Util;
4242
import feign.assertj.MockWebServerAssertions;
43-
import mockwebserver3.MockResponse;
44-
import mockwebserver3.MockWebServer;
45-
import mockwebserver3.RecordedRequest;
43+
import okhttp3.mockwebserver.MockResponse;
44+
import okhttp3.mockwebserver.MockWebServer;
45+
import okhttp3.mockwebserver.RecordedRequest;
4646
import okio.Buffer;
4747

4848
/**

core/src/test/java/feign/client/DefaultClientTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -32,8 +32,8 @@
3232
import feign.Feign.Builder;
3333
import feign.RetryableException;
3434
import feign.assertj.MockWebServerAssertions;
35-
import mockwebserver3.MockResponse;
36-
import mockwebserver3.SocketPolicy;
35+
import okhttp3.mockwebserver.MockResponse;
36+
import okhttp3.mockwebserver.SocketPolicy;
3737

3838
/**
3939
* Tests client-specific behavior, such as ensuring Content-Length is sent when specified.
@@ -50,7 +50,7 @@ public Builder newBuilder() {
5050

5151
@Test
5252
void retriesFailedHandshake() throws IOException, InterruptedException {
53-
server.useHttps(TrustingSSLSocketFactory.get("localhost"));
53+
server.useHttps(TrustingSSLSocketFactory.get("localhost"), false);
5454
server.enqueue(new MockResponse().setSocketPolicy(SocketPolicy.FAIL_HANDSHAKE));
5555
server.enqueue(new MockResponse());
5656

@@ -63,7 +63,7 @@ void retriesFailedHandshake() throws IOException, InterruptedException {
6363

6464
@Test
6565
void canOverrideSSLSocketFactory() throws IOException, InterruptedException {
66-
server.useHttps(TrustingSSLSocketFactory.get("localhost"));
66+
server.useHttps(TrustingSSLSocketFactory.get("localhost"), false);
6767
server.enqueue(new MockResponse());
6868

6969
TestInterface api =
@@ -109,7 +109,7 @@ public void noResponseBodyForPatch() {
109109

110110
@Test
111111
void canOverrideHostnameVerifier() throws IOException, InterruptedException {
112-
server.useHttps(TrustingSSLSocketFactory.get("bad.example.com"));
112+
server.useHttps(TrustingSSLSocketFactory.get("bad.example.com"), false);
113113
server.enqueue(new MockResponse());
114114

115115
TestInterface api =

core/src/test/java/feign/optionals/OptionalDecoderTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -20,8 +20,8 @@
2020
import feign.Feign;
2121
import feign.RequestLine;
2222
import feign.codec.Decoder;
23-
import mockwebserver3.MockResponse;
24-
import mockwebserver3.MockWebServer;
23+
import okhttp3.mockwebserver.MockResponse;
24+
import okhttp3.mockwebserver.MockWebServer;
2525

2626
class OptionalDecoderTests {
2727

core/src/test/java/feign/stream/StreamDecoderTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -31,8 +31,8 @@
3131
import feign.RequestLine;
3232
import feign.Response;
3333
import feign.Util;
34-
import mockwebserver3.MockResponse;
35-
import mockwebserver3.MockWebServer;
34+
import okhttp3.mockwebserver.MockResponse;
35+
import okhttp3.mockwebserver.MockWebServer;
3636

3737
@SuppressWarnings("deprecation")
3838
class StreamDecoderTest {

googlehttpclient/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
<dependency>
5353
<groupId>com.squareup.okhttp3</groupId>
54-
<artifactId>mockwebserver3-junit5</artifactId>
54+
<artifactId>mockwebserver</artifactId>
5555
<scope>test</scope>
5656
</dependency>
5757
</dependencies>

googlehttpclient/src/test/java/feign/googlehttpclient/GoogleHttpClientTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -25,7 +25,7 @@
2525
import feign.Util;
2626
import feign.assertj.MockWebServerAssertions;
2727
import feign.client.AbstractClientTest;
28-
import mockwebserver3.MockResponse;
28+
import okhttp3.mockwebserver.MockResponse;
2929

3030
public class GoogleHttpClientTest extends AbstractClientTest {
3131
@Override

hc5/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
<dependency>
6666
<groupId>com.squareup.okhttp3</groupId>
67-
<artifactId>mockwebserver3-junit5</artifactId>
67+
<artifactId>mockwebserver</artifactId>
6868
<scope>test</scope>
6969
</dependency>
7070
</dependencies>

hc5/src/test/java/feign/hc5/ApacheHttp5ClientTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 The Feign Authors
2+
* Copyright 2012-2024 The Feign Authors
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
55
* in compliance with the License. You may obtain a copy of the License at
@@ -30,8 +30,8 @@
3030
import feign.Request;
3131
import feign.client.AbstractClientTest;
3232
import feign.jaxrs.JAXRSContract;
33-
import mockwebserver3.MockResponse;
34-
import mockwebserver3.RecordedRequest;
33+
import okhttp3.mockwebserver.MockResponse;
34+
import okhttp3.mockwebserver.RecordedRequest;
3535

3636
/**
3737
* Tests client-specific behavior, such as ensuring Content-Length is sent when specified.

0 commit comments

Comments
 (0)