From 713dbb7a1a98466c86dbd8ab189105b3528010b9 Mon Sep 17 00:00:00 2001 From: nwithan8 Date: Wed, 15 Nov 2023 15:28:17 -0700 Subject: [PATCH] - Address feedback --- src/test/java/com/easypost/AddressTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/easypost/AddressTest.java b/src/test/java/com/easypost/AddressTest.java index 6b67822c7..bc5ae8458 100644 --- a/src/test/java/com/easypost/AddressTest.java +++ b/src/test/java/com/easypost/AddressTest.java @@ -5,6 +5,7 @@ import com.easypost.exception.General.EndOfPaginationError; import com.easypost.model.Address; import com.easypost.model.AddressCollection; +import com.easypost.model.Error; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -14,6 +15,7 @@ import java.util.Map; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -81,8 +83,14 @@ public void testCreateVerify() throws EasyPostException { assertEquals("417 MONTGOMERY ST FL 5", address.getStreet1()); assertNotNull(address.getVerifications()); - assertNotNull(address.getVerifications().getZip4().getErrors()); // Should have a error due to second line - assertNotNull(address.getVerifications().getDelivery().getErrors()); + + assertFalse(address.getVerifications().getDelivery().getErrors().isEmpty()); // should have at least one error + Error error = address.getVerifications().getDelivery().getErrors().get(0); + assertEquals("E.SECONDARY_INFORMATION.INVALID", error.getCode()); + + assertFalse(address.getVerifications().getZip4().getErrors().isEmpty()); // should have at least one error + error = address.getVerifications().getZip4().getErrors().get(0); + assertEquals("E.SECONDARY_INFORMATION.INVALID", error.getCode()); } /**