From cbdfb653a71142147ce35521e384d193a7954d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=B7=91=E8=B4=A4?= Date: Sat, 9 May 2020 10:58:17 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:[=E4=BF=AE=E6=94=B9=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3QA=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=B1=BB=EF=BC=9A1=E3=80=81=E5=88=A0=E9=99=A4=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=A4=84=E7=BD=AE=E8=AE=BE=E5=A4=87=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3id=E4=B8=BA=E6=95=B4?= =?UTF-8?q?=E5=9E=8B=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=202=E3=80=81?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=8E=B7=E5=8F=96=E5=A4=84=E7=BD=AE=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3id=E4=B8=BA?= =?UTF-8?q?=E6=95=B4=E5=9E=8B=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B=203?= =?UTF-8?q?=E3=80=81=E5=88=A0=E9=99=A4=E9=93=BE=E8=B7=AF=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3id=E4=B8=BA=E6=95=B4=E5=9E=8B=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DeviceNodeInfoControllerQATest.java | 75 ------------------- 1 file changed, 75 deletions(-) diff --git a/src/test/java/com/dispose/controller/DeviceNodeInfoControllerQATest.java b/src/test/java/com/dispose/controller/DeviceNodeInfoControllerQATest.java index a8fad5bd..cbca8a29 100644 --- a/src/test/java/com/dispose/controller/DeviceNodeInfoControllerQATest.java +++ b/src/test/java/com/dispose/controller/DeviceNodeInfoControllerQATest.java @@ -286,33 +286,6 @@ public class DeviceNodeInfoControllerQATest extends InitTestEnvironment{ Assert.assertEquals(versionRsp.getMessage(), ErrorCode.ERR_PARAMEXCEPTION.getMsg()); } - /** - * A 8 get version id integer exception test. - * - * @throws Exception the exception - */ - @Test - public void a8_getVersionIdIntegerExceptionTest() throws Exception { - String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604308040,\"msgContent\":\"{\\\"id\\\":123}\"}"; - String ver = mockMvc.perform(MockMvcRequestBuilders - .post("/information/version") - .contentType(MediaType.APPLICATION_JSON) - .header("Authorization", "Bearer " + getLogToken()) - .content(reqData)) - .andDo(print()).andExpect(status().isOk()) - .andExpect(jsonPath("$.code").value(ErrorCode.ERR_PARAMEXCEPTION.getHttpCode())) - .andReturn() - .getResponse() - .getContentAsString(); - String msgContent = verifyResp(ver); - VersionRsp versionRsp = objectMapper.readValue(msgContent, new TypeReference() { - }); - - Assert.assertEquals(String.valueOf(versionRsp.getStatus()), - String.valueOf(ErrorCode.ERR_PARAMEXCEPTION.getCode())); - Assert.assertEquals(versionRsp.getMessage(), ErrorCode.ERR_PARAMEXCEPTION.getMsg()); - } - /** * B 1 get device info normal one exist device test. * @@ -521,30 +494,6 @@ public class DeviceNodeInfoControllerQATest extends InitTestEnvironment{ Assert.assertTrue(msgContent.contains(ErrorCode.ERR_PARAMEXCEPTION.getMsg())); } - /** - * B 8 get device info id integer exception test. - * - * @throws Exception the exception - */ - @Test - public void b8_getDeviceInfoIdIntegerExceptionTest() throws Exception{ - String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604308040,\"msgContent\":\"{\\\"id\\\":123}\"}"; - String deviceInfo = mockMvc.perform(MockMvcRequestBuilders - .post("/information/deviceinfo") - .contentType(MediaType.APPLICATION_JSON) - .header("Authorization", "Bearer " + getLogToken()) - .content(reqData)) - .andDo(print()).andExpect(status().isOk()) - .andExpect(jsonPath("$.code").value(ErrorCode.ERR_PARAMEXCEPTION.getHttpCode())) - .andReturn() - .getResponse() - .getContentAsString(); - - String msgContent = verifyResp(deviceInfo); - Assert.assertTrue(msgContent.contains(String.valueOf(ErrorCode.ERR_PARAMEXCEPTION.getCode()))); - Assert.assertTrue(msgContent.contains(ErrorCode.ERR_PARAMEXCEPTION.getMsg())); - } - /** * C 1 get link status normal one online device test. * @@ -765,30 +714,6 @@ public class DeviceNodeInfoControllerQATest extends InitTestEnvironment{ Assert.assertTrue(msgContent.contains(ErrorCode.ERR_PARAMEXCEPTION.getMsg())); } - /** - * C 8 get link status id integer exception test. - * - * @throws Exception the exception - */ - @Test - public void c8_getLinkStatusIdIntegerExceptionTest() throws Exception { - String reqData = "{\"ver\":2,\"cryptoType\":0,\"timeStamp\":1587604308040,\"msgContent\":\"{\\\"id\\\":123}\"}"; - String linkstatus = mockMvc.perform(MockMvcRequestBuilders - .post("/information/linkstatus") - .contentType(MediaType.APPLICATION_JSON) - .header("Authorization", "Bearer " + getLogToken()) - .content(reqData)) - .andDo(print()).andExpect(status().isOk()) - .andExpect(jsonPath("$.code").value(ErrorCode.ERR_PARAMEXCEPTION.getHttpCode())) - .andReturn() - .getResponse() - .getContentAsString(); - - String msgContent = verifyResp(linkstatus); - Assert.assertTrue(msgContent.contains(String.valueOf(ErrorCode.ERR_PARAMEXCEPTION.getCode()))); - Assert.assertTrue(msgContent.contains(ErrorCode.ERR_PARAMEXCEPTION.getMsg())); - } - /** * Verify device id exists boolean. *