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 = {
|
@PostMapping(value = MgmtRestConstants.ROLLOUT_V1_REQUEST_MAPPING + "/{rolloutId}/retry", produces = {
|
||||||
MediaTypes.HAL_JSON_VALUE, MediaType.APPLICATION_JSON_VALUE})
|
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
|
@Override
|
||||||
public ResponseEntity<MgmtRolloutResponseBody> retryRollout(final String rolloutId) {
|
public ResponseEntity<MgmtRolloutResponseBody> retryRollout(final Long rolloutId) {
|
||||||
final Rollout rolloutForRetry = this.rolloutManagement.get(Long.parseLong(rolloutId))
|
final Rollout rolloutForRetry = this.rolloutManagement.get(rolloutId)
|
||||||
.orElseThrow(EntityNotFoundException::new);
|
.orElseThrow(() -> new EntityNotFoundException(Rollout.class, rolloutId));
|
||||||
|
|
||||||
if (rolloutForRetry.isDeleted()) {
|
if (rolloutForRetry.isDeleted()) {
|
||||||
throw new EntityNotFoundException(Rollout.class, rolloutId);
|
throw new EntityNotFoundException(Rollout.class, rolloutId);
|
||||||
|
|||||||
Reference in New Issue
Block a user