@Test
 public void checkUpdateContextImplementedInXml() throws Exception {
   mockMvc
       .perform(
           post("/i/updateContext")
               .content(xmlmapper.writeValueAsString(Util.createUpdateContextTempSensor(0)))
               .contentType(MediaType.APPLICATION_XML)
               .header("Host", "localhost")
               .accept(MediaType.APPLICATION_XML))
       .andExpect(status().isOk());
 }
 @Test
 public void checkUpdateContextImplemented() throws Exception {
   mockMvc
       .perform(
           post("/i/updateContext")
               .content(Util.json(jsonConverter, Util.createUpdateContextTempSensor(0)))
               .contentType(MediaType.APPLICATION_JSON)
               .header("Host", "localhost")
               .accept(MediaType.APPLICATION_JSON))
       .andExpect(status().isOk());
 }
 @Test
 public void checkUpdateContextNotImplemented() throws Exception {
   mockMvc
       .perform(
           post("/ni/updateContext")
               .content(Util.json(jsonConverter, Util.createUpdateContextTempSensor(0)))
               .contentType(MediaType.APPLICATION_JSON)
               .header("Host", "localhost")
               .accept(MediaType.APPLICATION_JSON))
       .andExpect(status().isOk())
       .andExpect(
           MockMvcResultMatchers.jsonPath("$.errorCode.code").value(CodeEnum.CODE_403.getLabel()));
 }
  @Test
  public void missingParameterErrorUpdate() throws Exception {

    UpdateContext updateContext = Util.createUpdateContextTempSensor(0);
    updateContext.setUpdateAction(null);

    mockMvc
        .perform(
            post("/ni/updateContext")
                .content(Util.json(jsonConverter, updateContext))
                .contentType(MediaType.APPLICATION_JSON)
                .header("Host", "localhost")
                .accept(MediaType.APPLICATION_JSON))
        .andExpect(status().isOk())
        .andExpect(
            MockMvcResultMatchers.jsonPath("$.errorCode.code").value(CodeEnum.CODE_471.getLabel()))
        .andExpect(
            MockMvcResultMatchers.jsonPath("$.errorCode.reasonPhrase")
                .value(CodeEnum.CODE_471.getShortPhrase()))
        .andExpect(
            MockMvcResultMatchers.jsonPath("$.errorCode.details")
                .value("The parameter updateAction of type string is missing in the request"));
  }