From 58b2f46f8722cc845b11fac40bd469c56f2c553b Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Fri, 14 Feb 2025 15:10:00 -0700 Subject: [PATCH 01/23] test: extra webhook params --- .github/workflows/ci.yml | 3 +- Makefile | 2 +- pom.xml | 19 +-- src/test/cassettes/webhook/all.json | 127 ++++++++++++++++---- src/test/cassettes/webhook/create.json | 43 +++---- src/test/cassettes/webhook/delete.json | 60 ++++----- src/test/cassettes/webhook/retrieve.json | 62 +++++----- src/test/cassettes/webhook/update.json | 62 +++++----- src/test/java/com/easypost/TestUtils.java | 2 +- src/test/java/com/easypost/WebhookTest.java | 37 +++--- 10 files changed, 244 insertions(+), 173 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1104b4ed..0ae1fa2de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,14 +27,13 @@ jobs: ${{ runner.os }}-maven- - name: Install dependencies run: make install - - name: Build Library - run: make build - name: Set up Java ${{ matrix.javaversion }} uses: actions/setup-java@v4 with: distribution: "zulu" java-version: ${{ matrix.javaversion }} - name: Run test with Java ${{ matrix.javaversion }} + # `make test` will also build the project run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test coverage: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index c4e40fae9..9778a9274 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ scan: ## test - Test the project test: - mvn surefire:test + mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true ## update-examples-submodule - Update the examples submodule update-examples-submodule: diff --git a/pom.xml b/pom.xml index 22101bb4f..32870d3e5 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ com.google.errorprone error_prone_core - 2.32.0 + 2.36.0 provided @@ -80,7 +80,7 @@ org.projectlombok lombok - 1.18.30 + 1.18.34 provided @@ -115,16 +115,6 @@ - - org.apache.maven.plugins - maven-surefire-plugin - 3.1.0 - - - junit.jupiter.execution.order.random.seed=99 - - - org.jacoco jacoco-maven-plugin @@ -233,6 +223,7 @@ -XDcompilePolicy=simple -Xplugin:ErrorProne + --should-stop=ifError=FLOW -Xlint:-options -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED @@ -249,12 +240,12 @@ com.google.errorprone error_prone_core - 2.32.0 + 2.36.0 org.projectlombok lombok - 1.18.30 + 1.18.34 diff --git a/src/test/cassettes/webhook/all.json b/src/test/cassettes/webhook/all.json index 8ea7dd756..bad0ef139 100644 --- a/src/test/cassettes/webhook/all.json +++ b/src/test/cassettes/webhook/all.json @@ -1,8 +1,8 @@ [ { - "recordedAt": 1723824060, + "recordedAt": 1739570812, "request": { - "body": "{\n \"webhook\": {\n \"url\": \"http://example.com\"\n }\n}", + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\"\n }\n}", "method": "POST", "headers": { "Accept-Charset": [ @@ -18,7 +18,7 @@ "uri": "https://api.easypost.com/v2/webhooks" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2024-08-16T16:01:00Z\",\n \"id\": \"hook_bb18e6b05be811efbc5b7d8db8d30d2c\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:06:52Z\",\n \"id\": \"hook_fe7d6dd8eb1f11ef89060335e3635f74\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", "httpVersion": null, "headers": { "null": [ @@ -31,7 +31,7 @@ "0" ], "x-node": [ - "bigweb38nuq" + "bigweb54nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -58,23 +58,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "8a4bf43e66bf77bce7872f580036bf50" + "7b4ee13967afbe7be78b0e5e003c591c" ], "x-proxied": [ - "intlb4nuq c0f5e722d1", - "extlb1nuq b6e1b5034c" + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.153254" + "0.267519" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -86,10 +86,10 @@ }, "uri": "https://api.easypost.com/v2/webhooks" }, - "duration": 366 + "duration": 479 }, { - "recordedAt": 1723824060, + "recordedAt": 1739570812, "request": { "body": "", "method": "GET", @@ -104,7 +104,7 @@ "uri": "https://api.easypost.com/v2/webhooks" }, "response": { - "body": "{\n \"webhooks\": [\n {\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2024-08-16T16:01:00Z\",\n \"id\": \"hook_bb18e6b05be811efbc5b7d8db8d30d2c\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n }\n ]\n}", + "body": "{\n \"webhooks\": [\n {\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:06:52Z\",\n \"id\": \"hook_fe7d6dd8eb1f11ef89060335e3635f74\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n }\n ]\n}", "httpVersion": null, "headers": { "null": [ @@ -117,7 +117,7 @@ "0" ], "x-node": [ - "bigweb43nuq" + "bigweb59nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -137,9 +137,6 @@ "strict-transport-security": [ "max-age\u003d31536000; includeSubDomains; preload" ], - "x-canary": [ - "direct" - ], "x-xss-protection": [ "1; mode\u003dblock" ], @@ -147,23 +144,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "8a4bf43b66bf77bce7872f590036bff4" + "7b4ee13767afbe7ce78b0e5f003c5998" ], "x-proxied": [ - "intlb3nuq c0f5e722d1", - "extlb1nuq b6e1b5034c" + "intlb4nuq 51d74985a2", + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.034141" + "0.025554" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -175,6 +172,92 @@ }, "uri": "https://api.easypost.com/v2/webhooks" }, - "duration": 240 + "duration": 232 + }, + { + "recordedAt": 1739570812, + "request": { + "body": "", + "method": "DELETE", + "headers": { + "Accept-Charset": [ + "UTF-8" + ], + "User-Agent": [ + "REDACTED" + ] + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_fe7d6dd8eb1f11ef89060335e3635f74" + }, + "response": { + "body": "{}", + "httpVersion": null, + "headers": { + "null": [ + "HTTP/1.1 200 OK" + ], + "content-length": [ + "2" + ], + "expires": [ + "0" + ], + "x-node": [ + "bigweb34nuq" + ], + "x-frame-options": [ + "SAMEORIGIN" + ], + "x-download-options": [ + "noopen" + ], + "x-permitted-cross-domain-policies": [ + "none" + ], + "x-backend": [ + "easypost" + ], + "pragma": [ + "no-cache" + ], + "strict-transport-security": [ + "max-age\u003d31536000; includeSubDomains; preload" + ], + "x-xss-protection": [ + "1; mode\u003dblock" + ], + "x-content-type-options": [ + "nosniff" + ], + "x-ep-request-uuid": [ + "7b4ee13867afbe7ce78b0e60003c59cc" + ], + "x-proxied": [ + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" + ], + "referrer-policy": [ + "strict-origin-when-cross-origin" + ], + "x-runtime": [ + "0.313071" + ], + "content-type": [ + "application/json; charset\u003dutf-8" + ], + "x-version-label": [ + "easypost-202502141809-12aa7d06fd-master" + ], + "cache-control": [ + "private, no-cache, no-store" + ] + }, + "status": { + "code": 200, + "message": "OK" + }, + "uri": "https://api.easypost.com/v2/webhooks/hook_fe7d6dd8eb1f11ef89060335e3635f74" + }, + "duration": 527 } ] \ No newline at end of file diff --git a/src/test/cassettes/webhook/create.json b/src/test/cassettes/webhook/create.json index ea43e34fc..478b42afd 100644 --- a/src/test/cassettes/webhook/create.json +++ b/src/test/cassettes/webhook/create.json @@ -1,8 +1,8 @@ [ { - "recordedAt": 1723824210, + "recordedAt": 1739570529, "request": { - "body": "{\n \"webhook\": {\n \"url\": \"http://example.com\"\n }\n}", + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\"\n }\n}", "method": "POST", "headers": { "Accept-Charset": [ @@ -18,7 +18,7 @@ "uri": "https://api.easypost.com/v2/webhooks" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2024-08-16T16:03:31Z\",\n \"id\": \"hook_14d6cc1c5be911efbef14beb4b660d57\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:02:09Z\",\n \"id\": \"hook_56312868eb1f11ef92a645dba9f8d8f7\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", "httpVersion": null, "headers": { "null": [ @@ -31,7 +31,7 @@ "0" ], "x-node": [ - "bigweb33nuq" + "bigweb58nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -58,23 +58,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "0580883066bf7852e787409e003656b1" + "52c7c93667afbd61e78a93860039b4c7" ], "x-proxied": [ - "intlb3nuq c0f5e722d1", - "extlb2nuq b6e1b5034c" + "intlb3nuq 51d74985a2", + "extlb1nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.174827" + "0.259378" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -86,10 +86,10 @@ }, "uri": "https://api.easypost.com/v2/webhooks" }, - "duration": 398 + "duration": 485 }, { - "recordedAt": 1723824211, + "recordedAt": 1739570530, "request": { "body": "", "method": "DELETE", @@ -101,7 +101,7 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_14d6cc1c5be911efbef14beb4b660d57" + "uri": "https://api.easypost.com/v2/webhooks/hook_56312868eb1f11ef92a645dba9f8d8f7" }, "response": { "body": "{}", @@ -117,7 +117,7 @@ "0" ], "x-node": [ - "bigweb32nuq" + "bigweb33nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -137,9 +137,6 @@ "strict-transport-security": [ "max-age\u003d31536000; includeSubDomains; preload" ], - "x-canary": [ - "direct" - ], "x-xss-protection": [ "1; mode\u003dblock" ], @@ -147,23 +144,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "0580883466bf7853e787409f0036572b" + "52c7c93167afbd61e78a93870039b556" ], "x-proxied": [ - "intlb3nuq c0f5e722d1", - "extlb2nuq b6e1b5034c" + "intlb3nuq 51d74985a2", + "extlb1nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.396557" + "0.282307" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -173,8 +170,8 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_14d6cc1c5be911efbef14beb4b660d57" + "uri": "https://api.easypost.com/v2/webhooks/hook_56312868eb1f11ef92a645dba9f8d8f7" }, - "duration": 606 + "duration": 494 } ] \ No newline at end of file diff --git a/src/test/cassettes/webhook/delete.json b/src/test/cassettes/webhook/delete.json index cb734417a..49167b6d6 100644 --- a/src/test/cassettes/webhook/delete.json +++ b/src/test/cassettes/webhook/delete.json @@ -1,8 +1,8 @@ [ { - "recordedAt": 1723824179, + "recordedAt": 1739570917, "request": { - "body": "{\n \"webhook\": {\n \"url\": \"http://example.com\"\n }\n}", + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\"\n }\n}", "method": "POST", "headers": { "Accept-Charset": [ @@ -18,7 +18,7 @@ "uri": "https://api.easypost.com/v2/webhooks" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2024-08-16T16:03:00Z\",\n \"id\": \"hook_025ea41a5be911ef8252638bfeba7606\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:08:38Z\",\n \"id\": \"hook_3d87e7ceeb2011efada945e8217ac4b7\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", "httpVersion": null, "headers": { "null": [ @@ -31,7 +31,7 @@ "0" ], "x-node": [ - "bigweb39nuq" + "bigweb41nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -58,23 +58,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "0580883266bf7833e787385e003630c3" + "7b4ee13b67afbee5e78b2449003cb6ec" ], "x-proxied": [ - "intlb4nuq c0f5e722d1", - "extlb2nuq b6e1b5034c" + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.180354" + "0.277447" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -86,10 +86,10 @@ }, "uri": "https://api.easypost.com/v2/webhooks" }, - "duration": 396 + "duration": 502 }, { - "recordedAt": 1723824180, + "recordedAt": 1739570918, "request": { "body": "", "method": "GET", @@ -101,10 +101,10 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_025ea41a5be911ef8252638bfeba7606" + "uri": "https://api.easypost.com/v2/webhooks/hook_3d87e7ceeb2011efada945e8217ac4b7" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2024-08-16T16:03:00Z\",\n \"id\": \"hook_025ea41a5be911ef8252638bfeba7606\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:08:38Z\",\n \"id\": \"hook_3d87e7ceeb2011efada945e8217ac4b7\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", "httpVersion": null, "headers": { "null": [ @@ -117,7 +117,7 @@ "0" ], "x-node": [ - "bigweb41nuq" + "bigweb33nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -144,23 +144,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "0580883066bf7834e787385f00363147" + "7b4ee13567afbee6e78b244b003cb773" ], "x-proxied": [ - "intlb3nuq c0f5e722d1", - "extlb2nuq b6e1b5034c" + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.038295" + "0.029168" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -170,12 +170,12 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_025ea41a5be911ef8252638bfeba7606" + "uri": "https://api.easypost.com/v2/webhooks/hook_3d87e7ceeb2011efada945e8217ac4b7" }, - "duration": 260 + "duration": 242 }, { - "recordedAt": 1723824180, + "recordedAt": 1739570918, "request": { "body": "", "method": "DELETE", @@ -187,7 +187,7 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_025ea41a5be911ef8252638bfeba7606" + "uri": "https://api.easypost.com/v2/webhooks/hook_3d87e7ceeb2011efada945e8217ac4b7" }, "response": { "body": "{}", @@ -230,23 +230,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "0580883566bf7834e78738600036318b" + "7b4ee13967afbee6e78b244c003cb7be" ], "x-proxied": [ - "intlb3nuq c0f5e722d1", - "extlb2nuq b6e1b5034c" + "intlb4nuq 51d74985a2", + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.327085" + "0.273982" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -256,8 +256,8 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_025ea41a5be911ef8252638bfeba7606" + "uri": "https://api.easypost.com/v2/webhooks/hook_3d87e7ceeb2011efada945e8217ac4b7" }, - "duration": 546 + "duration": 500 } ] \ No newline at end of file diff --git a/src/test/cassettes/webhook/retrieve.json b/src/test/cassettes/webhook/retrieve.json index 5be0bfd89..86358aafa 100644 --- a/src/test/cassettes/webhook/retrieve.json +++ b/src/test/cassettes/webhook/retrieve.json @@ -1,8 +1,8 @@ [ { - "recordedAt": 1723824178, + "recordedAt": 1739570761, "request": { - "body": "{\n \"webhook\": {\n \"url\": \"http://example.com\"\n }\n}", + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\"\n }\n}", "method": "POST", "headers": { "Accept-Charset": [ @@ -18,7 +18,7 @@ "uri": "https://api.easypost.com/v2/webhooks" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2024-08-16T16:02:58Z\",\n \"id\": \"hook_017271945be911efac4c110d6e514c58\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:06:01Z\",\n \"id\": \"hook_e0759b80eb1f11ef8362773f978eb468\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", "httpVersion": null, "headers": { "null": [ @@ -31,7 +31,7 @@ "0" ], "x-node": [ - "bigweb34nuq" + "bigweb59nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -58,23 +58,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "0580883466bf7832e787384200362ea8" + "7b4ee13967afbe49e78b0625003c2afe" ], "x-proxied": [ - "intlb4nuq c0f5e722d1", - "extlb2nuq b6e1b5034c" + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.157394" + "0.264324" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -86,10 +86,10 @@ }, "uri": "https://api.easypost.com/v2/webhooks" }, - "duration": 371 + "duration": 478 }, { - "recordedAt": 1723824178, + "recordedAt": 1739570761, "request": { "body": "", "method": "GET", @@ -101,10 +101,10 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_017271945be911efac4c110d6e514c58" + "uri": "https://api.easypost.com/v2/webhooks/hook_e0759b80eb1f11ef8362773f978eb468" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2024-08-16T16:02:58Z\",\n \"id\": \"hook_017271945be911efac4c110d6e514c58\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:06:01Z\",\n \"id\": \"hook_e0759b80eb1f11ef8362773f978eb468\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", "httpVersion": null, "headers": { "null": [ @@ -117,7 +117,7 @@ "0" ], "x-node": [ - "bigweb38nuq" + "bigweb35nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -144,23 +144,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "0580883666bf7832e787384300362f2a" + "7b4ee13767afbe49e78b0626003c2b9e" ], "x-proxied": [ - "intlb4nuq c0f5e722d1", - "extlb2nuq b6e1b5034c" + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.034720" + "0.027960" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -170,12 +170,12 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_017271945be911efac4c110d6e514c58" + "uri": "https://api.easypost.com/v2/webhooks/hook_e0759b80eb1f11ef8362773f978eb468" }, - "duration": 245 + "duration": 241 }, { - "recordedAt": 1723824179, + "recordedAt": 1739570762, "request": { "body": "", "method": "DELETE", @@ -187,7 +187,7 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_017271945be911efac4c110d6e514c58" + "uri": "https://api.easypost.com/v2/webhooks/hook_e0759b80eb1f11ef8362773f978eb468" }, "response": { "body": "{}", @@ -203,7 +203,7 @@ "0" ], "x-node": [ - "bigweb42nuq" + "bigweb35nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -230,23 +230,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "0580883466bf7832e787384400362f7f" + "7b4ee13967afbe4ae78b0627003c2bd7" ], "x-proxied": [ - "intlb3nuq c0f5e722d1", - "extlb2nuq b6e1b5034c" + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.369001" + "0.315824" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -256,8 +256,8 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_017271945be911efac4c110d6e514c58" + "uri": "https://api.easypost.com/v2/webhooks/hook_e0759b80eb1f11ef8362773f978eb468" }, - "duration": 581 + "duration": 531 } ] \ No newline at end of file diff --git a/src/test/cassettes/webhook/update.json b/src/test/cassettes/webhook/update.json index 1407351f4..93cc69524 100644 --- a/src/test/cassettes/webhook/update.json +++ b/src/test/cassettes/webhook/update.json @@ -1,8 +1,8 @@ [ { - "recordedAt": 1723824181, + "recordedAt": 1739570845, "request": { - "body": "{\n \"webhook\": {\n \"url\": \"http://example.com\"\n }\n}", + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\"\n }\n}", "method": "POST", "headers": { "Accept-Charset": [ @@ -18,7 +18,7 @@ "uri": "https://api.easypost.com/v2/webhooks" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2024-08-16T16:03:01Z\",\n \"id\": \"hook_032ca4be5be911ef881b0193adc21e57\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:07:26Z\",\n \"id\": \"hook_12bc3874eb2011ef852b192bc0a3a698\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", "httpVersion": null, "headers": { "null": [ @@ -31,7 +31,7 @@ "0" ], "x-node": [ - "bigweb39nuq" + "bigweb33nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -58,23 +58,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "0580883566bf7835e787386200363271" + "7b4ee13867afbe9de78b16c0003c7a68" ], "x-proxied": [ - "intlb3nuq c0f5e722d1", - "extlb2nuq b6e1b5034c" + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.115087" + "0.265602" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -86,12 +86,12 @@ }, "uri": "https://api.easypost.com/v2/webhooks" }, - "duration": 316 + "duration": 479 }, { - "recordedAt": 1723824182, + "recordedAt": 1739570846, "request": { - "body": "{\n \"webhook\": {}\n}", + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\"\n }\n}", "method": "PUT", "headers": { "Accept-Charset": [ @@ -104,10 +104,10 @@ "application/json" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_032ca4be5be911ef881b0193adc21e57" + "uri": "https://api.easypost.com/v2/webhooks/hook_12bc3874eb2011ef852b192bc0a3a698" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2024-08-16T16:03:01Z\",\n \"id\": \"hook_032ca4be5be911ef881b0193adc21e57\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:07:26Z\",\n \"id\": \"hook_12bc3874eb2011ef852b192bc0a3a698\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", "httpVersion": null, "headers": { "null": [ @@ -147,23 +147,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "0580883066bf7835e78738640036330f" + "7b4ee13467afbe9ee78b16c2003c7b16" ], "x-proxied": [ - "intlb3nuq c0f5e722d1", - "extlb2nuq b6e1b5034c" + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.518599" + "0.539565" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -173,12 +173,12 @@ "code": 201, "message": "Created" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_032ca4be5be911ef881b0193adc21e57" + "uri": "https://api.easypost.com/v2/webhooks/hook_12bc3874eb2011ef852b192bc0a3a698" }, - "duration": 734 + "duration": 772 }, { - "recordedAt": 1723824182, + "recordedAt": 1739570847, "request": { "body": "", "method": "DELETE", @@ -190,7 +190,7 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_032ca4be5be911ef881b0193adc21e57" + "uri": "https://api.easypost.com/v2/webhooks/hook_12bc3874eb2011ef852b192bc0a3a698" }, "response": { "body": "{}", @@ -206,7 +206,7 @@ "0" ], "x-node": [ - "bigweb42nuq" + "bigweb59nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -233,23 +233,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "0580883266bf7836e7873865003633e3" + "7b4ee13b67afbe9fe78b16c3003c7bc2" ], "x-proxied": [ - "intlb4nuq c0f5e722d1", - "extlb2nuq b6e1b5034c" + "intlb3nuq 51d74985a2", + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.440538" + "0.296640" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" + "easypost-202502141809-12aa7d06fd-master" ], "cache-control": [ "private, no-cache, no-store" @@ -259,8 +259,8 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_032ca4be5be911ef881b0193adc21e57" + "uri": "https://api.easypost.com/v2/webhooks/hook_12bc3874eb2011ef852b192bc0a3a698" }, - "duration": 639 + "duration": 510 } ] \ No newline at end of file diff --git a/src/test/java/com/easypost/TestUtils.java b/src/test/java/com/easypost/TestUtils.java index 64a9fcdaa..2f4b04237 100644 --- a/src/test/java/com/easypost/TestUtils.java +++ b/src/test/java/com/easypost/TestUtils.java @@ -175,7 +175,7 @@ public VCR(String testCassettesFolder, String apiKey) throws MissingParameterErr advancedSettings.censors = new Censors("REDACTED").censorHeadersByKeys(HEADER_CENSORS) .censorQueryParametersByKeys(QUERY_CENSORS).censorBodyElementsByKeys(BODY_CENSORS); - advancedSettings.timeFrame = TimeFrame.months6(); + advancedSettings.timeFrame = TimeFrame.months12(); advancedSettings.whenExpired = ExpirationActions.Warn; vcr = new com.easypost.easyvcr.VCR(advancedSettings); diff --git a/src/test/java/com/easypost/WebhookTest.java b/src/test/java/com/easypost/WebhookTest.java index c48d886b2..4814ee8c6 100644 --- a/src/test/java/com/easypost/WebhookTest.java +++ b/src/test/java/com/easypost/WebhookTest.java @@ -51,6 +51,21 @@ public void cleanup() { } } + /** + * Create a webhook. + * + * @return Webhook object + */ + private static Webhook createBasicWebhook() throws EasyPostException { + Map params = new HashMap<>(); + params.put("url", Fixtures.webhookUrl()); + params.put("webhook_secret", Fixtures.webhookSecret()); + + Webhook webhook = vcr.client.webhook.create(params); + testWebhookId = webhook.getId(); // trigger deletion after test + return webhook; + } + /** * Test creating a webhook. * @@ -67,20 +82,6 @@ public void testCreate() throws EasyPostException { assertEquals(Fixtures.webhookUrl(), webhook.getUrl()); } - /** - * Create a webhook. - * - * @return Webhook object - */ - private static Webhook createBasicWebhook() throws EasyPostException { - Map params = new HashMap<>(); - params.put("url", Fixtures.webhookUrl()); - - Webhook webhook = vcr.client.webhook.create(params); - testWebhookId = webhook.getId(); // trigger deletion after test - return webhook; - } - /** * Test retrieving a webhook. * @@ -106,10 +107,8 @@ public void testRetrieve() throws EasyPostException { @Test public void testAll() throws EasyPostException { vcr.setUpTest("all"); - Map params = new HashMap<>(); - params.put("url", Fixtures.webhookUrl()); - vcr.client.webhook.create(params); + createBasicWebhook(); List webhooks = vcr.client.webhook.all(); @@ -127,8 +126,10 @@ public void testUpdate() throws EasyPostException { vcr.setUpTest("update"); Webhook webhook = createBasicWebhook(); + Map params = new HashMap<>(); + params.put("webhook_secret", Fixtures.webhookSecret()); - vcr.client.webhook.update(webhook.getId()); + vcr.client.webhook.update(webhook.getId(), params); assertInstanceOf(Webhook.class, webhook); } From 2793395d3ce3154fa32e7964d104c48ccbb8fb73 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Tue, 18 Feb 2025 13:12:36 -0700 Subject: [PATCH 02/23] chore: debug logging on build for CI --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9778a9274..10cf0020d 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ help: ## build - Builds the project for development build: - mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true -X ## clean - Cleans the project clean: @@ -12,7 +12,7 @@ clean: ## coverage - Test (and build) the project to generate a coverage report coverage: - mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report + mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report -X ## checkstyle - Check if project follows CheckStyle rules (must run install-checkstyle first) checkstyle: @@ -62,11 +62,11 @@ release: ## scan - Scan the project for serious security issues scan: - mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0 + mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0 -X ## test - Test the project test: - mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true + mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true -X ## update-examples-submodule - Update the examples submodule update-examples-submodule: From 299b5da3c67ee9766a8a0af7e2aec8566f4f21ea Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:12:34 -0700 Subject: [PATCH 03/23] chore: add missing compiler arg --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 32870d3e5..318a9c5d8 100644 --- a/pom.xml +++ b/pom.xml @@ -233,6 +233,7 @@ -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED From 6955ad943e4360ce93aea62b99ad3fef83e8c6d3 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:19:31 -0700 Subject: [PATCH 04/23] chore: switch java distribution from zulu to temurin --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/publish.yml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ae1fa2de..52c6696cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - distribution: "zulu" + distribution: "temurin" java-version: "23" # Always use the latest JDK for building - name: Load Maven dependencies cache uses: actions/cache@v3 @@ -30,7 +30,7 @@ jobs: - name: Set up Java ${{ matrix.javaversion }} uses: actions/setup-java@v4 with: - distribution: "zulu" + distribution: "temurin" java-version: ${{ matrix.javaversion }} - name: Run test with Java ${{ matrix.javaversion }} # `make test` will also build the project @@ -41,7 +41,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - distribution: "zulu" + distribution: "temurin" java-version: "23" # Always use the latest JDK for building - name: Load Maven dependencies cache uses: actions/cache@v3 @@ -75,7 +75,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - distribution: "zulu" + distribution: "temurin" java-version: "23" # Always use the latest JDK for building - name: Install checkstyle and style guide run: make install-checkstyle @@ -100,7 +100,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - distribution: "zulu" + distribution: "temurin" java-version: "23" # Always use the latest JDK for building - name: Load Maven dependencies cache uses: actions/cache@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 866e8912a..aac47c185 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,10 +33,10 @@ jobs: fetch-depth: 0 - name: Install JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: "zulu" - java-version: "22" # Always use the latest JDK + distribution: "temurin" + java-version: "23" # Always use the latest JDK server-id: "ossrh" # define environmental variable names server-username: MAVEN_USERNAME From 659867abe6f195512a6a96e8893be81f54d3f100 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:26:54 -0700 Subject: [PATCH 05/23] chore: remove unsupported java versions from CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52c6696cc..d8fc7e7ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - javaversion: ["8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"] + javaversion: ["8", "11", "16", "17", "18", "19", "20", "21", "22", "23"] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 From 1146a1437ead43db728a18fb2435141d16f62571 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:35:16 -0700 Subject: [PATCH 06/23] chore: put back deps --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/publish.yml | 4 ++-- pom.xml | 10 ++++------ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8fc7e7ee..0ae1fa2de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - javaversion: ["8", "11", "16", "17", "18", "19", "20", "21", "22", "23"] + javaversion: ["8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - distribution: "temurin" + distribution: "zulu" java-version: "23" # Always use the latest JDK for building - name: Load Maven dependencies cache uses: actions/cache@v3 @@ -30,7 +30,7 @@ jobs: - name: Set up Java ${{ matrix.javaversion }} uses: actions/setup-java@v4 with: - distribution: "temurin" + distribution: "zulu" java-version: ${{ matrix.javaversion }} - name: Run test with Java ${{ matrix.javaversion }} # `make test` will also build the project @@ -41,7 +41,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - distribution: "temurin" + distribution: "zulu" java-version: "23" # Always use the latest JDK for building - name: Load Maven dependencies cache uses: actions/cache@v3 @@ -75,7 +75,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - distribution: "temurin" + distribution: "zulu" java-version: "23" # Always use the latest JDK for building - name: Install checkstyle and style guide run: make install-checkstyle @@ -100,7 +100,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - distribution: "temurin" + distribution: "zulu" java-version: "23" # Always use the latest JDK for building - name: Load Maven dependencies cache uses: actions/cache@v3 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index aac47c185..4182e7eb4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,7 +25,7 @@ on: jobs: release: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 @@ -35,7 +35,7 @@ jobs: - name: Install JDK uses: actions/setup-java@v4 with: - distribution: "temurin" + distribution: "zulu" java-version: "23" # Always use the latest JDK server-id: "ossrh" # define environmental variable names diff --git a/pom.xml b/pom.xml index 318a9c5d8..c17d49ab1 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ com.google.errorprone error_prone_core - 2.36.0 + 2.32.0 provided @@ -80,7 +80,7 @@ org.projectlombok lombok - 1.18.34 + 1.18.30 provided @@ -223,7 +223,6 @@ -XDcompilePolicy=simple -Xplugin:ErrorProne - --should-stop=ifError=FLOW -Xlint:-options -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED @@ -233,7 +232,6 @@ -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED - -J--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED @@ -241,12 +239,12 @@ com.google.errorprone error_prone_core - 2.36.0 + 2.32.0 org.projectlombok lombok - 1.18.34 + 1.18.30 From c77aa453ae7fab240be384321f295181f796f898 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:44:04 -0700 Subject: [PATCH 07/23] fix: build --- .github/workflows/ci.yml | 13 +++++++------ Makefile | 14 +++++++++----- pom.xml | 10 ++++++++++ 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ae1fa2de..d9a949a65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: distribution: "zulu" java-version: "23" # Always use the latest JDK for building - name: Load Maven dependencies cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-build${{ matrix.javaversion }}-${{ hashFiles('**/pom.xml') }} @@ -27,14 +27,15 @@ jobs: ${{ runner.os }}-maven- - name: Install dependencies run: make install + - name: Build Library + run: make build - name: Set up Java ${{ matrix.javaversion }} uses: actions/setup-java@v4 with: distribution: "zulu" java-version: ${{ matrix.javaversion }} - name: Run test with Java ${{ matrix.javaversion }} - # `make test` will also build the project - run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test + run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test-ci coverage: runs-on: ubuntu-latest steps: @@ -44,7 +45,7 @@ jobs: distribution: "zulu" java-version: "23" # Always use the latest JDK for building - name: Load Maven dependencies cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-build-coverage-${{ hashFiles('**/pom.xml') }} @@ -80,7 +81,7 @@ jobs: - name: Install checkstyle and style guide run: make install-checkstyle - name: Load Maven dependencies and CVE database cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository # The CVE database is included in the Maven repository folder key: ${{ runner.os }}-maven-security-${{ hashFiles('**/pom.xml') }} @@ -103,7 +104,7 @@ jobs: distribution: "zulu" java-version: "23" # Always use the latest JDK for building - name: Load Maven dependencies cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-build-coverage-${{ hashFiles('**/pom.xml') }} diff --git a/Makefile b/Makefile index 10cf0020d..43f011db7 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ help: ## build - Builds the project for development build: - mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true -X + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true ## clean - Cleans the project clean: @@ -12,7 +12,7 @@ clean: ## coverage - Test (and build) the project to generate a coverage report coverage: - mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report -X + mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report ## checkstyle - Check if project follows CheckStyle rules (must run install-checkstyle first) checkstyle: @@ -62,15 +62,19 @@ release: ## scan - Scan the project for serious security issues scan: - mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0 -X + mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0 ## test - Test the project test: - mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true -X + mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true + +## test-ci - Test the project on CI (does not rebuild the project) +test-ci: + mvn surefire:test ## update-examples-submodule - Update the examples submodule update-examples-submodule: git submodule init git submodule update --remote -.PHONY: help build clean coverage docs install-checkstyle install-styleguide install lint publish publish-dry release scan scan-strict test update-examples-submodule +.PHONY: help build clean coverage docs install-checkstyle install-styleguide install lint publish publish-dry release scan scan-strict test test-ci update-examples-submodule diff --git a/pom.xml b/pom.xml index c17d49ab1..22101bb4f 100644 --- a/pom.xml +++ b/pom.xml @@ -115,6 +115,16 @@ + + org.apache.maven.plugins + maven-surefire-plugin + 3.1.0 + + + junit.jupiter.execution.order.random.seed=99 + + + org.jacoco jacoco-maven-plugin From 1d24eaffc8eb08f5782deb86d3100b13d179e3c3 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:10:37 -0700 Subject: [PATCH 08/23] chore: use builtin cache mechanism --- .github/workflows/ci.yml | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9a949a65..01f07066a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,13 +18,7 @@ jobs: with: distribution: "zulu" java-version: "23" # Always use the latest JDK for building - - name: Load Maven dependencies cache - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-build${{ matrix.javaversion }}-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + cache: "maven" - name: Install dependencies run: make install - name: Build Library @@ -44,13 +38,7 @@ jobs: with: distribution: "zulu" java-version: "23" # Always use the latest JDK for building - - name: Load Maven dependencies cache - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-build-coverage-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + cache: "maven" - name: Install dependencies run: make install - name: Test coverage @@ -78,15 +66,9 @@ jobs: with: distribution: "zulu" java-version: "23" # Always use the latest JDK for building + cache: "maven" - name: Install checkstyle and style guide run: make install-checkstyle - - name: Load Maven dependencies and CVE database cache - uses: actions/cache@v4 - with: - path: ~/.m2/repository # The CVE database is included in the Maven repository folder - key: ${{ runner.os }}-maven-security-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - name: Lint run: make lint - name: Upload Test results @@ -103,13 +85,7 @@ jobs: with: distribution: "zulu" java-version: "23" # Always use the latest JDK for building - - name: Load Maven dependencies cache - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-build-coverage-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- + cache: "maven" - name: Install Dependencies run: make install - name: Generate Docs From e125b305d698c79a6c5b0f2c206acf2e4cbd74a4 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:12:14 -0700 Subject: [PATCH 09/23] chore: enable debugging --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 43f011db7..cdfe07bbc 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ help: ## build - Builds the project for development build: - mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true -X ## clean - Cleans the project clean: @@ -12,7 +12,7 @@ clean: ## coverage - Test (and build) the project to generate a coverage report coverage: - mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report + mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report -X ## checkstyle - Check if project follows CheckStyle rules (must run install-checkstyle first) checkstyle: @@ -20,7 +20,7 @@ checkstyle: ## docs - Generates library documentation docs: - mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true -X cp -R target/apidocs/ ./docs/ ## install-checkstyle - Install the Checkstyle tool (Unix only) @@ -62,11 +62,11 @@ release: ## scan - Scan the project for serious security issues scan: - mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0 + mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0 -X ## test - Test the project test: - mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true + mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true -X ## test-ci - Test the project on CI (does not rebuild the project) test-ci: From 3da78521bce259a2343d11a1f4c2b8fe585a6cb4 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:34:24 -0700 Subject: [PATCH 10/23] chore: bump all plugins --- Makefile | 3 ++- pom.xml | 51 ++++++++++++++++++++++++++++----------------------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index cdfe07bbc..1f184b16c 100644 --- a/Makefile +++ b/Makefile @@ -39,8 +39,9 @@ init-examples-submodule: ## install - Install requirements install: | install-checkstyle +# TODO: Add back in the scan target to lint ## lint - Lints the project -lint: checkstyle scan +lint: checkstyle ## publish - Publish a release of the project (will build the project via the `mvn deploy` command) # @parameters: diff --git a/pom.xml b/pom.xml index 22101bb4f..1cc3b540a 100644 --- a/pom.xml +++ b/pom.xml @@ -128,7 +128,7 @@ org.jacoco jacoco-maven-plugin - 0.8.10 + 0.8.12 @@ -173,12 +173,12 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.1 attach-sources - jar-no-fork + jar @@ -191,7 +191,7 @@ -html true - 3.5.0 + 3.11.2 attach-javadocs @@ -204,7 +204,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.1.0 + 3.2.7 @@ -230,6 +230,8 @@ 8 UTF-8 true + 256m + 1024m -XDcompilePolicy=simple -Xplugin:ErrorProne @@ -262,7 +264,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true ossrh @@ -273,6 +275,7 @@ org.codehaus.mojo templating-maven-plugin + 1.0.0 @@ -286,7 +289,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.2 + 3.6.0 ${basedir}/easypost_java_style.xml UTF-8 @@ -315,7 +318,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.3.0 + 3.5.0 enforce-java @@ -332,23 +335,25 @@ - + + From 1721ca1cc9d79c1dc246ba7cf417854957b94573 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:38:46 -0700 Subject: [PATCH 11/23] chore: add full stack traces --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 1f184b16c..cf52ecaf3 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ help: ## build - Builds the project for development build: - mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true -X + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true -X -e ## clean - Cleans the project clean: @@ -12,7 +12,7 @@ clean: ## coverage - Test (and build) the project to generate a coverage report coverage: - mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report -X + mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report -X -e ## checkstyle - Check if project follows CheckStyle rules (must run install-checkstyle first) checkstyle: @@ -20,7 +20,7 @@ checkstyle: ## docs - Generates library documentation docs: - mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true -X + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true -X -e cp -R target/apidocs/ ./docs/ ## install-checkstyle - Install the Checkstyle tool (Unix only) @@ -63,11 +63,11 @@ release: ## scan - Scan the project for serious security issues scan: - mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0 -X + mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0 -X -e ## test - Test the project test: - mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true -X + mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true -X -e ## test-ci - Test the project on CI (does not rebuild the project) test-ci: From 91d95a7e6498a8c6ddc1c780f7a0f93a262dac09 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:46:26 -0700 Subject: [PATCH 12/23] chore: attempt to simplify build, bump template plugin --- pom.xml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 1cc3b540a..5e4491baa 100644 --- a/pom.xml +++ b/pom.xml @@ -201,14 +201,14 @@ - + + - --pinentry-mode + -pinentry-mode loopback @@ -221,7 +221,7 @@ - + --> org.apache.maven.plugins maven-compiler-plugin @@ -261,7 +261,7 @@ - + org.codehaus.mojo templating-maven-plugin - - 1.0.0 + 3.0.0 filtering-java-templates @@ -286,7 +285,7 @@ - + + 9.3 @@ -314,8 +313,8 @@ - - + --> + + **/model/** @@ -169,8 +169,8 @@ - - + --> + + 4.11.0 test @@ -46,30 +46,32 @@ com.google.code.gson gson - 2.10.1 + 2.12.1 + compile com.google.errorprone error_prone_core - 2.32.0 + 2.36.0 provided org.junit.jupiter junit-jupiter - 5.9.3 + 5.11.4 test org.hamcrest hamcrest - 2.2 + 3.0 test org.jetbrains annotations - 24.0.1 + 26.0.2 + compile com.easypost @@ -80,7 +82,7 @@ org.projectlombok lombok - 1.18.30 + 1.18.36 provided @@ -251,12 +253,12 @@ com.google.errorprone error_prone_core - 2.32.0 + 2.36.0 org.projectlombok lombok - 1.18.30 + 1.18.36 From 6513d00b24523ea0553622ea088414cc70c354d7 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 16:30:29 -0700 Subject: [PATCH 15/23] fix: errorprone arg --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 2770b7dab..3a8870640 100644 --- a/pom.xml +++ b/pom.xml @@ -237,6 +237,7 @@ -XDcompilePolicy=simple -Xplugin:ErrorProne + --should-stop=ifError=FLOW -Xlint:-options -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED From 64b1ffd72042a51065aa8539ef10f4d82f8a4309 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 16:31:51 -0700 Subject: [PATCH 16/23] chore: attempt java 21 vs 23 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ceb0cd62..0e30fd080 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: "zulu" - java-version: "23" # Always use the latest JDK for building + java-version: "21" # Always use the latest JDK for building cache: "maven" - name: Install dependencies run: make install @@ -65,7 +65,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: "zulu" - java-version: "23" # Always use the latest JDK for building + java-version: "21" # Always use the latest JDK for building cache: "maven" - name: Install checkstyle and style guide run: make install-checkstyle @@ -84,7 +84,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: "zulu" - java-version: "23" # Always use the latest JDK for building + java-version: "21" # Always use the latest JDK for building cache: "maven" - name: Install Dependencies run: make install From 99602e46204cbd038785c61e2ac04311fcbf6dc8 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 16:43:14 -0700 Subject: [PATCH 17/23] chore: put back the things --- .github/workflows/ci.yml | 62 +++++++++++++++--------------- .github/workflows/publish.yml | 2 +- CHANGELOG.md | 4 ++ Makefile | 13 +++---- pom.xml | 72 +++++++++++++++++------------------ 5 files changed, 77 insertions(+), 76 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e30fd080..5a908e50b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: "zulu" - java-version: "21" # Always use the latest JDK for building + java-version: "21" # Always use the latest stable JDK for building cache: "maven" - name: Install dependencies run: make install @@ -30,34 +30,34 @@ jobs: java-version: ${{ matrix.javaversion }} - name: Run test with Java ${{ matrix.javaversion }} run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test-ci - # coverage: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: actions/setup-java@v4 - # with: - # distribution: "zulu" - # java-version: "23" # Always use the latest JDK for building - # cache: "maven" - # - name: Install dependencies - # run: make install - # - name: Test coverage - # run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make coverage - # - name: Load Rust cache - # if: github.ref == 'refs/heads/master' - # uses: Swatinem/rust-cache@v2 - # - name: Install grcov - # if: github.ref == 'refs/heads/master' - # run: cargo install grcov --version 0.8.13 - # - name: Convert coverage report - # if: github.ref == 'refs/heads/master' - # run: grcov target/site/jacoco/jacoco.xml --source-dir ./ --ignore "target/*" > coverage.lcov - # - name: Coveralls - # if: github.ref == 'refs/heads/master' - # uses: coverallsapp/github-action@master - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} - # path-to-lcov: "./coverage.lcov" + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: "21" # Always use the latest stable JDK for building + cache: "maven" + - name: Install dependencies + run: make install + - name: Test coverage + run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make coverage + - name: Load Rust cache + if: github.ref == 'refs/heads/master' + uses: Swatinem/rust-cache@v2 + - name: Install grcov + if: github.ref == 'refs/heads/master' + run: cargo install grcov --version 0.8.13 + - name: Convert coverage report + if: github.ref == 'refs/heads/master' + run: grcov target/site/jacoco/jacoco.xml --source-dir ./ --ignore "target/*" > coverage.lcov + - name: Coveralls + if: github.ref == 'refs/heads/master' + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: "./coverage.lcov" lint: runs-on: ubuntu-latest steps: @@ -65,7 +65,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: "zulu" - java-version: "21" # Always use the latest JDK for building + java-version: "21" # Always use the latest stable JDK for building cache: "maven" - name: Install checkstyle and style guide run: make install-checkstyle @@ -84,7 +84,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: "zulu" - java-version: "21" # Always use the latest JDK for building + java-version: "21" # Always use the latest stable JDK for building cache: "maven" - name: Install Dependencies run: make install diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4182e7eb4..03140bcf9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,7 +36,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: "zulu" - java-version: "23" # Always use the latest JDK + java-version: "21" # Always use the latest stable JDK for building server-id: "ossrh" # define environmental variable names server-username: MAVEN_USERNAME diff --git a/CHANGELOG.md b/CHANGELOG.md index c18f2a505..93fa540af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## Next Release + +- Bumps dependencies + ## v7.4.4 (2025-01-03) - Fixes how params are passed to the API when buying a pickup and providing a pickup rate (closes #340) diff --git a/Makefile b/Makefile index cf52ecaf3..43f011db7 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ help: ## build - Builds the project for development build: - mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true -X -e + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true ## clean - Cleans the project clean: @@ -12,7 +12,7 @@ clean: ## coverage - Test (and build) the project to generate a coverage report coverage: - mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report -X -e + mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report ## checkstyle - Check if project follows CheckStyle rules (must run install-checkstyle first) checkstyle: @@ -20,7 +20,7 @@ checkstyle: ## docs - Generates library documentation docs: - mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true -X -e + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true cp -R target/apidocs/ ./docs/ ## install-checkstyle - Install the Checkstyle tool (Unix only) @@ -39,9 +39,8 @@ init-examples-submodule: ## install - Install requirements install: | install-checkstyle -# TODO: Add back in the scan target to lint ## lint - Lints the project -lint: checkstyle +lint: checkstyle scan ## publish - Publish a release of the project (will build the project via the `mvn deploy` command) # @parameters: @@ -63,11 +62,11 @@ release: ## scan - Scan the project for serious security issues scan: - mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0 -X -e + mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0 ## test - Test the project test: - mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true -X -e + mvn test -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true ## test-ci - Test the project on CI (does not rebuild the project) test-ci: diff --git a/pom.xml b/pom.xml index 3a8870640..4337c13d1 100644 --- a/pom.xml +++ b/pom.xml @@ -127,13 +127,13 @@ - **/model/** @@ -171,8 +171,8 @@ - --> - - - -pinentry-mode loopback @@ -223,7 +223,7 @@ - --> + org.apache.maven.plugins maven-compiler-plugin @@ -232,8 +232,6 @@ 8 UTF-8 true - 256m - 1024m -XDcompilePolicy=simple -Xplugin:ErrorProne @@ -264,7 +262,7 @@ - + org.codehaus.mojo templating-maven-plugin @@ -288,7 +286,7 @@ - 9.3 @@ -316,8 +314,8 @@ - --> - - - + + + 9.2.0 + + dependency-check-suppressions.xml + 7 + 7 + + + + + check + + + + From e44c8da8b1dc540cdde243c6ff5873e833749d3f Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 16:47:32 -0700 Subject: [PATCH 18/23] fix: mockito reference --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4337c13d1..3471fd124 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ org.mockito - mockito-core + mockito-inline 4.11.0 test From 2abd2bef02d253331a217180b8119936532acbed Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 19 Feb 2025 16:51:37 -0700 Subject: [PATCH 19/23] fix: downgrade dep checker --- pom.xml | 4 ++-- src/main/java/com/easypost/service/WebhookService.java | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 3471fd124..08044450b 100644 --- a/pom.xml +++ b/pom.xml @@ -339,8 +339,8 @@ org.owasp dependency-check-maven - - 9.2.0 + + 8.4.0 dependency-check-suppressions.xml 7 diff --git a/src/main/java/com/easypost/service/WebhookService.java b/src/main/java/com/easypost/service/WebhookService.java index e08663734..19c2d5032 100644 --- a/src/main/java/com/easypost/service/WebhookService.java +++ b/src/main/java/com/easypost/service/WebhookService.java @@ -108,11 +108,8 @@ public Webhook update(final String id) throws EasyPostException { * @throws EasyPostException when the request fails. */ public Webhook update(final String id, final Map params) throws EasyPostException { - Map wrappedParams = new HashMap(); - wrappedParams.put("webhook", params); - String endpoint = "webhooks/" + id; - return Requestor.request(RequestMethod.PUT, endpoint, wrappedParams, Webhook.class, client); + return Requestor.request(RequestMethod.PUT, endpoint, params, Webhook.class, client); } } From 10402f8acb0a860d135fca4fd4035c70e0503ffc Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Thu, 20 Feb 2025 09:56:09 -0700 Subject: [PATCH 20/23] test: custom headers params --- examples | 2 +- src/main/java/com/easypost/model/Webhook.java | 3 +- .../easypost/model/WebhookCustomHeader.java | 9 +++ src/test/cassettes/webhook/all.json | 52 ++++++++-------- src/test/cassettes/webhook/create.json | 40 ++++++------ src/test/cassettes/webhook/delete.json | 62 ++++++++++--------- src/test/cassettes/webhook/retrieve.json | 54 ++++++++-------- src/test/cassettes/webhook/update.json | 60 +++++++++--------- src/test/java/com/easypost/Fixtures.java | 24 ++++--- src/test/java/com/easypost/WebhookTest.java | 13 +++- .../easypost/fixtures/FixtureStructure.java | 11 +--- .../fixtures/components/Webhooks.java | 20 ++++++ 12 files changed, 200 insertions(+), 150 deletions(-) create mode 100644 src/main/java/com/easypost/model/WebhookCustomHeader.java create mode 100644 src/test/java/com/easypost/fixtures/components/Webhooks.java diff --git a/examples b/examples index 0492e408e..7669825fb 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 0492e408e1b37b2ec18bcb4a4d228ab0f458f59d +Subproject commit 7669825fb53be074d7f585c78c4f38ad4fefe0d0 diff --git a/src/main/java/com/easypost/model/Webhook.java b/src/main/java/com/easypost/model/Webhook.java index ddb176940..4e6ca3218 100644 --- a/src/main/java/com/easypost/model/Webhook.java +++ b/src/main/java/com/easypost/model/Webhook.java @@ -1,11 +1,12 @@ package com.easypost.model; import java.util.Date; - +import java.util.List; import lombok.Getter; @Getter public final class Webhook extends EasyPostResource { private String url; private Date disabledAt; + private List customHeaders; } diff --git a/src/main/java/com/easypost/model/WebhookCustomHeader.java b/src/main/java/com/easypost/model/WebhookCustomHeader.java new file mode 100644 index 000000000..28718fb66 --- /dev/null +++ b/src/main/java/com/easypost/model/WebhookCustomHeader.java @@ -0,0 +1,9 @@ +package com.easypost.model; + +import lombok.Getter; + +@Getter +public final class WebhookCustomHeader extends EasyPostResource { + private String name; + private String value; +} diff --git a/src/test/cassettes/webhook/all.json b/src/test/cassettes/webhook/all.json index bad0ef139..6549f7c53 100644 --- a/src/test/cassettes/webhook/all.json +++ b/src/test/cassettes/webhook/all.json @@ -1,8 +1,8 @@ [ { - "recordedAt": 1739570812, + "recordedAt": 1740070340, "request": { - "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\"\n }\n}", + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n }\n}", "method": "POST", "headers": { "Accept-Charset": [ @@ -18,20 +18,20 @@ "uri": "https://api.easypost.com/v2/webhooks" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:06:52Z\",\n \"id\": \"hook_fe7d6dd8eb1f11ef89060335e3635f74\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:52:20Z\",\n \"id\": \"hook_0cb0f41cefab11ef807963ca33822ef2\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", "httpVersion": null, "headers": { "null": [ "HTTP/1.1 201 Created" ], "content-length": [ - "161" + "213" ], "expires": [ "0" ], "x-node": [ - "bigweb54nuq" + "bigweb59nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -58,23 +58,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "7b4ee13967afbe7be78b0e5e003c591c" + "c6a31f9167b75dc4e2b7e27500432cfc" ], "x-proxied": [ - "intlb3nuq 51d74985a2", + "intlb4nuq 51d74985a2", "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.267519" + "0.441378" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -86,10 +86,10 @@ }, "uri": "https://api.easypost.com/v2/webhooks" }, - "duration": 479 + "duration": 555 }, { - "recordedAt": 1739570812, + "recordedAt": 1740070340, "request": { "body": "", "method": "GET", @@ -104,20 +104,20 @@ "uri": "https://api.easypost.com/v2/webhooks" }, "response": { - "body": "{\n \"webhooks\": [\n {\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:06:52Z\",\n \"id\": \"hook_fe7d6dd8eb1f11ef89060335e3635f74\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n }\n ]\n}", + "body": "{\n \"webhooks\": [\n {\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:52:20Z\",\n \"id\": \"hook_0cb0f41cefab11ef807963ca33822ef2\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n }\n ]\n}", "httpVersion": null, "headers": { "null": [ "HTTP/1.1 200 OK" ], "content-length": [ - "176" + "228" ], "expires": [ "0" ], "x-node": [ - "bigweb59nuq" + "bigweb56nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -144,23 +144,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "7b4ee13767afbe7ce78b0e5f003c5998" + "c6a31f9367b75dc4e2b7e29000432d93" ], "x-proxied": [ - "intlb4nuq 51d74985a2", + "intlb3nuq 51d74985a2", "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.025554" + "0.032402" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -172,10 +172,10 @@ }, "uri": "https://api.easypost.com/v2/webhooks" }, - "duration": 232 + "duration": 145 }, { - "recordedAt": 1739570812, + "recordedAt": 1740070341, "request": { "body": "", "method": "DELETE", @@ -187,7 +187,7 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_fe7d6dd8eb1f11ef89060335e3635f74" + "uri": "https://api.easypost.com/v2/webhooks/hook_0cb0f41cefab11ef807963ca33822ef2" }, "response": { "body": "{}", @@ -230,7 +230,7 @@ "nosniff" ], "x-ep-request-uuid": [ - "7b4ee13867afbe7ce78b0e60003c59cc" + "c6a31f9267b75dc5e2b7e29100432dcb" ], "x-proxied": [ "intlb3nuq 51d74985a2", @@ -240,13 +240,13 @@ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.313071" + "0.394873" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -256,8 +256,8 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_fe7d6dd8eb1f11ef89060335e3635f74" + "uri": "https://api.easypost.com/v2/webhooks/hook_0cb0f41cefab11ef807963ca33822ef2" }, - "duration": 527 + "duration": 494 } ] \ No newline at end of file diff --git a/src/test/cassettes/webhook/create.json b/src/test/cassettes/webhook/create.json index 478b42afd..c4b397d25 100644 --- a/src/test/cassettes/webhook/create.json +++ b/src/test/cassettes/webhook/create.json @@ -1,8 +1,8 @@ [ { - "recordedAt": 1739570529, + "recordedAt": 1740070316, "request": { - "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\"\n }\n}", + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n }\n}", "method": "POST", "headers": { "Accept-Charset": [ @@ -18,20 +18,20 @@ "uri": "https://api.easypost.com/v2/webhooks" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:02:09Z\",\n \"id\": \"hook_56312868eb1f11ef92a645dba9f8d8f7\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:51:56Z\",\n \"id\": \"hook_fe5d2a84efaa11efb84e61dfc018c5b8\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", "httpVersion": null, "headers": { "null": [ "HTTP/1.1 201 Created" ], "content-length": [ - "161" + "213" ], "expires": [ "0" ], "x-node": [ - "bigweb58nuq" + "bigweb36nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -58,23 +58,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "52c7c93667afbd61e78a93860039b4c7" + "c6a31f8f67b75dace2b7da570043128a" ], "x-proxied": [ "intlb3nuq 51d74985a2", - "extlb1nuq 99aac35317" + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.259378" + "0.427009" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -86,10 +86,10 @@ }, "uri": "https://api.easypost.com/v2/webhooks" }, - "duration": 485 + "duration": 534 }, { - "recordedAt": 1739570530, + "recordedAt": 1740070317, "request": { "body": "", "method": "DELETE", @@ -101,7 +101,7 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_56312868eb1f11ef92a645dba9f8d8f7" + "uri": "https://api.easypost.com/v2/webhooks/hook_fe5d2a84efaa11efb84e61dfc018c5b8" }, "response": { "body": "{}", @@ -117,7 +117,7 @@ "0" ], "x-node": [ - "bigweb33nuq" + "bigweb36nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -144,23 +144,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "52c7c93167afbd61e78a93870039b556" + "c6a31f8d67b75dace2b7da6f0043130a" ], "x-proxied": [ - "intlb3nuq 51d74985a2", - "extlb1nuq 99aac35317" + "intlb4nuq 51d74985a2", + "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.282307" + "0.338361" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -170,8 +170,8 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_56312868eb1f11ef92a645dba9f8d8f7" + "uri": "https://api.easypost.com/v2/webhooks/hook_fe5d2a84efaa11efb84e61dfc018c5b8" }, - "duration": 494 + "duration": 435 } ] \ No newline at end of file diff --git a/src/test/cassettes/webhook/delete.json b/src/test/cassettes/webhook/delete.json index 49167b6d6..4ce5d1bca 100644 --- a/src/test/cassettes/webhook/delete.json +++ b/src/test/cassettes/webhook/delete.json @@ -1,8 +1,8 @@ [ { - "recordedAt": 1739570917, + "recordedAt": 1740070361, "request": { - "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\"\n }\n}", + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n }\n}", "method": "POST", "headers": { "Accept-Charset": [ @@ -18,20 +18,20 @@ "uri": "https://api.easypost.com/v2/webhooks" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:08:38Z\",\n \"id\": \"hook_3d87e7ceeb2011efada945e8217ac4b7\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:52:41Z\",\n \"id\": \"hook_190c06d4efab11efb7663b222d4bf486\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", "httpVersion": null, "headers": { "null": [ "HTTP/1.1 201 Created" ], "content-length": [ - "161" + "213" ], "expires": [ "0" ], "x-node": [ - "bigweb41nuq" + "bigweb43nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -51,6 +51,9 @@ "strict-transport-security": [ "max-age\u003d31536000; includeSubDomains; preload" ], + "x-canary": [ + "direct" + ], "x-xss-protection": [ "1; mode\u003dblock" ], @@ -58,7 +61,7 @@ "nosniff" ], "x-ep-request-uuid": [ - "7b4ee13b67afbee5e78b2449003cb6ec" + "c6a31f9267b75dd9e2b7eace0043480b" ], "x-proxied": [ "intlb3nuq 51d74985a2", @@ -68,13 +71,13 @@ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.277447" + "0.436254" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -86,10 +89,10 @@ }, "uri": "https://api.easypost.com/v2/webhooks" }, - "duration": 502 + "duration": 563 }, { - "recordedAt": 1739570918, + "recordedAt": 1740070361, "request": { "body": "", "method": "GET", @@ -101,23 +104,23 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_3d87e7ceeb2011efada945e8217ac4b7" + "uri": "https://api.easypost.com/v2/webhooks/hook_190c06d4efab11efb7663b222d4bf486" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:08:38Z\",\n \"id\": \"hook_3d87e7ceeb2011efada945e8217ac4b7\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:52:41Z\",\n \"id\": \"hook_190c06d4efab11efb7663b222d4bf486\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", "httpVersion": null, "headers": { "null": [ "HTTP/1.1 200 OK" ], "content-length": [ - "161" + "213" ], "expires": [ "0" ], "x-node": [ - "bigweb33nuq" + "bigweb38nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -144,7 +147,7 @@ "nosniff" ], "x-ep-request-uuid": [ - "7b4ee13567afbee6e78b244b003cb773" + "c6a31f9167b75dd9e2b7eacf0043489f" ], "x-proxied": [ "intlb3nuq 51d74985a2", @@ -154,13 +157,13 @@ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.029168" + "0.025882" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -170,12 +173,12 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_3d87e7ceeb2011efada945e8217ac4b7" + "uri": "https://api.easypost.com/v2/webhooks/hook_190c06d4efab11efb7663b222d4bf486" }, - "duration": 242 + "duration": 142 }, { - "recordedAt": 1739570918, + "recordedAt": 1740070362, "request": { "body": "", "method": "DELETE", @@ -187,7 +190,7 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_3d87e7ceeb2011efada945e8217ac4b7" + "uri": "https://api.easypost.com/v2/webhooks/hook_190c06d4efab11efb7663b222d4bf486" }, "response": { "body": "{}", @@ -203,7 +206,7 @@ "0" ], "x-node": [ - "bigweb36nuq" + "bigweb32nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -223,6 +226,9 @@ "strict-transport-security": [ "max-age\u003d31536000; includeSubDomains; preload" ], + "x-canary": [ + "direct" + ], "x-xss-protection": [ "1; mode\u003dblock" ], @@ -230,23 +236,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "7b4ee13967afbee6e78b244c003cb7be" + "c6a31f8e67b75dd9e2b7ead0004348cc" ], "x-proxied": [ - "intlb4nuq 51d74985a2", + "intlb3nuq 51d74985a2", "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.273982" + "0.354045" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -256,8 +262,8 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_3d87e7ceeb2011efada945e8217ac4b7" + "uri": "https://api.easypost.com/v2/webhooks/hook_190c06d4efab11efb7663b222d4bf486" }, - "duration": 500 + "duration": 456 } ] \ No newline at end of file diff --git a/src/test/cassettes/webhook/retrieve.json b/src/test/cassettes/webhook/retrieve.json index 86358aafa..1eca34221 100644 --- a/src/test/cassettes/webhook/retrieve.json +++ b/src/test/cassettes/webhook/retrieve.json @@ -1,8 +1,8 @@ [ { - "recordedAt": 1739570761, + "recordedAt": 1740070379, "request": { - "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\"\n }\n}", + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n }\n}", "method": "POST", "headers": { "Accept-Charset": [ @@ -18,20 +18,20 @@ "uri": "https://api.easypost.com/v2/webhooks" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:06:01Z\",\n \"id\": \"hook_e0759b80eb1f11ef8362773f978eb468\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:52:59Z\",\n \"id\": \"hook_23c7531cefab11efbe44197603026978\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", "httpVersion": null, "headers": { "null": [ "HTTP/1.1 201 Created" ], "content-length": [ - "161" + "213" ], "expires": [ "0" ], "x-node": [ - "bigweb59nuq" + "bigweb34nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -58,7 +58,7 @@ "nosniff" ], "x-ep-request-uuid": [ - "7b4ee13967afbe49e78b0625003c2afe" + "c6a31f9267b75debe2b7eff800435dd3" ], "x-proxied": [ "intlb3nuq 51d74985a2", @@ -68,13 +68,13 @@ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.264324" + "0.402787" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -86,10 +86,10 @@ }, "uri": "https://api.easypost.com/v2/webhooks" }, - "duration": 478 + "duration": 516 }, { - "recordedAt": 1739570761, + "recordedAt": 1740070379, "request": { "body": "", "method": "GET", @@ -101,23 +101,23 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_e0759b80eb1f11ef8362773f978eb468" + "uri": "https://api.easypost.com/v2/webhooks/hook_23c7531cefab11efbe44197603026978" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:06:01Z\",\n \"id\": \"hook_e0759b80eb1f11ef8362773f978eb468\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:52:59Z\",\n \"id\": \"hook_23c7531cefab11efbe44197603026978\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", "httpVersion": null, "headers": { "null": [ "HTTP/1.1 200 OK" ], "content-length": [ - "161" + "213" ], "expires": [ "0" ], "x-node": [ - "bigweb35nuq" + "bigweb54nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -144,7 +144,7 @@ "nosniff" ], "x-ep-request-uuid": [ - "7b4ee13767afbe49e78b0626003c2b9e" + "c6a31f8c67b75debe2b7eff900435e6e" ], "x-proxied": [ "intlb3nuq 51d74985a2", @@ -154,13 +154,13 @@ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.027960" + "0.034835" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -170,12 +170,12 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_e0759b80eb1f11ef8362773f978eb468" + "uri": "https://api.easypost.com/v2/webhooks/hook_23c7531cefab11efbe44197603026978" }, - "duration": 241 + "duration": 153 }, { - "recordedAt": 1739570762, + "recordedAt": 1740070380, "request": { "body": "", "method": "DELETE", @@ -187,7 +187,7 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_e0759b80eb1f11ef8362773f978eb468" + "uri": "https://api.easypost.com/v2/webhooks/hook_23c7531cefab11efbe44197603026978" }, "response": { "body": "{}", @@ -203,7 +203,7 @@ "0" ], "x-node": [ - "bigweb35nuq" + "bigweb54nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -230,7 +230,7 @@ "nosniff" ], "x-ep-request-uuid": [ - "7b4ee13967afbe4ae78b0627003c2bd7" + "c6a31f8f67b75debe2b7effa00435ea0" ], "x-proxied": [ "intlb3nuq 51d74985a2", @@ -240,13 +240,13 @@ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.315824" + "0.337242" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -256,8 +256,8 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_e0759b80eb1f11ef8362773f978eb468" + "uri": "https://api.easypost.com/v2/webhooks/hook_23c7531cefab11efbe44197603026978" }, - "duration": 531 + "duration": 438 } ] \ No newline at end of file diff --git a/src/test/cassettes/webhook/update.json b/src/test/cassettes/webhook/update.json index 93cc69524..a9e8602b5 100644 --- a/src/test/cassettes/webhook/update.json +++ b/src/test/cassettes/webhook/update.json @@ -1,8 +1,8 @@ [ { - "recordedAt": 1739570845, + "recordedAt": 1740070397, "request": { - "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\"\n }\n}", + "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\",\n \"url\": \"http://example.com\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n }\n}", "method": "POST", "headers": { "Accept-Charset": [ @@ -18,20 +18,20 @@ "uri": "https://api.easypost.com/v2/webhooks" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:07:26Z\",\n \"id\": \"hook_12bc3874eb2011ef852b192bc0a3a698\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:53:17Z\",\n \"id\": \"hook_2e88ac92efab11ef96cc57dc6c60627e\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", "httpVersion": null, "headers": { "null": [ "HTTP/1.1 201 Created" ], "content-length": [ - "161" + "213" ], "expires": [ "0" ], "x-node": [ - "bigweb33nuq" + "bigweb35nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -58,23 +58,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "7b4ee13867afbe9de78b16c0003c7a68" + "c6a31f8e67b75dfde2b85a2f004372cb" ], "x-proxied": [ - "intlb3nuq 51d74985a2", + "intlb4nuq 51d74985a2", "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.265602" + "0.384566" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -86,12 +86,12 @@ }, "uri": "https://api.easypost.com/v2/webhooks" }, - "duration": 479 + "duration": 491 }, { - "recordedAt": 1739570846, + "recordedAt": 1740070398, "request": { - "body": "{\n \"webhook\": {\n \"webhook_secret\": \"sécret\"\n }\n}", + "body": "{\n \"webhook_secret\": \"sécret\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", "method": "PUT", "headers": { "Accept-Charset": [ @@ -104,23 +104,23 @@ "application/json" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_12bc3874eb2011ef852b192bc0a3a698" + "uri": "https://api.easypost.com/v2/webhooks/hook_2e88ac92efab11ef96cc57dc6c60627e" }, "response": { - "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-14T22:07:26Z\",\n \"id\": \"hook_12bc3874eb2011ef852b192bc0a3a698\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\"\n}", + "body": "{\n \"mode\": \"test\",\n \"disabled_at\": null,\n \"created_at\": \"2025-02-20T16:53:17Z\",\n \"id\": \"hook_2e88ac92efab11ef96cc57dc6c60627e\",\n \"url\": \"http://example.com\",\n \"object\": \"Webhook\",\n \"custom_headers\": [\n {\n \"name\": \"test\",\n \"value\": \"header\"\n }\n ]\n}", "httpVersion": null, "headers": { "null": [ "HTTP/1.1 201 Created" ], "content-length": [ - "161" + "213" ], "expires": [ "0" ], "x-node": [ - "bigweb35nuq" + "bigweb57nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -147,23 +147,23 @@ "nosniff" ], "x-ep-request-uuid": [ - "7b4ee13467afbe9ee78b16c2003c7b16" + "c6a31f9067b75dfde2b85a3100437361" ], "x-proxied": [ - "intlb3nuq 51d74985a2", + "intlb4nuq 51d74985a2", "extlb2nuq 99aac35317" ], "referrer-policy": [ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.539565" + "0.743142" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -173,12 +173,12 @@ "code": 201, "message": "Created" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_12bc3874eb2011ef852b192bc0a3a698" + "uri": "https://api.easypost.com/v2/webhooks/hook_2e88ac92efab11ef96cc57dc6c60627e" }, - "duration": 772 + "duration": 871 }, { - "recordedAt": 1739570847, + "recordedAt": 1740070398, "request": { "body": "", "method": "DELETE", @@ -190,7 +190,7 @@ "REDACTED" ] }, - "uri": "https://api.easypost.com/v2/webhooks/hook_12bc3874eb2011ef852b192bc0a3a698" + "uri": "https://api.easypost.com/v2/webhooks/hook_2e88ac92efab11ef96cc57dc6c60627e" }, "response": { "body": "{}", @@ -206,7 +206,7 @@ "0" ], "x-node": [ - "bigweb59nuq" + "bigweb56nuq" ], "x-frame-options": [ "SAMEORIGIN" @@ -233,7 +233,7 @@ "nosniff" ], "x-ep-request-uuid": [ - "7b4ee13b67afbe9fe78b16c3003c7bc2" + "c6a31f8e67b75dfee2b85a3200437449" ], "x-proxied": [ "intlb3nuq 51d74985a2", @@ -243,13 +243,13 @@ "strict-origin-when-cross-origin" ], "x-runtime": [ - "0.296640" + "0.325343" ], "content-type": [ "application/json; charset\u003dutf-8" ], "x-version-label": [ - "easypost-202502141809-12aa7d06fd-master" + "easypost-202502192243-499e5bdec0-master" ], "cache-control": [ "private, no-cache, no-store" @@ -259,8 +259,8 @@ "code": 200, "message": "OK" }, - "uri": "https://api.easypost.com/v2/webhooks/hook_12bc3874eb2011ef852b192bc0a3a698" + "uri": "https://api.easypost.com/v2/webhooks/hook_2e88ac92efab11ef96cc57dc6c60627e" }, - "duration": 510 + "duration": 441 } ] \ No newline at end of file diff --git a/src/test/java/com/easypost/Fixtures.java b/src/test/java/com/easypost/Fixtures.java index 1e5449be8..a7217337c 100644 --- a/src/test/java/com/easypost/Fixtures.java +++ b/src/test/java/com/easypost/Fixtures.java @@ -14,6 +14,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.HashMap; +import java.util.List; import java.util.Objects; import static com.easypost.TestUtils.getSourceFileDirectory; @@ -295,21 +296,21 @@ public static byte[] eventBytes() { } /** - * Get the default webhook URL. + * Get the default webhook HMAC signature. * - * @return The default webhook URL + * @return The default webhook HMAC signature */ public static String webhookHmacSignature() { - return Objects.requireNonNull(getFixtureData()).webhookHmacSignature; + return Objects.requireNonNull(getFixtureData()).webhooks.hmacSignature; } /** - * Get the default webhook URL. + * Get the default webhook secret. * - * @return The default webhook URL + * @return The default webhook secret */ public static String webhookSecret() { - return Objects.requireNonNull(getFixtureData()).webhookSecret; + return Objects.requireNonNull(getFixtureData()).webhooks.secret; } /** @@ -318,7 +319,16 @@ public static String webhookSecret() { * @return The default webhook URL */ public static String webhookUrl() { - return Objects.requireNonNull(getFixtureData()).webhookUrl; + return Objects.requireNonNull(getFixtureData()).webhooks.url; + } + + /** + * Get the default webhook custom headers. + * + * @return The default webhook custom headers + */ + public static List webhookCustomHeaders() { + return Objects.requireNonNull(getFixtureData()).webhooks.customHeaders; } /** diff --git a/src/test/java/com/easypost/WebhookTest.java b/src/test/java/com/easypost/WebhookTest.java index 4814ee8c6..11a57ee44 100644 --- a/src/test/java/com/easypost/WebhookTest.java +++ b/src/test/java/com/easypost/WebhookTest.java @@ -3,6 +3,7 @@ import com.easypost.exception.EasyPostException; import com.easypost.model.Event; import com.easypost.model.Webhook; +import com.easypost.model.WebhookCustomHeader; import com.easypost.utils.Utilities; import com.google.common.collect.ImmutableMap; import org.junit.jupiter.api.AfterEach; @@ -60,6 +61,7 @@ private static Webhook createBasicWebhook() throws EasyPostException { Map params = new HashMap<>(); params.put("url", Fixtures.webhookUrl()); params.put("webhook_secret", Fixtures.webhookSecret()); + params.put("custom_headers", Fixtures.webhookCustomHeaders()); Webhook webhook = vcr.client.webhook.create(params); testWebhookId = webhook.getId(); // trigger deletion after test @@ -80,6 +82,9 @@ public void testCreate() throws EasyPostException { assertInstanceOf(Webhook.class, webhook); assertTrue(webhook.getId().startsWith("hook_")); assertEquals(Fixtures.webhookUrl(), webhook.getUrl()); + WebhookCustomHeader customHeader = webhook.getCustomHeaders().get(0); + assertEquals("test", customHeader.getName()); + assertEquals("header", customHeader.getValue()); } /** @@ -128,10 +133,14 @@ public void testUpdate() throws EasyPostException { Webhook webhook = createBasicWebhook(); Map params = new HashMap<>(); params.put("webhook_secret", Fixtures.webhookSecret()); + params.put("custom_headers", Fixtures.webhookCustomHeaders()); - vcr.client.webhook.update(webhook.getId(), params); + Webhook updatedWebhook = vcr.client.webhook.update(webhook.getId(), params); - assertInstanceOf(Webhook.class, webhook); + assertInstanceOf(Webhook.class, updatedWebhook); + WebhookCustomHeader customHeader = updatedWebhook.getCustomHeaders().get(0); + assertEquals("test", customHeader.getName()); + assertEquals("header", customHeader.getValue()); } /** diff --git a/src/test/java/com/easypost/fixtures/FixtureStructure.java b/src/test/java/com/easypost/fixtures/FixtureStructure.java index e9fddebf7..3be812070 100644 --- a/src/test/java/com/easypost/fixtures/FixtureStructure.java +++ b/src/test/java/com/easypost/fixtures/FixtureStructure.java @@ -18,6 +18,7 @@ import com.easypost.fixtures.components.Shipments; import com.easypost.fixtures.components.TaxIdentifiers; import com.easypost.fixtures.components.Users; +import com.easypost.fixtures.components.Webhooks; import com.google.gson.annotations.SerializedName; public final class FixtureStructure { @@ -76,13 +77,7 @@ public final class FixtureStructure { @SerializedName ("users") public Users users; - @SerializedName ("webhook_hmac_signature") - public String webhookHmacSignature; - - @SerializedName ("webhook_secret") - public String webhookSecret; - - @SerializedName ("webhook_url") - public String webhookUrl; + @SerializedName ("webhooks") + public Webhooks webhooks; } diff --git a/src/test/java/com/easypost/fixtures/components/Webhooks.java b/src/test/java/com/easypost/fixtures/components/Webhooks.java new file mode 100644 index 000000000..c2456c8d3 --- /dev/null +++ b/src/test/java/com/easypost/fixtures/components/Webhooks.java @@ -0,0 +1,20 @@ +package com.easypost.fixtures.components; + +import com.google.gson.annotations.SerializedName; + +import java.util.List; + +public final class Webhooks { + @SerializedName ("hmac_signature") + public String hmacSignature; + + @SerializedName ("secret") + public String secret; + + @SerializedName ("url") + public String url; + + @SerializedName ("custom_headers") + public List customHeaders; + +} From 14912517318e238cf8f3457b0d6cba773d98b1c4 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Thu, 20 Feb 2025 09:59:27 -0700 Subject: [PATCH 21/23] docs: adds missing changelog info --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93fa540af..b660022db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Next Release +- Adds `WebhookCustomHeader` model, allowing `custom_headers` to be passed when creating/updating a webhook +- Corrects payload wrapping for updating a webhook - Bumps dependencies ## v7.4.4 (2025-01-03) From 4f637997279b1352ea94b1fc04066ee9c7d8a21c Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Thu, 20 Feb 2025 10:12:26 -0700 Subject: [PATCH 22/23] fix: pom missing - --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 08044450b..6ad2f5ab2 100644 --- a/pom.xml +++ b/pom.xml @@ -210,7 +210,7 @@ - -pinentry-mode + --pinentry-mode loopback From fa6072a1d2cd37a5bc07aa7d94ac5110f94e6c61 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Fri, 21 Feb 2025 10:12:58 -0700 Subject: [PATCH 23/23] fix: WebhookCustomHeader does not extend EasyPostResource --- src/main/java/com/easypost/model/WebhookCustomHeader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/easypost/model/WebhookCustomHeader.java b/src/main/java/com/easypost/model/WebhookCustomHeader.java index 28718fb66..ebe359938 100644 --- a/src/main/java/com/easypost/model/WebhookCustomHeader.java +++ b/src/main/java/com/easypost/model/WebhookCustomHeader.java @@ -3,7 +3,7 @@ import lombok.Getter; @Getter -public final class WebhookCustomHeader extends EasyPostResource { +public final class WebhookCustomHeader { private String name; private String value; }