Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-lando committed Nov 13, 2024
1 parent b082f08 commit e2b31c6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public WebhooksTest() throws IOException {
public void createWebhook() throws ApiException {
this.webhook = apiClient.webhooks()
.create(new WebhooksCreationPayload()
.events(Collections.singletonList("video.encoding.quality.completed"))
.events(Collections.singletonList(WebhooksCreationPayload.EventsEnum.VIDEO_ENCODING_QUALITY_COMPLETED))
.url("https://webhooks.test-java-api-client.fr"));

assertThat(webhook.getWebhookId()).isNotNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void responseWithStatus200Test() throws ApiException {

assertThat(res.getWebhookId()).isEqualTo("webhook_XXXXXXXXXXXXXXX");
assertThat(res.getCreatedAt().toString()).isEqualTo("2021-01-08T14:12:18Z");
assertThat(res.getEvents()).containsExactlyElementsIn(Arrays.asList(("video.encoding.quality.completed")));
assertThat(res.getEvents()).containsExactlyElementsIn(Arrays.asList((Webhook.EventsEnum.VIDEO_ENCODING_QUALITY_COMPLETED)));
assertThat(res.getUrl()).isEqualTo("http://clientnotificationserver.com/notif?myquery=query");
}
}
Expand Down Expand Up @@ -131,12 +131,12 @@ public void responseWithStatus200Test() throws ApiException {
assertThat(page.getItems()).containsExactlyElementsIn(Arrays.asList(
new Webhook().webhookId("webhook_XXXXXXXXXXXXXXX")
.createdAt(OffsetDateTime.parse("2021-01-08T14:12:18.000+00:00"))
.addEventsItem("video.encoding.quality.completed")
.addEventsItem(Webhook.EventsEnum.VIDEO_ENCODING_QUALITY_COMPLETED)
.url("http://clientnotificationserver.com/notif?myquery=query")
.signatureSecret("sig_sec_Abcd12348RLP7VPLi7nYVh"),
new Webhook().webhookId("webhook_XXXXXXXXXYYYYYY")
.createdAt(OffsetDateTime.parse("2021-01-12T12:12:12.000+00:00"))
.addEventsItem("video.encoding.quality.completed")
.addEventsItem(Webhook.EventsEnum.VIDEO_ENCODING_QUALITY_COMPLETED)
.url("http://clientnotificationserver.com/notif?myquery=query2")
.signatureSecret("sig_sec_Abcd12358RLP7VPLi7nYVy")))
.inOrder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void responseWithStatus200Test() throws ApiException {

assertThat(res.getWebhookId()).isEqualTo("webhook_XXXXXXXXXXXXXXX");
assertThat(res.getCreatedAt()).isEqualTo("2021-01-08T14:12:18.000+00:00");
assertThat(res.getEvents()).containsExactlyInAnyOrder("video.encoding.quality.completed");
assertThat(res.getEvents()).containsExactlyInAnyOrder(Webhook.EventsEnum.VIDEO_ENCODING_QUALITY_COMPLETED);
assertThat(res.getUrl()).isEqualTo("http://clientnotificationserver.com/notif?myquery=query");
}
}
Expand Down Expand Up @@ -128,12 +128,12 @@ public void responseWithStatus200Test() throws ApiException {
assertThat(page.getItems()).containsExactlyInAnyOrder(
new Webhook().webhookId("webhook_XXXXXXXXXXXXXXX")
.createdAt(OffsetDateTime.parse("2021-01-08T14:12:18.000+00:00"))
.addEventsItem("video.encoding.quality.completed")
.addEventsItem(Webhook.EventsEnum.VIDEO_ENCODING_QUALITY_COMPLETED)
.url("http://clientnotificationserver.com/notif?myquery=query")
.signatureSecret("sig_sec_Abcd12348RLP7VPLi7nYVh"),
new Webhook().webhookId("webhook_XXXXXXXXXYYYYYY")
.createdAt(OffsetDateTime.parse("2021-01-12T12:12:12.000+00:00"))
.addEventsItem("video.encoding.quality.completed")
.addEventsItem(Webhook.EventsEnum.VIDEO_ENCODING_QUALITY_COMPLETED)
.url("http://clientnotificationserver.com/notif?myquery=query2")
.signatureSecret("sig_sec_Abcd12358RLP7VPLi7nYVy"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class WebhooksTest extends AbstractTest {
public void createWebhook() throws ApiException {
this.webhook = apiClient.webhooks()
.create(new WebhooksCreationPayload()
.events(Collections.singletonList("video.encoding.quality.completed"))
.events(Collections.singletonList(WebhooksCreationPayload.EventsEnum.VIDEO_ENCODING_QUALITY_COMPLETED))
.url("https://webhooks.test-java-api-client.fr"));

assertThat(webhook.getWebhookId()).isNotNull();
Expand Down

0 comments on commit e2b31c6

Please sign in to comment.