forked from PingPlusPlus/pingpp-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebhookTest.java
More file actions
26 lines (21 loc) · 816 Bytes
/
WebhookTest.java
File metadata and controls
26 lines (21 loc) · 816 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
package com.pingplusplus;
import com.pingplusplus.model.PingppObject;
import com.pingplusplus.model.Webhooks;
import com.pingplusplus.model.Withdrawal;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/*
* @author Afon, @date 17-03-28
*/
public class WebhookTest extends PingppAccountTestBase {
/**
* 解析 webhooks 消息 (withdrawal)
*/
@Test public void testWebhooksParseWithdrawal() {
String webhookData = PingppAccountTestData.getWithdrawalWebhooksData();
PingppObject obj = Webhooks.getObject(webhookData);
assertTrue("object should be an instance of Withdrawal", obj instanceof Withdrawal);
assertEquals("object should be withdrawal", "withdrawal", ((Withdrawal)obj).getObject());
}
}