|
5 | 5 | import com.easypost.exception.General.EndOfPaginationError; |
6 | 6 | import com.easypost.model.Address; |
7 | 7 | import com.easypost.model.AddressCollection; |
| 8 | +import com.easypost.model.AddressDetail; |
| 9 | +import com.easypost.model.AddressVerificationFieldError; |
8 | 10 | import org.junit.jupiter.api.BeforeAll; |
9 | 11 | import org.junit.jupiter.api.Test; |
10 | 12 |
|
@@ -88,8 +90,21 @@ public void testCreateVerify() throws EasyPostException { |
88 | 90 | address = vcr.client.address.create(addressData); |
89 | 91 |
|
90 | 92 | assertInstanceOf(Address.class, address); |
91 | | - assertNotNull(address.getVerifications().getDelivery()); |
92 | | - assertNotNull(address.getVerifications().getZip4()); |
| 93 | + assertEquals(false, address.getVerifications().getDelivery().getSuccess()); |
| 94 | + assertInstanceOf(AddressDetail.class, address.getVerifications().getDelivery().getDetails()); |
| 95 | + AddressVerificationFieldError addressVerificationFieldErrorGetDelivery = address.getVerifications().getDelivery().getErrors().get(0); |
| 96 | + assertEquals("E.ADDRESS.NOT_FOUND", addressVerificationFieldErrorGetDelivery.getCode()); |
| 97 | + assertEquals("address", addressVerificationFieldErrorGetDelivery.getField()); |
| 98 | + assertNull(addressVerificationFieldErrorGetDelivery.getSuggestion()); |
| 99 | + assertEquals("Address not found", addressVerificationFieldErrorGetDelivery.getMessage()); |
| 100 | + |
| 101 | + assertEquals(false, address.getVerifications().getZip4().getSuccess()); |
| 102 | + assertNull(address.getVerifications().getZip4().getDetails()); |
| 103 | + AddressVerificationFieldError addressVerificationFieldErrorZip4 = address.getVerifications().getZip4().getErrors().get(0); |
| 104 | + assertEquals("E.ADDRESS.NOT_FOUND", addressVerificationFieldErrorZip4.getCode()); |
| 105 | + assertEquals("address", addressVerificationFieldErrorZip4.getField()); |
| 106 | + assertNull(addressVerificationFieldErrorZip4.getSuggestion()); |
| 107 | + assertEquals("Address not found", addressVerificationFieldErrorZip4.getMessage()); |
93 | 108 | } |
94 | 109 |
|
95 | 110 | /** |
|
0 commit comments