@Test void testDeleteAttribute() { String entityTypeId = "MyEntityTypeId"; String attributeId = "attrId"; MetadataUpsertJobExecution jobExecution = mockUpsertJobExecution(); when(metadataApiService.deleteAttributeAsync(entityTypeId, attributeId)) .thenReturn(jobExecution); metadataApiController.deleteAttribute(entityTypeId, attributeId); verify(metadataApiService).deleteAttributeAsync(entityTypeId, attributeId); }
@Transactional @DeleteMapping("/{entityTypeId}/attributes/{attributeId}") public ResponseEntity<Void> deleteAttribute( @PathVariable("entityTypeId") String entityTypeId, @PathVariable("attributeId") String attributeId) { JobExecution jobExecution = metadataApiService.deleteAttributeAsync(entityTypeId, attributeId); return toLocationResponse(jobExecution); }
MetadataApiController extends ApiController { @Transactional @DeleteMapping("/{entityTypeId}/attributes/{attributeId}") public ResponseEntity<Void> deleteAttribute( @PathVariable("entityTypeId") String entityTypeId, @PathVariable("attributeId") String attributeId) { JobExecution jobExecution = metadataApiService.deleteAttributeAsync(entityTypeId, attributeId); return toLocationResponse(jobExecution); } }
MetadataApiController extends ApiController { @Transactional @DeleteMapping("/{entityTypeId}/attributes/{attributeId}") public ResponseEntity<Void> deleteAttribute( @PathVariable("entityTypeId") String entityTypeId, @PathVariable("attributeId") String attributeId) { JobExecution jobExecution = metadataApiService.deleteAttributeAsync(entityTypeId, attributeId); return toLocationResponse(jobExecution); } MetadataApiController(
      MetadataApiService metadataApiService,
      EntityTypeResponseMapper entityTypeResponseMapper,
      EntityTypeRequestMapper entityTypeRequestMapper,
      AttributeResponseMapper attributeResponseMapper,
      AttributeRequestMapper attributeRequestMapper); }
MetadataApiController extends ApiController { @Transactional @DeleteMapping("/{entityTypeId}/attributes/{attributeId}") public ResponseEntity<Void> deleteAttribute( @PathVariable("entityTypeId") String entityTypeId, @PathVariable("attributeId") String attributeId) { JobExecution jobExecution = metadataApiService.deleteAttributeAsync(entityTypeId, attributeId); return toLocationResponse(jobExecution); } MetadataApiController(
      MetadataApiService metadataApiService,
      EntityTypeResponseMapper entityTypeResponseMapper,
      EntityTypeRequestMapper entityTypeRequestMapper,
      AttributeResponseMapper attributeResponseMapper,
      AttributeRequestMapper attributeRequestMapper); @Transactional(readOnly = true) @GetMapping EntityTypesResponse getEntityTypes(@Valid ReadEntityTypesRequest entitiesRequest); @Transactional(readOnly = true) @GetMapping("/{entityTypeId}") EntityTypeResponse getEntityType(
      @PathVariable("entityTypeId") String entityTypeId,
      @Valid ReadEntityTypeRequest readEntityTypeRequest); @Transactional(readOnly = true) @GetMapping("/{entityTypeId}/attributes/{attributeId}") AttributeResponse getAttribute(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("attributeId") String attributeId); @Transactional @PostMapping ResponseEntity<Void> createEntityType(
      @Valid @RequestBody CreateEntityTypeRequest createEntityTypeRequest); @Transactional(readOnly = true) @GetMapping("/{entityTypeId}/attributes") AttributesResponse getAttributes(
      @PathVariable("entityTypeId") String entityTypeId,
      @Valid ReadAttributesRequest readAttributesRequest); @Transactional @PostMapping("/{entityTypeId}/attributes") ResponseEntity<Void> createAttribute(
      @PathVariable("entityTypeId") String entityTypeId,
      @Valid @RequestBody CreateAttributeRequest createAttributeRequest); @Transactional @DeleteMapping("/{entityTypeId}/attributes/{attributeId}") ResponseEntity<Void> deleteAttribute(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("attributeId") String attributeId); @Transactional @DeleteMapping("/{entityTypeId}/attributes") ResponseEntity<Void> deleteAttributes(
      @PathVariable("entityTypeId") String entityTypeId,
      @Valid DeleteAttributesRequest deleteAttributesRequest); @Transactional @PutMapping("/{entityTypeId}") ResponseEntity<Void> updateEntityType(
      @PathVariable("entityTypeId") String entityTypeId,
      @Valid @RequestBody CreateEntityTypeRequest createEntityTypeRequest); @Transactional @PutMapping("/{entityTypeId}/attributes/{attributeId}") ResponseEntity<Void> updateAttribute(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("attributeId") String attributeId,
      @Valid @RequestBody CreateAttributeRequest createAttributeRequest); @Transactional @PatchMapping("/{entityTypeId}/attributes/{attributeId}") ResponseEntity<Void> updatePartialAttribute(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("attributeId") String attributeId,
      @RequestBody Map<String, Object> attributeValues); @Transactional @PatchMapping("/{entityTypeId}") ResponseEntity<Void> updatePartialEntityType(
      @PathVariable("entityTypeId") String entityTypeId,
      @RequestBody Map<String, Object> entityTypeValues); @Transactional @DeleteMapping("/{entityTypeId}") ResponseEntity<Void> deleteEntityType(@PathVariable("entityTypeId") String entityTypeId); @Transactional @DeleteMapping ResponseEntity<Void> deleteEntityTypes(
      @Valid DeleteEntityTypesRequest deleteEntityTypesRequest); }
MetadataApiController extends ApiController { @Transactional @DeleteMapping("/{entityTypeId}/attributes/{attributeId}") public ResponseEntity<Void> deleteAttribute( @PathVariable("entityTypeId") String entityTypeId, @PathVariable("attributeId") String attributeId) { JobExecution jobExecution = metadataApiService.deleteAttributeAsync(entityTypeId, attributeId); return toLocationResponse(jobExecution); } MetadataApiController(
      MetadataApiService metadataApiService,
      EntityTypeResponseMapper entityTypeResponseMapper,
      EntityTypeRequestMapper entityTypeRequestMapper,
      AttributeResponseMapper attributeResponseMapper,
      AttributeRequestMapper attributeRequestMapper); @Transactional(readOnly = true) @GetMapping EntityTypesResponse getEntityTypes(@Valid ReadEntityTypesRequest entitiesRequest); @Transactional(readOnly = true) @GetMapping("/{entityTypeId}") EntityTypeResponse getEntityType(
      @PathVariable("entityTypeId") String entityTypeId,
      @Valid ReadEntityTypeRequest readEntityTypeRequest); @Transactional(readOnly = true) @GetMapping("/{entityTypeId}/attributes/{attributeId}") AttributeResponse getAttribute(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("attributeId") String attributeId); @Transactional @PostMapping ResponseEntity<Void> createEntityType(
      @Valid @RequestBody CreateEntityTypeRequest createEntityTypeRequest); @Transactional(readOnly = true) @GetMapping("/{entityTypeId}/attributes") AttributesResponse getAttributes(
      @PathVariable("entityTypeId") String entityTypeId,
      @Valid ReadAttributesRequest readAttributesRequest); @Transactional @PostMapping("/{entityTypeId}/attributes") ResponseEntity<Void> createAttribute(
      @PathVariable("entityTypeId") String entityTypeId,
      @Valid @RequestBody CreateAttributeRequest createAttributeRequest); @Transactional @DeleteMapping("/{entityTypeId}/attributes/{attributeId}") ResponseEntity<Void> deleteAttribute(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("attributeId") String attributeId); @Transactional @DeleteMapping("/{entityTypeId}/attributes") ResponseEntity<Void> deleteAttributes(
      @PathVariable("entityTypeId") String entityTypeId,
      @Valid DeleteAttributesRequest deleteAttributesRequest); @Transactional @PutMapping("/{entityTypeId}") ResponseEntity<Void> updateEntityType(
      @PathVariable("entityTypeId") String entityTypeId,
      @Valid @RequestBody CreateEntityTypeRequest createEntityTypeRequest); @Transactional @PutMapping("/{entityTypeId}/attributes/{attributeId}") ResponseEntity<Void> updateAttribute(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("attributeId") String attributeId,
      @Valid @RequestBody CreateAttributeRequest createAttributeRequest); @Transactional @PatchMapping("/{entityTypeId}/attributes/{attributeId}") ResponseEntity<Void> updatePartialAttribute(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("attributeId") String attributeId,
      @RequestBody Map<String, Object> attributeValues); @Transactional @PatchMapping("/{entityTypeId}") ResponseEntity<Void> updatePartialEntityType(
      @PathVariable("entityTypeId") String entityTypeId,
      @RequestBody Map<String, Object> entityTypeValues); @Transactional @DeleteMapping("/{entityTypeId}") ResponseEntity<Void> deleteEntityType(@PathVariable("entityTypeId") String entityTypeId); @Transactional @DeleteMapping ResponseEntity<Void> deleteEntityTypes(
      @Valid DeleteEntityTypesRequest deleteEntityTypesRequest);  }