Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove create_list tracker endpoint function #337

Merged
merged 4 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
9 changes: 1 addition & 8 deletions dependency-check-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@
Below vulnerabilities are from outdated Protocol Buffers which is the dependency of Error Prone.
This will not affect our code.
-->
<vulnerabilityName>CVE-2022-3171</vulnerabilityName>
<vulnerabilityName>CVE-2022-3509</vulnerabilityName>
<vulnerabilityName>CVE-2022-3510</vulnerabilityName>
<vulnerabilityName>CVE-2023-2976</vulnerabilityName>
<!--
Vulnerability in the Dependency Check itself, used during testing.
Will not affect end-users.
Ref: https://github.com/jeremylong/DependencyCheck/issues/5943 -->
<vulnerabilityName>CVE-2023-4759</vulnerabilityName>
<vulnerabilityName>CVE-2024-7254</vulnerabilityName>
</suppress>
</suppressions>
8 changes: 3 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.19.0</version>
<version>2.32.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -225,14 +225,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<release>8</release>
<encoding>UTF-8</encoding>
<fork>true</fork>
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne</arg>
<arg>-XDcompilePolicy=simple</arg>
<arg>-Xplugin:ErrorProne</arg>
<arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
Expand All @@ -250,7 +248,7 @@
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.17.0</version>
<version>2.32.0</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/easypost/service/AddressService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Object> params) throws EasyPostException {
String endpoint = "addresses";
Expand Down
16 changes: 0 additions & 16 deletions src/main/java/com/easypost/service/TrackerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,4 @@ public TrackerCollection apply(Map<String, Object> 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<String, Object> params) throws EasyPostException {
Map<String, Object> newParams = new HashMap<String, Object>();
newParams.put("trackers", params);

String endpoint = "trackers/create_list";

Requestor.request(RequestMethod.POST, endpoint, newParams, Object.class, client);
}
}
94 changes: 0 additions & 94 deletions src/test/cassettes/tracker/create_list.json

This file was deleted.

27 changes: 0 additions & 27 deletions src/test/java/com/easypost/TrackerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -208,30 +207,4 @@ public Map<String, Object> 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<String, Object> params = new HashMap<>();
String[] trackingCodes = new String[] {
"EZ1000000001",
"EZ1000000002",
"EZ1000000003"
};

for (int i = 0; i < trackingCodes.length; i++) {
Map<String, Object> tracker = new HashMap<>();

tracker.put("tracking_code", trackingCodes[i]);
params.put(String.valueOf(i), tracker);
}

assertDoesNotThrow(() -> vcr.client.tracker.createList(params));
}
}
Loading