### Question:
RegistryController { @DeleteMapping("{registrationId}") public ResponseEntity<byte[]> deleteCSource(@PathVariable("registrationId") String registrationId) { try { logger.debug("delete CSource() ::" + registrationId); csourceService.deleteCSourceRegistration(registrationId); logger.debug("delete CSource() completed::" + registrationId); return ResponseEntity.noContent().build(); } catch (ResponseException exception) { return ResponseEntity.status(exception.getHttpStatus()).body(new RestResponse(exception).toJsonBytes()); } catch (Exception e) { return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) .body(new RestResponse(ErrorType.InternalError, e.getLocalizedMessage()).toJsonBytes()); } }  @GetMapping ResponseEntity<byte[]> discoverCSource(HttpServletRequest request,
			@RequestParam HashMap<String, String> queryMap); @PostMapping ResponseEntity<byte[]> registerCSource(HttpServletRequest request,
			@RequestBody(required = false) String payload); @GetMapping("{registrationId}") ResponseEntity<byte[]> getCSourceById(HttpServletRequest request,
			@PathVariable("registrationId") String registrationId); @PatchMapping("{registrationId}") ResponseEntity<byte[]> updateCSource(HttpServletRequest request,
			@PathVariable("registrationId") String registrationId, @RequestBody String payload); @DeleteMapping("{registrationId}") ResponseEntity<byte[]> deleteCSource(@PathVariable("registrationId") String registrationId);  }### Answer:
@Test public void deleteCsourceTest() { try { when(csourceService.deleteCSourceRegistration("urn:ngsi-ld:ContextSourceRegistration:csr1a3458")) .thenReturn(true); mockMvc.perform(delete("/ngsi-ld/v1/csourceRegistrations/{registrationId}", "urn:ngsi-ld:ContextSourceRegistration:csr1a3458") .contentType(AppConstants.NGB_APPLICATION_JSONLD)).andExpect(status().isNoContent()).andDo(print()); } catch (Exception e) { Assert.fail(e.getMessage()); e.printStackTrace(); } }