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. *