|
10 | 10 | import static io.harness.annotations.dev.HarnessTeam.PIPELINE;
|
11 | 11 | import static io.harness.rule.OwnerRule.ARCHIT;
|
12 | 12 | import static io.harness.rule.OwnerRule.BRIJESH;
|
| 13 | +import static io.harness.rule.OwnerRule.DEV_MITTAL; |
13 | 14 | import static io.harness.rule.OwnerRule.PRASHANTSHARMA;
|
14 | 15 | import static io.harness.rule.OwnerRule.SAHIL;
|
15 | 16 |
|
|
24 | 25 | import io.harness.rule.Owner;
|
25 | 26 | import io.harness.rule.OwnerRule;
|
26 | 27 |
|
| 28 | +import com.fasterxml.jackson.databind.ObjectMapper; |
27 | 29 | import com.fasterxml.jackson.databind.exc.MismatchedInputException;
|
| 30 | +import com.fasterxml.jackson.databind.node.ObjectNode; |
28 | 31 | import com.google.api.client.util.Charsets;
|
29 | 32 | import com.google.common.io.Resources;
|
30 | 33 | import java.io.IOException;
|
@@ -878,4 +881,24 @@ public void testDuplicateField() {
|
878 | 881 | assertThatCode(() -> YamlUtils.readTree(valid, true)).doesNotThrowAnyException();
|
879 | 882 | assertThatCode(() -> YamlUtils.readTree(valid)).doesNotThrowAnyException();
|
880 | 883 | }
|
| 884 | + |
| 885 | + @Test |
| 886 | + @Owner(developers = DEV_MITTAL) |
| 887 | + @Category(UnitTests.class) |
| 888 | + public void testRemoveUuid() { |
| 889 | + ObjectMapper mapper = new ObjectMapper(); |
| 890 | + ObjectNode stepElementConfig = mapper.createObjectNode(); |
| 891 | + |
| 892 | + stepElementConfig.put("a", "a"); |
| 893 | + stepElementConfig.put("b", "b"); |
| 894 | + stepElementConfig.put("c", "c"); |
| 895 | + YamlUtils.removeUuid(stepElementConfig); |
| 896 | + |
| 897 | + stepElementConfig.put(YamlNode.UUID_FIELD_NAME, "d"); |
| 898 | + YamlUtils.removeUuid(stepElementConfig); |
| 899 | + |
| 900 | + stepElementConfig.put(YamlNode.UUID_FIELD_NAME, "d"); |
| 901 | + stepElementConfig.put("e", "e"); |
| 902 | + YamlUtils.removeUuid(stepElementConfig); |
| 903 | + } |
881 | 904 | }
|
0 commit comments