/** * 判断返回是否正确 * * @param result * @return */ protected <T> boolean isReturnSuc(EucApiResult<T> result) { if (!CodeConstant.OK.equals(result.getResultCode()) || (result.getDescList() != null && result.getDescList().size() > 0)) { // 失败 return false; } else { // 成功 return true; } }
protected EucAuthResult login() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); // TODO 登录 EucApiResult<EucAuthResult> result = EucApiAuthCall.login( request, response, LOGIN_MOBILE, LOGIN_MOBILE_PASS_WD, true, getRequestInfo()); if (CodeConstant.OK.equals(result.getResultCode())) { Assert.assertTrue("登录验证", result.getResult() != null); } else { Assert.assertFalse("登录验证失败【" + getErrorDesc(result) + "】", true); } return result.getResult(); }