Skip to content

Commit

Permalink
fix location url
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhou Wei committed Jul 28, 2023
1 parent 7f94189 commit 0da81f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/com/whatsapp/api/domain/webhook/Location.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public record Location(

@JsonProperty("name") String name,

@JsonProperty("longitude") double longitude
@JsonProperty("longitude") double longitude,

@JsonProperty("url") String url

) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ void testDeserializationLocationMessage() throws IOException, URISyntaxException

Assertions.assertEquals(-10.93941311633, obj.entry().get(0).changes().get(0).value().messages().get(0).location().latitude());
Assertions.assertEquals(-10.606395436721, obj.entry().get(0).changes().get(0).value().messages().get(0).location().longitude());
Assertions.assertEquals("https://foursquare.com/v/5c42c5667d8497002c6e09f9", obj.entry().get(0).changes().get(0).value().messages().get(0).location().url());

}

Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/deserialization/locationMessage.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"timestamp": "1673641462",
"location": {
"latitude": -10.93941311633,
"longitude": -10.606395436721
"longitude": -10.606395436721,
"url":"https:\/\/foursquare.com\/v\/5c42c5667d8497002c6e09f9"
},
"type": "location"
}
Expand Down

0 comments on commit 0da81f3

Please sign in to comment.