AdminSetPulseBreathRateTest.java 1.12 KB
package com.xkl.internal;

import com.xkl.Constants;
import com.xkl.HttpTools;
import com.xkl.RtnCodeTools;
import com.xkl.partner.TokenTest;
import org.junit.Assert;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by zhaoyue on 2017/3/11.
 */
public class AdminSetPulseBreathRateTest {
    private static final String URL_ADMIN_OP_LOG = Constants.URL_PREFIX + "/setPulseBreath";

    @Test
    public void adminSetPulseBreathRateTest() {
        String token = TokenTest.adminLoginAndGetToken(Constants.ADMIN_ACCOUNT, Constants.ADMIN_PWD);

        Map<String, String> params = new HashMap<String, String>();
        params.put("username", Constants.USR_ACC);
        params.put("pulse", "80");
        params.put("breathrate", "19");
        params.put("type", Constants.KEY_ID);
        params.put("t", HttpTools.getNow());
        params.put("sign", HttpTools.getSign(params));
        String response = HttpTools.requestByMapWithToken(URL_ADMIN_OP_LOG, "POST", params, token);
        System.out.println(response);
        Assert.assertTrue(RtnCodeTools.verifyCode(response, Constants.CODE_SUCC));
    }
}