Skip to content

Commit f1f761e

Browse files
committed
Update to okhttp 5.x
1 parent 59685f1 commit f1f761e

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
<dependencies>
5454
<dependency>
5555
<groupId>com.squareup.okhttp3</groupId>
56-
<artifactId>okhttp</artifactId>
57-
<version>4.12.0</version>
56+
<artifactId>okhttp-jvm</artifactId>
57+
<version>5.0.0</version>
5858
</dependency>
5959
<dependency>
6060
<groupId>com.jayway.jsonpath</groupId>
@@ -157,7 +157,7 @@
157157
<dependency>
158158
<groupId>com.squareup.okhttp3</groupId>
159159
<artifactId>mockwebserver</artifactId>
160-
<version>3.10.0</version>
160+
<version>5.0.0</version>
161161
<scope>test</scope>
162162
</dependency>
163163
<dependency>
@@ -173,9 +173,9 @@
173173
<version>1.14.17</version>
174174
</dependency>
175175
<dependency>
176-
<groupId>com.github.gmazzo</groupId>
177-
<artifactId>okhttp-mock</artifactId>
178-
<version>1.4.1</version>
176+
<groupId>com.github.gmazzo.okhttp.mock</groupId>
177+
<artifactId>mock-client</artifactId>
178+
<version>2.0.0</version>
179179
<scope>test</scope>
180180
</dependency>
181181
</dependencies>

src/main/java/com/flagsmith/FlagsmithApiWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public Flags identifyUserWithTraits(
201201
node.putPOJO("traits", traits);
202202
}
203203

204-
MediaType json = MediaType.parse("application/json; charset=utf-8");
204+
MediaType json = MediaType.get("application/json; charset=utf-8");
205205
RequestBody body = RequestBody.create(node.toString(), json);
206206

207207
HttpUrl url = defaultConfig.getIdentitiesUri();

src/main/java/com/flagsmith/config/FlagsmithConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public final class FlagsmithConfig {
2828
private static final int DEFAULT_READ_TIMEOUT_MILLIS = 5000;
2929
private static final int DEFAULT_ENVIRONMENT_REFRESH_SECONDS = 60;
3030
private static final HttpUrl DEFAULT_BASE_URI = HttpUrl
31-
.parse("https://edge.api.flagsmith.com/api/v1/");
31+
.get("https://edge.api.flagsmith.com/api/v1/");
3232
private final HttpUrl flagsUri;
3333
private final HttpUrl identitiesUri;
3434
private final HttpUrl traitsUri;
@@ -129,7 +129,7 @@ private Builder() {
129129
*/
130130
public Builder baseUri(String baseUri) {
131131
if (baseUri != null) {
132-
this.baseUri = HttpUrl.parse(baseUri);
132+
this.baseUri = HttpUrl.get(baseUri);
133133
}
134134
return this;
135135
}

src/main/java/com/flagsmith/threads/AnalyticsProcessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ public void flush() {
132132
return;
133133
}
134134

135-
MediaType json = MediaType.parse("application/json; charset=utf-8");
136-
RequestBody body = RequestBody.create(json, response);
135+
MediaType json = MediaType.get("application/json; charset=utf-8");
136+
RequestBody body = RequestBody.create(response, json);
137137

138138
Request request = api.newPostRequest(getAnalyticsUrl(), body);
139139

0 commit comments

Comments
 (0)