Skip to content

Commit

Permalink
Breaking change with Alpha version of OkHttp3 Library (OpenFeign#2318)
Browse files Browse the repository at this point in the history
* Breaking change with Alpha version of OkHttp3 Library

* Add mockwebserver3-junit5 dependency

* Revert mockwebserver3-junit5

* Run license:format

* Fix useHttps method call
  • Loading branch information
gromspys committed Feb 4, 2024
1 parent 04c130b commit 30814a1
Show file tree
Hide file tree
Showing 45 changed files with 111 additions and 111 deletions.
2 changes: 1 addition & 1 deletion annotation-error-decoder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver3-junit5</artifactId>
<artifactId>mockwebserver</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver3-junit5</artifactId>
<artifactId>mockwebserver</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<dependencies>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver3-junit5</artifactId>
<artifactId>mockwebserver</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions core/src/test/java/feign/AsyncFeignTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -62,8 +62,8 @@
import feign.codec.StringDecoder;
import feign.querymap.BeanQueryMapEncoder;
import feign.querymap.FieldQueryMapEncoder;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okio.Buffer;

public class AsyncFeignTest {
Expand Down
6 changes: 3 additions & 3 deletions core/src/test/java/feign/BaseApiTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -20,8 +20,8 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import com.google.gson.reflect.TypeToken;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;

public class BaseApiTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -25,8 +25,8 @@
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;

public class ContractWithRuntimeInjectionTest {

Expand Down
6 changes: 3 additions & 3 deletions core/src/test/java/feign/FeignBuilderTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -39,8 +39,8 @@
import org.junit.jupiter.api.Test;
import feign.codec.Decoder;
import feign.codec.Encoder;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;

public class FeignBuilderTest {

Expand Down
8 changes: 4 additions & 4 deletions core/src/test/java/feign/FeignTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -63,9 +63,9 @@
import feign.codec.StringDecoder;
import feign.querymap.BeanQueryMapEncoder;
import feign.querymap.FieldQueryMapEncoder;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import mockwebserver3.SocketPolicy;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.SocketPolicy;
import okio.Buffer;

@SuppressWarnings("deprecation")
Expand Down
8 changes: 4 additions & 4 deletions core/src/test/java/feign/FeignUnderAsyncTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -53,9 +53,9 @@
import feign.codec.StringDecoder;
import feign.querymap.BeanQueryMapEncoder;
import feign.querymap.FieldQueryMapEncoder;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import mockwebserver3.SocketPolicy;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.SocketPolicy;
import okio.Buffer;

@SuppressWarnings("deprecation")
Expand Down
6 changes: 3 additions & 3 deletions core/src/test/java/feign/LoggerTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -28,8 +28,8 @@
import org.junit.jupiter.params.provider.MethodSource;
import feign.Logger.Level;
import feign.Request.ProtocolVersion;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;

public class LoggerTest {
public final MockWebServer server = new MockWebServer();
Expand Down
6 changes: 3 additions & 3 deletions core/src/test/java/feign/MethodMetadataPresenceTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -22,8 +22,8 @@
import feign.FeignBuilderTest.TestInterface;
import feign.codec.Decoder;
import feign.codec.Encoder;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;

public class MethodMetadataPresenceTest {

Expand Down
6 changes: 3 additions & 3 deletions core/src/test/java/feign/OptionsTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -20,8 +20,8 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import org.junit.jupiter.api.Test;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;

/**
* @author pengfei.zhao
Expand Down
6 changes: 3 additions & 3 deletions core/src/test/java/feign/TargetTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -19,8 +19,8 @@
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import feign.Target.HardCodedTarget;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;

@SuppressWarnings("deprecation")
public class TargetTest {
Expand Down
4 changes: 2 additions & 2 deletions core/src/test/java/feign/assertj/MockWebServerAssertions.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -14,7 +14,7 @@
package feign.assertj;

import org.assertj.core.api.Assertions;
import mockwebserver3.RecordedRequest;
import okhttp3.mockwebserver.RecordedRequest;

public class MockWebServerAssertions extends Assertions {

Expand Down
4 changes: 2 additions & 2 deletions core/src/test/java/feign/assertj/RecordedRequestAssert.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -33,7 +33,7 @@
import org.assertj.core.internal.Maps;
import org.assertj.core.internal.Objects;
import feign.Util;
import mockwebserver3.RecordedRequest;
import okhttp3.mockwebserver.RecordedRequest;
import okhttp3.Headers;

public final class RecordedRequestAssert
Expand Down
8 changes: 4 additions & 4 deletions core/src/test/java/feign/client/AbstractClientTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -40,9 +40,9 @@
import feign.Response;
import feign.Util;
import feign.assertj.MockWebServerAssertions;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import mockwebserver3.RecordedRequest;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
import okio.Buffer;

/**
Expand Down
12 changes: 6 additions & 6 deletions core/src/test/java/feign/client/DefaultClientTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -32,8 +32,8 @@
import feign.Feign.Builder;
import feign.RetryableException;
import feign.assertj.MockWebServerAssertions;
import mockwebserver3.MockResponse;
import mockwebserver3.SocketPolicy;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.SocketPolicy;

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

@Test
void retriesFailedHandshake() throws IOException, InterruptedException {
server.useHttps(TrustingSSLSocketFactory.get("localhost"));
server.useHttps(TrustingSSLSocketFactory.get("localhost"), false);
server.enqueue(new MockResponse().setSocketPolicy(SocketPolicy.FAIL_HANDSHAKE));
server.enqueue(new MockResponse());

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

@Test
void canOverrideSSLSocketFactory() throws IOException, InterruptedException {
server.useHttps(TrustingSSLSocketFactory.get("localhost"));
server.useHttps(TrustingSSLSocketFactory.get("localhost"), false);
server.enqueue(new MockResponse());

TestInterface api =
Expand Down Expand Up @@ -109,7 +109,7 @@ public void noResponseBodyForPatch() {

@Test
void canOverrideHostnameVerifier() throws IOException, InterruptedException {
server.useHttps(TrustingSSLSocketFactory.get("bad.example.com"));
server.useHttps(TrustingSSLSocketFactory.get("bad.example.com"), false);
server.enqueue(new MockResponse());

TestInterface api =
Expand Down
6 changes: 3 additions & 3 deletions core/src/test/java/feign/optionals/OptionalDecoderTests.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -20,8 +20,8 @@
import feign.Feign;
import feign.RequestLine;
import feign.codec.Decoder;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;

class OptionalDecoderTests {

Expand Down
6 changes: 3 additions & 3 deletions core/src/test/java/feign/stream/StreamDecoderTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -31,8 +31,8 @@
import feign.RequestLine;
import feign.Response;
import feign.Util;
import mockwebserver3.MockResponse;
import mockwebserver3.MockWebServer;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;

@SuppressWarnings("deprecation")
class StreamDecoderTest {
Expand Down
2 changes: 1 addition & 1 deletion googlehttpclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver3-junit5</artifactId>
<artifactId>mockwebserver</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand All @@ -25,7 +25,7 @@
import feign.Util;
import feign.assertj.MockWebServerAssertions;
import feign.client.AbstractClientTest;
import mockwebserver3.MockResponse;
import okhttp3.mockwebserver.MockResponse;

public class GoogleHttpClientTest extends AbstractClientTest {
@Override
Expand Down
2 changes: 1 addition & 1 deletion hc5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver3-junit5</artifactId>
<artifactId>mockwebserver</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions hc5/src/test/java/feign/hc5/ApacheHttp5ClientTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 The Feign Authors
* Copyright 2012-2024 The Feign Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -30,8 +30,8 @@
import feign.Request;
import feign.client.AbstractClientTest;
import feign.jaxrs.JAXRSContract;
import mockwebserver3.MockResponse;
import mockwebserver3.RecordedRequest;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.RecordedRequest;

/**
* Tests client-specific behavior, such as ensuring Content-Length is sent when specified.
Expand Down
Loading

0 comments on commit 30814a1

Please sign in to comment.