/*
 * @Author: Kane
 * @Date: 2022-04-22 10:53:49
 * @LastEditors: Kane
 * @LastEditTime: 2022-04-22 16:02:05
 * @FilePath: \DisasterWarning\src\test\java\com\cpic\xim\wechat\officalAccount\sendMessageTest.java
 * @Description: 
 * 
 * Copyright (c) ${2022} by Kane, All Rights Reserved. 
 */

package com.cpic.xim.wechat.officalAccount;

import org.junit.Test;
import static org.junit.Assert.*;
import com.cpic.xim.httpUtil.*;
import java.util.*;

public class sendMessageTest
{
    private static String url =
            "https://cxxmwx.cpic.com.cn/app/index.php?i=2&c=entry&do=send_group_tpl_api&m=ok_tplmessage";

    @Test
    public void postNotifyMessageJson()
    {
        try
        {
            // sendMessage.postNotifyMessageJSON( url, "警报", "警报标题", "警报内容！" );
        }
        catch (Exception error)
        {
            fail( "测试失败！" );
        }
    }

    @Test
    public void postNotifyMessage()
    {
        HashMap<String, String> headers = new HashMap<String, String>();
        String param = "tplid=57&" + "groupid=1&" + "first=亲爱的#realname#，您好！&"
                + "keyword1=东山县气象台发布大雾黄色预警[Ⅲ级/较重]&" + "keyword1color=#ffff00&"
                + "keyword2=东山县气象台2022年04月22日06时12分发布大雾黄色预警信号：预计未来12小时内，我县、闽南渔场和台湾浅滩渔场将出现能见度小于500米的雾。请注意防范！";

        // headers.put( "accept", "*/*" );
        // headers.put( "Connection", "Keep-Alive" );
        headers.put( "Content-Type", "application/x-www-form-urlencoded;charset=UTF-8" );

        try
        {
            HttpUtils.postHttpRequest( url, headers, param );
        }
        catch (Exception error)
        {
        }

    }
}
