@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()); }
@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()); }
@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())); }