Merge remote-tracking branch

'origin/GP-2915_Dan_nullDefaultParamValuesBreaksGADP--SQUASHED'
(Closes #4791)
This commit is contained in:
Ryan Kurtz 2022-12-22 11:27:54 -05:00
commit 006a7a5174
2 changed files with 8 additions and 2 deletions

View file

@ -539,7 +539,10 @@ public enum GadpValueUtils {
public static Gadp.Value makeValue(List<String> path, Object value) {
Gadp.Value.Builder b = Gadp.Value.newBuilder();
if (value instanceof Boolean) {
if (value == null) {
b.clearSpec();
}
else if (value instanceof Boolean) {
b.setBoolValue((Boolean) value);
}
else if (value instanceof Integer) {

View file

@ -384,7 +384,7 @@ public class GadpClientServerTest implements AsyncTestUtils {
}
private static final TargetParameterMap ORDERED_PARAMS = TargetMethod.makeParameters(
ParameterDescription.create(String.class, "H", true, "", "H", "H"),
ParameterDescription.create(String.class, "H", true, null, "H", "H"),
ParameterDescription.create(String.class, "e", true, "", "e", "e"),
ParameterDescription.create(String.class, "l", true, "", "l", "l"),
ParameterDescription.create(String.class, "m", true, "", "l", "l"),
@ -869,6 +869,9 @@ public class GadpClientServerTest implements AsyncTestUtils {
assertEquals("HelmoWprnd",
params.values().stream().map(p -> p.name).collect(Collectors.joining()));
assertNull(params.get("H").defaultValue);
assertEquals("", params.get("e").defaultValue);
waitOn(client.close());
}
finally {