コード例 #1
0
 @Test
 public void checkSubscribeContextImplemented() throws Exception {
   mockMvc
       .perform(
           post("/i/subscribeContext")
               .content(Util.json(jsonConverter, Util.createSubscribeContextTemperature()))
               .contentType(MediaType.APPLICATION_JSON)
               .header("Host", "localhost")
               .accept(MediaType.APPLICATION_JSON))
       .andExpect(status().isOk());
 }
コード例 #2
0
 @Test
 public void checkSubscribeContextImplementedInXml() throws Exception {
   mockMvc
       .perform(
           post("/i/subscribeContext")
               .content(xmlmapper.writeValueAsString(Util.createSubscribeContextTemperature()))
               .contentType(MediaType.APPLICATION_XML)
               .header("Host", "localhost")
               .accept(MediaType.APPLICATION_XML))
       .andExpect(status().isOk());
 }
コード例 #3
0
 @Test
 public void checkSubscribeContextNotImplemented() throws Exception {
   mockMvc
       .perform(
           post("/ni/subscribeContext")
               .content(Util.json(jsonConverter, Util.createSubscribeContextTemperature()))
               .contentType(MediaType.APPLICATION_JSON)
               .header("Host", "localhost")
               .accept(MediaType.APPLICATION_JSON))
       .andExpect(status().isOk())
       .andExpect(
           MockMvcResultMatchers.jsonPath("$.subscribeError.errorCode.code")
               .value(CodeEnum.CODE_403.getLabel()));
 }