@Test
public void testBaiduPush() throws PushClientException, PushServerException, IOException
{
PushKeyPair pair = new PushKeyPair("MPCCC4ORpe6cHbOG7PgUZnNK", "7Gm8Qi6HB2L6y47Ynwc9uZbqpQmWUabm");
BaiduPushClient pushClient = new BaiduPushClient(pair, BaiduPushConstants.CHANNEL_REST_URL);
PushMsgToSingleDeviceRequest request = new PushMsgToSingleDeviceRequest().addChannelId("4238282200440847692")
.addMsgExpires(3600).addMessageType(0)
.addMessage(JSONObject.toJSONString("{\"sendTime\": \"sdfgsdfgsdfg\", \"targetId\": 23, \"type\": 6, \"msg\": \"test msg\"}")).addDeviceType(DeviceType.ANDROID.value());
PushMsgToSingleDeviceResponse response = pushClient.pushMsgToSingleDevice(request); //http request
long sendTime = response.getSendTime();
System.out.format("baiduMsgPush:msgId:[%s], sendTime:[%s].", response.getMsgId(), sendTime);
}