improving branch coverage for AssetResourceIntTest
This commit is contained in:
@ -74,13 +74,8 @@ public class AssetResource {
|
||||
@PutMapping("/assets")
|
||||
public ResponseEntity<AssetDTO> updateAsset(@Valid @RequestBody AssetDTO assetDTO) throws URISyntaxException {
|
||||
log.debug("REST request to update Asset : {}", assetDTO);
|
||||
if (assetDTO.getId() == null) {
|
||||
throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull");
|
||||
}
|
||||
AssetDTO result = assetService.save(assetDTO);
|
||||
return ResponseEntity.ok()
|
||||
.headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, assetDTO.getId().toString()))
|
||||
.body(result);
|
||||
// TODO mhoennig: Rather completely remove the endpoint?
|
||||
throw new BadRequestAlertException("Assets are immutable", ENTITY_NAME, "assetTransactionImmutable");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -132,7 +127,7 @@ public class AssetResource {
|
||||
@DeleteMapping("/assets/{id}")
|
||||
public ResponseEntity<Void> deleteAsset(@PathVariable Long id) {
|
||||
log.debug("REST request to delete Asset : {}", id);
|
||||
assetService.delete(id);
|
||||
return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build();
|
||||
// TODO mhoennig: Rather completely remove the endpoint?
|
||||
throw new BadRequestAlertException("Asset are immutable", ENTITY_NAME, "assetTransactionImmutable");
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
"membershipNotDeletable": "Mitgliedschaft kann nicht gelöscht werden, setze stattdessen das 'untilDate'",
|
||||
"untilDateMustBeAfterSinceDate": "Mitgliedshaftsaustrittsdatum muss nach dem Beitrittsdatum liegen",
|
||||
"documentDateMayNotBeAfterValueDate": "Belegdatum darf nicht vor dem Buchungsdatum liegen",
|
||||
"assetTransactionImmutable": "Transaktionen mit Geschäftsguthaben sind unveränderlich",
|
||||
"anotherUncancelledMembershipExists": "Nur eine einzige ungekündigte Mitgliedschaft pro Kunde ist zulässig",
|
||||
"assetPaymentsPositiveAmount": "Einzahlungen von Geschäftsguthaben erfordern einen positiven Betrag",
|
||||
"assetAdoptionsPositiveAmount": "Übernahmen von Geschäftsguthaben erfordern einen positiven Betrag",
|
||||
|
@ -7,6 +7,7 @@
|
||||
"untilDateMustBeAfterSinceDate": "Membership until date must be after since date",
|
||||
"documentDateMayNotBeAfterValueDate": "Document date may not be after value date",
|
||||
"anotherUncancelledMembershipExists": "Only a single uncancelled membership allowed per customer",
|
||||
"assetTransactionImmutable": "Asset transactions are immutable",
|
||||
"assetPaymentsPositiveAmount": "Asset payments require a positive amount",
|
||||
"assetAdoptionsPositiveAmount": "Asset adoptions require a positive amount",
|
||||
"assetPaybacksNegativeAmount": "Asset paybacks require a negative amount",
|
||||
|
Reference in New Issue
Block a user