Skip to content

Commit

Permalink
test: fix: serialization of additionalProperties changed
Browse files Browse the repository at this point in the history
After new changes, additionalProperties fields are initialized
as LinkedHashMap. Since order of insertion is preserved,
test assertions should validate JSON output properly.
  • Loading branch information
manusa committed Nov 11, 2021
1 parent 8271e25 commit 00a28cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ void marshalWithAdditionalPropertiesOverridingFields() {
.withNewMetadata().withName("name").addToAnnotations("key", "value").endMetadata()
.withImmutable(true)
.build();
configMap.getAdditionalProperties().put("unknownField", "unknownValue");
configMap.getAdditionalProperties().put("immutable", "${immutable}");
configMap.getAdditionalProperties().put("unknownField", "unknownValue");
configMap.getMetadata().getAdditionalProperties().put("annotations", "${annotations}");
// When
final String result = Serialization.asJson(configMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ void writeValueAsStringWithAdditionalPropertiesOverridingFields() throws JsonPro
.withNewMetadata().withName("name").addToAnnotations("key", "ignored").addToLabels("lKey", "value").endMetadata()
.withImmutable(true)
.build();
configMap.getAdditionalProperties().put("unknownField", "unknownValue");
configMap.getAdditionalProperties().put("immutable", "${immutable}");
configMap.getAdditionalProperties().put("unknownField", "unknownValue");
configMap.getMetadata().getAdditionalProperties().put("annotations", "${annotations}");
// When
final String result = objectMapper.writeValueAsString(configMap);
Expand Down

0 comments on commit 00a28cc

Please sign in to comment.