aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-model/src/test/java/org
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2022-12-23 16:56:21 +0000
committerMichael Morris <michael.morris@est.tech>2023-01-03 14:19:17 +0000
commita81c40773b3c819f079bd741d472ee954572cb34 (patch)
tree24626c3affd27f8c03473275ddf89baa2ae3af60 /catalog-model/src/test/java/org
parent4871b522afd7dfee773dc891cb94d3f1eaafb040 (diff)
Fix 'NPE thrown in editing constraints'-bug
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Change-Id: Ibbd8a3baa2a2bfdbd6e2c235db5a1d59875f3e6e Issue-ID: SDC-4312
Diffstat (limited to 'catalog-model/src/test/java/org')
-rw-r--r--catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraintTest.java54
1 files changed, 9 insertions, 45 deletions
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraintTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraintTest.java
index 8eff6f7cdc..1491e0547d 100644
--- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraintTest.java
+++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/constraints/InRangeConstraintTest.java
@@ -30,7 +30,7 @@ import java.util.List;
import org.junit.jupiter.api.Test;
import org.openecomp.sdc.be.model.tosca.constraints.exception.ConstraintValueDoNotMatchPropertyTypeException;
-public class InRangeConstraintTest {
+class InRangeConstraintTest {
private InRangeConstraint createStringTestSubject() {
List<Object> validValues = new ArrayList<>();
@@ -47,7 +47,7 @@ public class InRangeConstraintTest {
}
@Test
- public void testGetInRange() {
+ void testGetInRange() {
InRangeConstraint testSubject = createStringTestSubject();
List<Object> result = testSubject.getInRange();
@@ -57,7 +57,7 @@ public class InRangeConstraintTest {
}
@Test
- public void testSetInRange() {
+ void testSetInRange() {
InRangeConstraint testSubject = createStringTestSubject();
List<Object> validValues = new ArrayList<>();
validValues.add("test21");
@@ -71,43 +71,7 @@ public class InRangeConstraintTest {
}
@Test
- public void testGetRangeMinValue() throws Exception {
- InRangeConstraint testSubject = createIntegerTestSubject();
- Object result = testSubject.getRangeMinValue();
-
- assertEquals(1, result);
- }
-
- @Test
- public void testSetRangeMinValue() throws Exception {
- InRangeConstraint testSubject = createIntegerTestSubject();
- testSubject.setRangeMinValue(21);
-
- Object result = testSubject.getRangeMinValue();
-
- assertEquals(21, result);
- }
-
- @Test
- public void testGetRangeMaxValue() throws Exception {
- InRangeConstraint testSubject = createIntegerTestSubject();
- Object result = testSubject.getRangeMaxValue();
-
- assertEquals(10, result);
- }
-
- @Test
- public void testSetRangeMaxValue() throws Exception {
- InRangeConstraint testSubject = createIntegerTestSubject();
- testSubject.setRangeMaxValue(30);
-
- Object result = testSubject.getRangeMaxValue();
-
- assertEquals(30, result);
- }
-
- @Test
- public void testValidateValueTypeStringTrue() throws ConstraintValueDoNotMatchPropertyTypeException {
+ void testValidateValueTypeStringTrue() throws ConstraintValueDoNotMatchPropertyTypeException {
InRangeConstraint testSubject = createStringTestSubject();
Boolean validTypes = testSubject.validateValueType("string");
@@ -115,7 +79,7 @@ public class InRangeConstraintTest {
}
@Test
- public void testValidateValueTypeStringFalse() throws ConstraintValueDoNotMatchPropertyTypeException {
+ void testValidateValueTypeStringFalse() throws ConstraintValueDoNotMatchPropertyTypeException {
InRangeConstraint testSubject = createStringTestSubject();
Boolean validTypes = testSubject.validateValueType("integer");
@@ -123,7 +87,7 @@ public class InRangeConstraintTest {
}
@Test
- public void testValidateValueTypeIntegerTrue() throws ConstraintValueDoNotMatchPropertyTypeException {
+ void testValidateValueTypeIntegerTrue() throws ConstraintValueDoNotMatchPropertyTypeException {
InRangeConstraint testSubject = createIntegerTestSubject();
Boolean validTypes = testSubject.validateValueType("integer");
@@ -131,7 +95,7 @@ public class InRangeConstraintTest {
}
@Test
- public void testValidateValueTypeIntegerFalse() throws ConstraintValueDoNotMatchPropertyTypeException {
+ void testValidateValueTypeIntegerFalse() throws ConstraintValueDoNotMatchPropertyTypeException {
InRangeConstraint testSubject = createIntegerTestSubject();
Boolean validTypes = testSubject.validateValueType("string");
@@ -139,7 +103,7 @@ public class InRangeConstraintTest {
}
@Test
- public void testChangeStringConstraintValueTypeToIntegerThrow() {
+ void testChangeStringConstraintValueTypeToIntegerThrow() {
String propertyType = "integer";
InRangeConstraint testSubject = createStringTestSubject();
Exception exception = assertThrows(ConstraintValueDoNotMatchPropertyTypeException.class, () -> {
@@ -153,7 +117,7 @@ public class InRangeConstraintTest {
}
@Test
- public void testChangeIntegerConstraintValueTypeToString() throws ConstraintValueDoNotMatchPropertyTypeException {
+ void testChangeIntegerConstraintValueTypeToString() throws ConstraintValueDoNotMatchPropertyTypeException {
InRangeConstraint testSubject = createIntegerTestSubject();
testSubject.changeConstraintValueTypeTo("string");
List<Object> result = testSubject.getInRange();