forked from microsoftgraph/msgraph-sdk-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebhooksTests.java
More file actions
30 lines (24 loc) · 973 Bytes
/
WebhooksTests.java
File metadata and controls
30 lines (24 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.microsoft.graph.functional;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.util.Calendar;
import org.junit.Ignore;
import org.junit.Test;
import com.microsoft.graph.models.extensions.Subscription;
@Ignore
public class WebhooksTests {
@Test
public void testCreateSubscription() {
TestBase testBase = new TestBase();
Subscription sub = new Subscription();
sub.changeType = "created,updated";
sub.notificationUrl = "https://webhook-sub-test.azurewebsites.net/api/WebhookTrigger";
sub.resource = "/me/mailfolders('inbox')/messages";
Calendar cal = Calendar.getInstance();
cal.add(Calendar.HOUR, 1);
sub.expirationDateTime = cal;
Subscription subscription = testBase.graphClient.subscriptions().buildRequest().post(sub);
assertNotNull(subscription);
assertEquals(sub.resource, subscription.resource);
}
}