X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=models-tosca%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fmodels%2Ftosca%2Fsimple%2Fconcepts%2FJpaToscaCapabilityAssignmentTest.java;h=9637d4252dc42d5bd14bfef8d49f82a98c1b113d;hb=6345dce40405740dc09176c45dae03baeb939b8e;hp=ee2fee86bed099996de78a25c558c9a0fca43ce1;hpb=4c4946e339942863e73e20726dd95aaacfcfb5a6;p=policy%2Fmodels.git diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaCapabilityAssignmentTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaCapabilityAssignmentTest.java index ee2fee86b..9637d4252 100644 --- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaCapabilityAssignmentTest.java +++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaCapabilityAssignmentTest.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2020 Nordix Foundation. + * Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +32,7 @@ import java.util.List; import java.util.Map; import org.junit.Test; import org.onap.policy.models.base.PfConceptKey; -import org.onap.policy.models.base.PfValidationResult; +import org.onap.policy.models.base.Validated; import org.onap.policy.models.tosca.authorative.concepts.ToscaCapabilityAssignment; /** @@ -69,7 +70,7 @@ public class JpaToscaCapabilityAssignmentTest { assertEquals(caKey, ca.getKeys().get(0)); ca.clean(); - ca.validate(new PfValidationResult()); + ca.validate(""); assertThat(ca.getProperties()).isNullOrEmpty(); assertThat(ca.getAttributes()).isNullOrEmpty(); @@ -77,7 +78,7 @@ public class JpaToscaCapabilityAssignmentTest { ca.setAttributes(null); ca.setOccurrences(null); ca.clean(); - ca.validate(new PfValidationResult()); + ca.validate(""); assertEquals(null, ca.getProperties()); assertEquals(null, ca.getAttributes()); @@ -94,7 +95,7 @@ public class JpaToscaCapabilityAssignmentTest { ca.setOccurrences(occurrences); ca.clean(); - ca.validate(new PfValidationResult()); + ca.validate(""); assertEquals("Untrimmed Value", ca.getProperties().get("Key0")); assertEquals("Untrimmed Value", ca.getAttributes().get("Key0")); @@ -102,10 +103,10 @@ public class JpaToscaCapabilityAssignmentTest { ca.getAttributes().put("Key1", null); ca.getOccurrences().add(null); ca.getOccurrences().add(-12345); - PfValidationResult result = ca.validate(new PfValidationResult()); - assertThat(result.toString()).contains("capability assignment property Key1 value may not be null"); - assertThat(result.toString()).contains("capability assignment attribute Key1 value may not be null"); - assertThat(result.toString()).contains("capability assignment occurrence value may not be negative"); + assertThat(ca.validate("").getResult()) + .contains("properties").contains("Key1").contains(Validated.IS_NULL) + .contains("attributes").contains("Key1").contains(Validated.IS_NULL) + .contains("occurrence").contains("value").contains("is below the minimum value: 0"); } @Test