4.9.0.
+ * The minimum OkHttp version this module was built against and requires at runtime: 4.12.1.
*/
- private static final LibraryVersion MINIMUM_VERSION = LibraryVersion.of(CLIENT_NAME, 4, 9, 0);
+ private static final LibraryVersion MINIMUM_VERSION = LibraryVersion.of(CLIENT_NAME, 4, 12, 1);
/**
- * The maximum OkHttp version this module supports, i.e. the highest version it was tested against: 4.12.1.
+ * The maximum OkHttp version this module supports, i.e. the highest version it was tested against: 5.5.1.
*
* A newer runtime version is outside the tested range and is rejected by {@link #verifyVersion()}.
*/
- private static final LibraryVersion MAXIMUM_VERSION = LibraryVersion.of(CLIENT_NAME, 4, 12, 1);
+ private static final LibraryVersion MAXIMUM_VERSION = LibraryVersion.of(CLIENT_NAME, 5, 5, 1);
/**
- * The OkHttp OkHttpClient class name.
+ * The OkHttp client class name, used as the version anchor because the OkHttp jar does not carry an
+ * {@code Implementation-Version} manifest entry. This is a public class so the check remains compatible with OkHttp's
+ * Java module boundaries.
*/
private static final String OKHTTP_CLIENT_CLASS_NAME = "okhttp3.OkHttpClient";
- /**
- * The OkHttp {@code Platform} class name, used as the version anchor because the OkHttp jar does not carry an
- * {@code Implementation-Version} manifest entry.
- */
- private static final String OKHTTP_PLATFORM_CLASS_NAME = "okhttp3.internal.platform.Platform";
-
/**
* The runtime version of the OkHttp library. OkHttp jars do not declare an {@code Implementation-Version} manifest
* entry, so the version cannot be detected at runtime and this is always {@code null}; use {@link #isPresent()} to
- * check for the library instead.
+ * check for the library instead. The public {@code OkHttpClient} class is used as the package version anchor.
*/
- private static final LibraryVersion VERSION = LibraryVersion.of(CLIENT_NAME, Classes.Safe.getOne(OKHTTP_PLATFORM_CLASS_NAME));
+ private static final LibraryVersion VERSION = LibraryVersion.of(CLIENT_NAME, Classes.Safe.getOne(OKHTTP_CLIENT_CLASS_NAME));
/**
* Checks if the OkHttp library is present in the classpath.
diff --git a/apiphany-okhttp/src/test/java/org/apiphany/client/http/OkHttpExchangeClientTest.java b/apiphany-okhttp/src/test/java/org/apiphany/client/http/OkHttpExchangeClientTest.java
index b4883625..7683a284 100644
--- a/apiphany-okhttp/src/test/java/org/apiphany/client/http/OkHttpExchangeClientTest.java
+++ b/apiphany-okhttp/src/test/java/org/apiphany/client/http/OkHttpExchangeClientTest.java
@@ -28,8 +28,9 @@ void shouldConvertHeadersToAnInsertionOrderedMap() {
Map