Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix video caption #102

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/com/whatsapp/api/domain/webhook/Video.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*
* @param sha256 The checksum of the media.
* @param mimeType The mime type of the media. The caption that describes the media.
* @param caption Added to Webhooks if it has been previously specified. The caption that describes the media.
* @param id The ID of the medi
*/
public record Video(
Expand All @@ -15,7 +16,11 @@ public record Video(

@JsonProperty("sha256") String sha256,

@JsonProperty("caption") String caption,

@JsonProperty("id") String id



) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ void testDeserializationVideoMessage() throws IOException, URISyntaxException {
Assertions.assertEquals("1673029501", obj.entry().get(0).changes().get(0).value().messages().get(0).timestamp());
Assertions.assertEquals(MessageType.VIDEO, obj.entry().get(0).changes().get(0).value().messages().get(0).type());
Assertions.assertEquals("video/mp4", obj.entry().get(0).changes().get(0).value().messages().get(0).video().mimeType());
Assertions.assertEquals("hello world", obj.entry().get(0).changes().get(0).value().messages().get(0).video().caption());
Assertions.assertEquals("waIq5BBe5GgjT6DHWu3LY9F8jYOZzYLHRRRGDTbipNk=", obj.entry().get(0).changes().get(0).value().messages().get(0).video().sha256());
Assertions.assertEquals("661828760183585", obj.entry().get(0).changes().get(0).value().messages().get(0).video().id());

Expand Down
1 change: 1 addition & 0 deletions src/test/resources/deserialization/videoMessage.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"timestamp": "1673029501",
"type": "video",
"video": {
"caption": "hello world",
"mime_type": "video/mp4",
"sha256": "waIq5BBe5GgjT6DHWu3LY9F8jYOZzYLHRRRGDTbipNk=",
"id": "661828760183585"
Expand Down