Adding informative error when setting same value in 'set-param' CLI command
This closes
@@ -88,6 +88,10 @@ public class SetParam extends AbstractUpdateParamContextCommand<VoidResult> {
throw new IllegalArgumentException("A parameter value is required when creating a new parameter");
}
+ if (existingParam.isPresent() && existingParam.get().getValue().equals(paramValue)) {
+ throw new IllegalArgumentException(String.format("Parameter value supplied for parameter [%s] is the same as its current value", paramName));
+ }
+
// Construct the objects for the update...
final ParameterDTO parameterDTO = existingParam.isPresent() ? existingParam.get() : new ParameterDTO();
parameterDTO.setName(paramName);
