use of com.formkiq.stacks.client.requests.GetWebhookTagsRequest in project formkiq-core by formkiq.
the class WebhookTagsRequestTest method testPublicWebhooks01.
/**
* Test POST /webhooks/{webhookId}/tags.
*
* @throws Exception Exception
*/
@Test(timeout = TEST_TIMEOUT)
public void testPublicWebhooks01() throws Exception {
for (FormKiqClientV1 client : getFormKiqClients()) {
// given
String id = client.addWebhook(new AddWebhookRequest().name("paypal")).id();
AddWebhookTagRequest req = new AddWebhookTagRequest().tagKey("category").tagValue("person").webhookId(id);
// when
boolean result = client.addWebhookTag(req);
// then
assertTrue(result);
// given
GetWebhookTagsRequest get = new GetWebhookTagsRequest().webhookId(id);
// when
WebhookTags tags = client.getWebhookTags(get);
// then
assertEquals(1, tags.tags().size());
WebhookTag tag = tags.tags().get(0);
assertEquals("category", tag.key());
assertNotNull(tag.insertedDate());
assertEquals("USERDEFINED", tag.type());
assertNotNull(tag.userId());
assertEquals("person", tag.value());
assertEquals(id, tag.webhookId());
}
}
Aggregations