@BeforeClass public void beforeClass() throws Exception { openId = CommonOperation_yixinApp.getOpenId2_1( Config_yixinApp.test_user, Config_yixinApp.test_area, Config_yixinApp.test_pwd, Config_yixinApp.test_deviceKey); // 设为公共摄像头 CommonOperation_yixinApp.postRequest( "{\"deviceId\":\"" + deviceId + "\",\"userToken\":\"" + Config_yixinApp.test_userId + "\"}", openId, "/yiXinApp/camera/setAsPublic", Config_yixinApp.test_deviceKey); }
@AfterClass public void afterClass() throws Exception { // 设为私人摄像头 CommonOperation_yixinApp.postRequest( "{\"deviceId\":\"" + deviceId + "\",\"userToken\":\"" + Config_yixinApp.test_userId + "\"}", openId, "/yiXinApp/camera/setAsPrivate", Config_yixinApp.test_deviceKey); }
@Test(dataProvider = "errorData", alwaysRun = true) public void setDeviceAbstract_error(String entity, int code, String msg) throws Exception { JSONObject httpResponse = CommonOperation_yixinApp.postRequest(entity, openId, url, Config_yixinApp.test_deviceKey); Assert.assertEquals(httpResponse.getInt("code"), code, msg); }