jacoco code coverage (with deliberately too low limit for testing)
This commit is contained in:
@ -1,25 +1,24 @@
|
||||
package org.hostsharing.hsadminng.web.rest;
|
||||
|
||||
import io.github.jhipster.web.util.ResponseUtil;
|
||||
import org.hostsharing.hsadminng.service.ShareQueryService;
|
||||
import org.hostsharing.hsadminng.service.ShareService;
|
||||
import org.hostsharing.hsadminng.service.dto.ShareCriteria;
|
||||
import org.hostsharing.hsadminng.service.dto.ShareDTO;
|
||||
import org.hostsharing.hsadminng.web.rest.errors.BadRequestAlertException;
|
||||
import org.hostsharing.hsadminng.web.rest.util.HeaderUtil;
|
||||
import org.hostsharing.hsadminng.web.rest.util.PaginationUtil;
|
||||
import org.hostsharing.hsadminng.service.dto.ShareDTO;
|
||||
import org.hostsharing.hsadminng.service.dto.ShareCriteria;
|
||||
import org.hostsharing.hsadminng.service.ShareQueryService;
|
||||
import io.github.jhipster.web.util.ResponseUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@ -74,13 +73,8 @@ public class ShareResource {
|
||||
@PutMapping("/shares")
|
||||
public ResponseEntity<ShareDTO> updateShare(@Valid @RequestBody ShareDTO shareDTO) throws URISyntaxException {
|
||||
log.debug("REST request to update Share : {}", shareDTO);
|
||||
if (shareDTO.getId() == null) {
|
||||
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
|
||||
}
|
||||
ShareDTO result = shareService.save(shareDTO);
|
||||
return ResponseEntity.ok()
|
||||
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, shareDTO.getId().toString()))
|
||||
.body(result);
|
||||
// TODO mhoennig: Rather completely remove the endpoint?
|
||||
throw new BadRequestAlertException("Shares are immutable", ENTITY_NAME, "shareTransactionImmutable");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -132,7 +126,7 @@ public class ShareResource {
|
||||
@DeleteMapping("/shares/{id}")
|
||||
public ResponseEntity<Void> deleteShare(@PathVariable Long id) {
|
||||
log.debug("REST request to delete Share : {}", id);
|
||||
shareService.delete(id);
|
||||
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
|
||||
// TODO mhoennig: Rather completely remove the endpoint?
|
||||
throw new BadRequestAlertException("Shares are immutable", ENTITY_NAME, "shareTransactionImmutable");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user