diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6ab3fb2e..4fc561b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,14 +8,13 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: javaversion: ["8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22"] steps: - - uses: actions/checkout@v3 - - name: Set up JDK for compilation - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: "zulu" java-version: "22" # Always use the latest JDK for building @@ -31,18 +30,17 @@ jobs: - name: Build Library run: make build - name: Set up Java ${{ matrix.javaversion }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: "zulu" java-version: ${{ matrix.javaversion }} - name: Run test with Java ${{ matrix.javaversion }} run: EASYPOST_TEST_API_KEY=123 EASYPOST_PROD_API_KEY=123 make test coverage: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up JDK for compilation - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: "zulu" java-version: "22" # Always use the latest JDK for building @@ -73,9 +71,13 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: "./coverage.lcov" lint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: "zulu" + java-version: "22" # Always use the latest JDK for building - name: Install checkstyle and style guide run: make install-checkstyle - name: Load Maven dependencies and CVE database cache @@ -94,11 +96,10 @@ jobs: path: ${{github.workspace}}/target/dependency-check-report.html docs: if: github.ref == 'refs/heads/master' - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up JDK for compilation - uses: actions/setup-java@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 with: distribution: "zulu" java-version: "22" # Always use the latest JDK for building diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c9d4b3c..bbbaaff8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## Next Release + +- Removes the deprecated `create_list` tracker endpoint function as it is no longer available via API + ## v7.4.3 (2024-09-16) - Remove the custom DateDeserializer that contained a parsing issue. This change closes the related GitHub issue [#333](https://github.com/EasyPost/easypost-java/issues/333) diff --git a/dependency-check-suppressions.xml b/dependency-check-suppressions.xml index 576299f0..25095c20 100644 --- a/dependency-check-suppressions.xml +++ b/dependency-check-suppressions.xml @@ -5,14 +5,7 @@ Below vulnerabilities are from outdated Protocol Buffers which is the dependency of Error Prone. This will not affect our code. --> - CVE-2022-3171 - CVE-2022-3509 - CVE-2022-3510 CVE-2023-2976 - - CVE-2023-4759 + CVE-2024-7254 diff --git a/pom.xml b/pom.xml index ea049e37..1b51691d 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ com.google.errorprone error_prone_core - 2.19.0 + 2.32.0 provided @@ -225,14 +225,12 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.13.0 8 UTF-8 true - -XDcompilePolicy=simple - -Xplugin:ErrorProne -XDcompilePolicy=simple -Xplugin:ErrorProne -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED @@ -250,7 +248,7 @@ com.google.errorprone error_prone_core - 2.17.0 + 2.32.0 org.projectlombok diff --git a/src/main/java/com/easypost/service/AddressService.java b/src/main/java/com/easypost/service/AddressService.java index 83e8eb38..dd0824d2 100644 --- a/src/main/java/com/easypost/service/AddressService.java +++ b/src/main/java/com/easypost/service/AddressService.java @@ -68,7 +68,7 @@ public Address retrieve(final String id) throws EasyPostException { * * @param params Map of parameters. * @return AddressCollection object. - * @throws APIException when the request fails. + * @throws EasyPostException when the request fails. */ public AddressCollection all(final Map params) throws EasyPostException { String endpoint = "addresses"; diff --git a/src/main/java/com/easypost/service/TrackerService.java b/src/main/java/com/easypost/service/TrackerService.java index bbb1bd33..74bf69c1 100644 --- a/src/main/java/com/easypost/service/TrackerService.java +++ b/src/main/java/com/easypost/service/TrackerService.java @@ -100,20 +100,4 @@ public TrackerCollection apply(Map parameters) { } }, collection.getTrackers(), pageSize); } - - /** - * Create a list of Trackers. - * - * @param params Map of parameters used to create the Trackers. - * @throws EasyPostException when the request fails. - * @deprecated Use the create function instead. createList will be removed in a future release. - */ - @Deprecated public void createList(final Map params) throws EasyPostException { - Map newParams = new HashMap(); - newParams.put("trackers", params); - - String endpoint = "trackers/create_list"; - - Requestor.request(RequestMethod.POST, endpoint, newParams, Object.class, client); - } } diff --git a/src/test/cassettes/tracker/create_list.json b/src/test/cassettes/tracker/create_list.json deleted file mode 100644 index 0baea48c..00000000 --- a/src/test/cassettes/tracker/create_list.json +++ /dev/null @@ -1,94 +0,0 @@ -[ - { - "recordedAt": 1723823905, - "request": { - "body": "{\n \"trackers\": {\n \"0\": {\n \"tracking_code\": \"EZ1000000001\"\n },\n \"1\": {\n \"tracking_code\": \"EZ1000000002\"\n },\n \"2\": {\n \"tracking_code\": \"EZ1000000003\"\n }\n }\n}", - "method": "POST", - "headers": { - "Accept-Charset": [ - "UTF-8" - ], - "User-Agent": [ - "REDACTED" - ], - "Content-Type": [ - "application/json" - ] - }, - "uri": "https://api.easypost.com/v2/trackers/create_list" - }, - "response": { - "body": "{}", - "httpVersion": null, - "headers": { - "null": [ - "HTTP/1.1 200 OK" - ], - "content-length": [ - "2" - ], - "expires": [ - "0" - ], - "x-node": [ - "bigweb32nuq" - ], - "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-canary": [ - "direct" - ], - "x-xss-protection": [ - "1; mode\u003dblock" - ], - "x-content-type-options": [ - "nosniff" - ], - "x-ep-request-uuid": [ - "8a4bf44066bf7721e786c49a0035f5f4" - ], - "x-proxied": [ - "intlb4nuq c0f5e722d1", - "extlb1nuq b6e1b5034c" - ], - "referrer-policy": [ - "strict-origin-when-cross-origin" - ], - "x-runtime": [ - "0.053037" - ], - "content-type": [ - "application/json; charset\u003dutf-8" - ], - "x-version-label": [ - "easypost-202408152333-48cda4a73e-master" - ], - "cache-control": [ - "private, no-cache, no-store" - ] - }, - "status": { - "code": 200, - "message": "OK" - }, - "uri": "https://api.easypost.com/v2/trackers/create_list" - }, - "duration": 254 - } -] \ No newline at end of file diff --git a/src/test/java/com/easypost/TrackerTest.java b/src/test/java/com/easypost/TrackerTest.java index 5a2f91e2..4b686315 100644 --- a/src/test/java/com/easypost/TrackerTest.java +++ b/src/test/java/com/easypost/TrackerTest.java @@ -13,7 +13,6 @@ import java.util.List; import java.util.Map; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotEquals; @@ -208,30 +207,4 @@ public Map getNextPageParams() throws EndOfPaginationError { assertEquals(trackingCode, nextPageParams.get("tracking_code")); assertEquals(carrier, nextPageParams.get("carrier")); } - - /** - * Test creating a list of trackers. - * - * @throws EasyPostException when the request fails. - */ - @Test - public void testCreateList() throws EasyPostException { - vcr.setUpTest("create_list"); - - Map params = new HashMap<>(); - String[] trackingCodes = new String[] { - "EZ1000000001", - "EZ1000000002", - "EZ1000000003" - }; - - for (int i = 0; i < trackingCodes.length; i++) { - Map tracker = new HashMap<>(); - - tracker.put("tracking_code", trackingCodes[i]); - params.put(String.valueOf(i), tracker); - } - - assertDoesNotThrow(() -> vcr.client.tracker.createList(params)); - } }