Skip to content

Commit 9472276

Browse files
committed
chore: cleanup
1 parent 43f4673 commit 9472276

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/main/java/com/easypost/service/CarrierAccountService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,9 @@ private static String selectCarrierAccountCreationEndpoint(final String carrierA
138138
*
139139
* @param carrierAccountType The type of carrier account to create.
140140
* @return The top-layer key for the carrier account creation/update request.
141+
* @throws MissingParameterError when the request fails.
141142
*/
142-
private static String selectTopLayerKey(final String carrierAccountType) throws EasyPostException {
143+
private static String selectTopLayerKey(final String carrierAccountType) throws MissingParameterError {
143144
if (carrierAccountType == null) {
144145
throw new MissingParameterError(
145146
String.format(Constants.ErrorMessages.MISSING_REQUIRED_PARAMETER, "carrier account type"));

src/test/java/com/easypost/CarrierAccountTest.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public final class CarrierAccountTest {
3232
private static MockedStatic<Requestor> requestMock = Mockito.mockStatic(Requestor.class);
3333

3434
private static CarrierAccount createBasicCarrierAccount() throws EasyPostException {
35-
// This method creates DhlEcsAccount carrier account.
3635
CarrierAccount carrierAccount = vcr.client.carrierAccount.create(Fixtures.basicCarrierAccount());
3736
testCarrierAccountId = carrierAccount.getId(); // trigger deletion after test
3837
return carrierAccount;
@@ -48,15 +47,6 @@ private static CarrierAccount createUpsCarrierAccount() throws EasyPostException
4847
return carrierAccount;
4948
}
5049

51-
private static CarrierAccount createAmazonCarrierAccount() throws EasyPostException {
52-
Map<String, Object> data = new HashMap<>();
53-
data.put("type", "AmazonShippingAccount");
54-
55-
CarrierAccount carrierAccount = vcr.client.carrierAccount.create(data);
56-
testCarrierAccountId = carrierAccount.getId(); // trigger deletion after test
57-
return carrierAccount;
58-
}
59-
6050
/**
6151
* Set up the testing environment for this file.
6252
*
@@ -151,7 +141,11 @@ public void testCreateWithUPS() throws EasyPostException {
151141
public void testCreateWithAmazon() throws EasyPostException {
152142
vcr.setUpTest("create_with_amazon");
153143

154-
CarrierAccount carrierAccount = createAmazonCarrierAccount();
144+
Map<String, Object> data = new HashMap<>();
145+
data.put("type", "AmazonShippingAccount");
146+
147+
CarrierAccount carrierAccount = vcr.client.carrierAccount.create(data);
148+
testCarrierAccountId = carrierAccount.getId(); // trigger deletion after test
155149

156150
assertInstanceOf(CarrierAccount.class, carrierAccount);
157151
assertTrue(carrierAccount.getId().startsWith("ca_"));

0 commit comments

Comments
 (0)