-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#442] account for lists in YamlUtils#loadYaml
#443
Conversation
Also fixes a bug with the `hasDouble`, `hasInt`, and `hasBoolean` methods of `YamlObject`. Adds tests for `YamlUtils` including one to catch the root list issue. Finally, also updates the POM migration to account for POMs without dependcy management sections.
@@ -78,23 +97,23 @@ public String getString(String... path) { | |||
} | |||
|
|||
public boolean hasInt(String... path) { | |||
return hasValue(int.class, path); | |||
return hasValue(Integer.class, path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I: these were returning false when they shouldn't have as the map has the boxed version of the value so isInstance
was failing.
@@ -73,7 +73,8 @@ | |||
"implementation": "com.boozallen.aissemble.upgrade.migration.v1_10_0.DeltaSparkYamlMigration", | |||
"fileSets": [ | |||
{ | |||
"includes": ["**/*.yaml"] | |||
"includes": ["**/*.yaml"], | |||
"excludes": ["**/target/**", "**/templates/**"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I: Not strictly necessary but this cuts down significantly on the number of output lines talking about un-parseable helm templates.
public void theDecimalValueOfThePropertyIs(String name, double value) { | ||
String type = yaml.get(name).getClass().getSimpleName(); | ||
assertTrue("Property was not loaded as double: " + name + " (was " + type + ")", yaml.hasDouble(name)); | ||
assertEquals("Property value does not match for: " + name, value, yaml.getDouble(name), 0.01); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: 0.01
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a delta
param that they added to floating point assertions. Avoids the tricky floating point rounding issues where you get 0.000000000001
or some other minuscule difference just from how FP is represented. So this says treat the numbers as equal if they are within 0.01
of each other.
Also fixes a bug with the
hasDouble
,hasInt
, andhasBoolean
methods ofYamlObject
. Adds tests forYamlUtils
including one to catch the root list issue. Finally, also updates the POM migration to account for POMs without dependency management sections.