Fix retryRollout input parameter in order to comply with the API (#1461)
* Fix retryRollout input parameter in order to comply with the API Signed-off-by: Stanislav Trailov <Stanislav.Trailov@bosch.io> * make exception more informative Signed-off-by: Stanislav Trailov <Stanislav.Trailov@bosch.io> --------- Signed-off-by: Stanislav Trailov <Stanislav.Trailov@bosch.io>
This commit is contained in:
committed by
GitHub
parent
ecf48430b4
commit
05def2ef1b
@@ -426,6 +426,6 @@ public interface MgmtRolloutRestApi {
|
||||
})
|
||||
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/retry", produces = {
|
||||
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE})
|
||||
ResponseEntity<MgmtRolloutResponseBody> retryRollout(@PathVariable("rolloutId") final String rolloutId);
|
||||
ResponseEntity<MgmtRolloutResponseBody> retryRollout(@PathVariable("rolloutId") final Long rolloutId);
|
||||
|
||||
}
|
||||
|
||||
@@ -313,9 +313,9 @@ public class MgmtRolloutResource implements MgmtRolloutRestApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<MgmtRolloutResponseBody> retryRollout(final String rolloutId) {
|
||||
final Rollout rolloutForRetry = this.rolloutManagement.get(Long.parseLong(rolloutId))
|
||||
.orElseThrow(EntityNotFoundException::new);
|
||||
public ResponseEntity<MgmtRolloutResponseBody> retryRollout(final Long rolloutId) {
|
||||
final Rollout rolloutForRetry = this.rolloutManagement.get(rolloutId)
|
||||
.orElseThrow(() -> new EntityNotFoundException(Rollout.class, rolloutId));
|
||||
|
||||
if (rolloutForRetry.isDeleted()) {
|
||||
throw new EntityNotFoundException(Rollout.class, rolloutId);
|
||||
|
||||
Reference in New Issue
Block a user