RelationshipController { @DeleteMapping( value = "/{id}" ) public void deleteRelationship( @PathVariable String id, HttpServletRequest request, HttpServletResponse response ) throws WebMessageException { Relationship relationship = relationshipService.getRelationshipByUid( id ); if ( relationship == null ) { throw new WebMessageException( notFound( "No relationship with id '" + id + "' was found." ) ); } webMessageService.send( WebMessageUtils.importSummary( relationshipService.deleteRelationship( id ) ), response, request ); } RelationshipController( RelationshipService relationshipService,
        TrackedEntityInstanceService trackedEntityInstanceService, ProgramInstanceService programInstanceService,
        ProgramStageInstanceService programStageInstanceService, WebMessageService webMessageService ); @GetMapping List<Relationship> getRelationships(
        @RequestParam( required = false ) String tei,
        @RequestParam( required = false ) String enrollment,
        @RequestParam( required = false ) String event
    ); @GetMapping( "/{id}" ) Relationship getRelationship(
        @PathVariable String id
    ); @PostMapping( value = "", consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE ) void postRelationshipJson(
        @RequestParam( defaultValue = "CREATE_AND_UPDATE" ) ImportStrategy strategy,
        ImportOptions importOptions,
        HttpServletRequest request, HttpServletResponse response
    ); @PostMapping( value = "", consumes = APPLICATION_XML_VALUE, produces = APPLICATION_XML_VALUE ) void postRelationshipXml(
        @RequestParam( defaultValue = "CREATE_AND_UPDATE" ) ImportStrategy strategy,
        ImportOptions importOptions,
        HttpServletRequest request, HttpServletResponse response
    ); @PutMapping( path = "/{id}", consumes = MediaType.APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE ) void updateRelationshipJson(
        @PathVariable String id,
        ImportOptions importOptions,
        HttpServletRequest request, HttpServletResponse response
    ); @PutMapping( path = "/{id}", consumes = MediaType.APPLICATION_XML_VALUE, produces = APPLICATION_XML_VALUE ) ImportSummary updateRelationshipXml(
        @PathVariable String id,
        ImportOptions importOptions,
        HttpServletRequest request
    ); @DeleteMapping( value = "/{id}" ) void deleteRelationship( @PathVariable String id, HttpServletRequest request, HttpServletResponse response
    );  }
@Test public void testDeleteRelationship() throws Exception { when( relationshipService.getRelationshipByUid( REL_ID ) ).thenReturn( relationship ); mockMvc.perform( get( ENDPOINT + "/" + REL_ID )).andExpect( status().isOk() ); }