### Question:
RegistrySubscriptionController { @PatchMapping("{id}") public ResponseEntity<byte[]> updateSubscription(HttpServletRequest request, @PathVariable(name = NGSIConstants.QUERY_PARAMETER_ID, required = true) URI id, @RequestBody String payload) throws ResponseException { logger.trace("call updateSubscription() ::"); List<Object> context = HttpUtils.getAtContext(request); String resolved = contextResolver.expand(payload, context, true, AppConstants.CSOURCE_URL_ID); Subscription subscription = DataSerializer.getSubscription(resolved); if(subscription.getId() == null) { subscription.setId(id); } if (resolved == null || subscription == null || !id.equals(subscription.getId())) { return badRequestResponse; } try { manager.updateSubscription(subscription); } catch (ResponseException e) { logger.error("Exception ::",e); return ResponseEntity.status(e.getHttpStatus()).body(new RestResponse(e).toJsonBytes()); } return ResponseEntity.noContent().build(); }  @PostMapping ResponseEntity<byte[]> subscribeRest(HttpServletRequest request,	@RequestBody String payload); @GetMapping ResponseEntity<byte[]> getAllSubscriptions(HttpServletRequest request,  @RequestParam(required = false, name = "limit", defaultValue = "0") int limit); @GetMapping("{id}") //(method = RequestMethod.GET, value = "/{id}") ResponseEntity<byte[]> getSubscriptions(HttpServletRequest request, @PathVariable(name = NGSIConstants.QUERY_PARAMETER_ID, required = true) URI id,
			@RequestParam(required = false, name = "limit", defaultValue = "0") int limit); @DeleteMapping("{id}") @RequestMapping(method = RequestMethod.DELETE, value = "/{id}") ResponseEntity<byte[]> deleteSubscription(@PathVariable(name = NGSIConstants.QUERY_PARAMETER_ID, required = true) URI id); @PatchMapping("{id}") ResponseEntity<byte[]> updateSubscription(HttpServletRequest request, @PathVariable(name = NGSIConstants.QUERY_PARAMETER_ID, required = true) URI id,
			@RequestBody String payload);  }### Answer:
@Test public void updateSubscriptionTest() { try { when(csourceSubsService.updateSubscription(any())).thenReturn(any()); mockMvc.perform(patch("/ngsi-ld/v1/csourceSubscriptions/{id}", "urn:ngsi-ld:Subscription:7") .contentType(AppConstants.NGB_APPLICATION_JSONLD).content(payload)) .andExpect(status().isNoContent()).andDo(print()); verify(csourceSubsService, times(1)).updateSubscription(any()); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } }