From 9b83e0ad4b3ff209c468af9c204ec1b900b75fb8 Mon Sep 17 00:00:00 2001 From: Savannah Ryan Date: Tue, 23 May 2023 16:46:30 -0600 Subject: [PATCH] Began adding smarty-key; smarty-key testing --- .../java/com/smartystreets/api/us_street/Candidate.java | 6 ++++++ .../java/com/smartystreets/api/us_street/CandidateTest.java | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/main/java/com/smartystreets/api/us_street/Candidate.java b/src/main/java/com/smartystreets/api/us_street/Candidate.java index ff58747..2ff0ad6 100644 --- a/src/main/java/com/smartystreets/api/us_street/Candidate.java +++ b/src/main/java/com/smartystreets/api/us_street/Candidate.java @@ -22,6 +22,7 @@ public class Candidate implements Serializable { private String deliveryLine2; private String lastLine; private String deliveryPointBarcode; + private String smartyKey; private Components components; private Metadata metadata; private Analysis analysis; @@ -92,5 +93,10 @@ public String getDeliveryPointBarcode() { return this.deliveryPointBarcode; } + @JsonProperty("smarty_key") + public String getSmartyKey() { + return this.smartyKey; + } + //endregion } diff --git a/src/test/java/com/smartystreets/api/us_street/CandidateTest.java b/src/test/java/com/smartystreets/api/us_street/CandidateTest.java index db9d33f..676e3d4 100644 --- a/src/test/java/com/smartystreets/api/us_street/CandidateTest.java +++ b/src/test/java/com/smartystreets/api/us_street/CandidateTest.java @@ -21,6 +21,7 @@ public void testFullJSONDeserialization() throws Exception { + "\"delivery_line_2\": \"blah blah\",\n" + "\"last_line\": \"Provo UT 84604-4405\",\n" + "\"delivery_point_barcode\": \"846044405140\",\n" + + "\"smarty_key\": \"1750774478\",\n" + "\"components\": {\n" + "\"primary_number\": \"3214\",\n" + "\"street_predirection\": \"N\",\n" @@ -88,6 +89,7 @@ public void testFullJSONDeserialization() throws Exception { assertEquals("blah blah", candidates[0].getDeliveryLine2()); assertEquals("Provo UT 84604-4405", candidates[0].getLastLine()); assertEquals("846044405140", candidates[0].getDeliveryPointBarcode()); + assertEquals("1750774478", candidates[0].getSmartyKey()); assertEquals("3214", candidates[0].getComponents().getPrimaryNumber()); assertEquals("N", candidates[0].getComponents().getStreetPredirection()); assertEquals("Q", candidates[0].getComponents().getStreetPostdirection());