Authored by zhaoyue

add test case of pulse and log

... ... @@ -3,7 +3,7 @@ git add --all src/*
git add --all lib/*
git add push.sh
git add pom.xml
git commit -m "Mod file location "
git commit -m "add test case of pulse and log "
git push origin master
git status
git pull
... ...
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));
}
}
... ...
... ... @@ -26,7 +26,7 @@ public class UserInfoTest {
public void testRegister() {
String adminUser = Constants.ADMIN_ACCOUNT;
String adminPass = Constants.ADMIN_PWD;
String user = "15211112222";
String user = "1521111212";
String pass = "pass152";
String name = "usernameTest";
String sex = Constants.MALE;
... ...
... ... @@ -24,6 +24,8 @@ public class AccountTest {
Map<String, String> params = new HashMap<String, String>();
params.put("account", user);
params.put("password", EncodeTools.encode("MD5", pass));
System.out.println(EncodeTools.encode("MD5", pass));
params.put("t", HttpTools.getNow());
String response = HttpTools.requestByMap(URL_LOGIN, "POST", params);
System.out.println("login success:" + response);
... ...