NgsiRestClient extends NgsiClient { public ListenableFuture<UpdateContextSubscriptionResponse> updateContextSubscription(String url, HttpHeaders httpHeaders, String subscriptionID, UpdateContextSubscription updateContextSubscription) { return request(HttpMethod.PUT, url + subscriptionsPath + subscriptionID, httpHeaders, updateContextSubscription, UpdateContextSubscriptionResponse.class); }  ListenableFuture<AppendContextElementResponse> appendContextElement(String url, HttpHeaders httpHeaders, String entityID, AppendContextElement appendContextElement); ListenableFuture<UpdateContextElementResponse> updateContextElement(String url, HttpHeaders httpHeaders, String entityID, UpdateContextElement updateContextElement); ListenableFuture<ContextElementResponse> getContextElement(String url, HttpHeaders httpHeaders, String entityID); ListenableFuture<StatusCode> deleteContextElement(String url, HttpHeaders httpHeaders, String entityID); ListenableFuture<StatusCode> appendContextAttribute(String url, HttpHeaders httpHeaders, String entityID, String attributeName, UpdateContextAttribute updateContextAttribute); ListenableFuture<StatusCode> updateContextAttribute(String url, HttpHeaders httpHeaders, String entityID, String attributeName, UpdateContextAttribute updateContextAttribute); ListenableFuture<ContextAttributeResponse> getContextAttribute(String url, HttpHeaders httpHeaders, String entityID, String attributeName); ListenableFuture<StatusCode> deleteContextAttribute(String url, HttpHeaders httpHeaders, String entityID, String attributeName); ListenableFuture<StatusCode> updateContextAttributeValue(String url, HttpHeaders httpHeaders, String entityID, String attributeName, String valueID, UpdateContextAttribute updateContextAttribute); ListenableFuture<ContextAttributeResponse> getContextAttributeValue(String url, HttpHeaders httpHeaders, String entityID, String attributeName, String valueID); ListenableFuture<StatusCode> deleteContextAttributeValue(String url, HttpHeaders httpHeaders, String entityID, String attributeName, String valueID); ListenableFuture<QueryContextResponse> getContextEntityType(String url, HttpHeaders httpHeaders, String typeName); ListenableFuture<QueryContextResponse> getContextEntityTypeAttribute(String url, HttpHeaders httpHeaders, String typeName, String attributeName); ListenableFuture<SubscribeContextResponse> appendContextSubscription(String url, HttpHeaders httpHeaders, SubscribeContext subscribeContext); ListenableFuture<UpdateContextSubscriptionResponse> updateContextSubscription(String url, HttpHeaders httpHeaders, String subscriptionID, UpdateContextSubscription updateContextSubscription); ListenableFuture<UnsubscribeContextResponse> deleteContextSubscription(String url, HttpHeaders httpHeaders, String subscriptionID);  }
@Test public void testUpdateContextSubscription_JSON() throws Exception { String responseBody = json(jsonConverter, createUpdateContextSubscriptionResponseTemperature()); mockServer.expect(requestTo(baseUrl+"/ngsi10/contextSubscriptions/12345678")) .andExpect(method(HttpMethod.PUT)) .andRespond(withSuccess(responseBody, MediaType.APPLICATION_JSON)); UpdateContextSubscriptionResponse response = ngsiRestClient.updateContextSubscription(baseUrl, null, "12345678", createUpdateContextSubscriptionTemperature()).get(); this.mockServer.verify(); assertNotNull(response); assertNull(response.getSubscribeError()); assertNotNull(response.getSubscribeResponse()); assertEquals("12345678", response.getSubscribeResponse().getSubscriptionId()); assertEquals("P1M", response.getSubscribeResponse().getDuration()); }