aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoruj426b <uj426b@att.com>2020-07-31 12:06:01 -0400
committerPamela Dragosh <pdragosh@research.att.com>2020-08-20 12:23:26 +0000
commitdbb37442ecf243d3bcaf50f908691ad6f810ccfc (patch)
tree98663790800976a1785b1d127a9fb677712c0759
parente88e4b3281fa4881093ccd1dfae8f826a5e9ff5a (diff)
Sonar Fixes policy/models, removing model-yaml
Change-Id: Icd82ea1aef90e4d638b13958519aac5ed5a53f73 Issue-ID: POLICY-2714 Signed-off-by: uj426b <uj426b@att.com>
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java11
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java9
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java12
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/PfModelTest.java5
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java22
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java9
-rw-r--r--models-base/src/test/java/org/onap/policy/models/base/ValidatedTest.java5
-rw-r--r--models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java13
-rw-r--r--models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java58
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaIdentifierTestBase.java4
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java26
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/ToscaServiceTemplateMappingTest.java4
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypeTest.java9
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntrySchemaTest.java9
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilterTest.java13
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModelTest.java9
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTest.java13
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypeTest.java21
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPropertyTest.java30
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplateTest.java15
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTimeIntervalTest.java11
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTopologyTemplateTest.java11
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTriggerTest.java27
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicySerializationTest.java32
-rw-r--r--models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicyTypeSerializationTest.java48
25 files changed, 222 insertions, 204 deletions
diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java
index 3ae3ba8e5..062f6f953 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/PfConceptContainerTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -24,6 +24,7 @@ package org.onap.policy.models.base;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -119,19 +120,19 @@ public class PfConceptContainerTest {
assertThatThrownBy(() -> new DummyPfConceptContainer((DummyPfConceptContainer) null))
.isInstanceOf(NullPointerException.class);
- assertFalse(container.compareTo(null) == 0);
+ assertNotEquals(0, container.compareTo(null));
assertEquals(0, container.compareTo(container));
- assertFalse(container.compareTo(conceptKey) == 0);
+ assertNotEquals(0, container.compareTo(conceptKey));
DummyPfConceptContainer testContainer = new DummyPfConceptContainer(container);
testContainer.getKey().setVersion("0.0.2");
- assertFalse(container.compareTo(testContainer) == 0);
+ assertNotEquals(0, container.compareTo(testContainer));
testContainer.getKey().setVersion(container.getKey().getVersion());
assertEquals(0, container.compareTo(testContainer));
PfConceptKey testConceptKey = new PfConceptKey("TestKey", VERSION0_0_1);
testContainer.getConceptMap().put(testConceptKey, new DummyPfConcept(testConceptKey));
- assertFalse(container.compareTo(testContainer) == 0);
+ assertNotEquals(0, container.compareTo(testContainer));
final DummyPfConceptContainer container3 = container;
assertThatThrownBy(() -> container3.validate(null))
diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java
index c756d1e06..8ff5e509c 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/PfKeyImplTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -25,6 +25,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -137,9 +138,9 @@ public class PfKeyImplTest {
assertEquals(0, someKey0.compareTo(someKey0));
assertEquals(-36, someKey0.compareTo(new DummyPfKey()));
- assertFalse(someKey0.equals(null));
- assertTrue(someKey0.equals(someKey0));
- assertFalse(someKey0.equals(new DummyPfKey()));
+ assertNotEquals(someKey0, null);
+ assertEquals(someKey0, someKey0);
+ assertNotEquals(someKey0, new DummyPfKey());
MyKey someKey8 = new MyKey();
someKey8.setVersion(VERSION001);
diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java
index 46a00664f..e4933b2b9 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/PfKeyUseTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -71,12 +71,12 @@ public class PfKeyUseTest {
PfKeyUse clonedKeyUse = new PfKeyUse(keyUse);
assertEquals("PfKeyUse(usedKey=PfConceptKey(name=Key, version=0.0.1))", clonedKeyUse.toString());
- assertFalse(keyUse.hashCode() == 0);
+ assertNotEquals(0, keyUse.hashCode());
- assertTrue(keyUse.equals(keyUse));
- assertTrue(keyUse.equals(clonedKeyUse));
- assertFalse(keyUse.equals("Hello"));
- assertTrue(keyUse.equals(new PfKeyUse(key)));
+ assertEquals(keyUse, keyUse);
+ assertEquals(keyUse, clonedKeyUse);
+ assertNotEquals(keyUse, (Object) "Hello");
+ assertEquals(keyUse, new PfKeyUse(key));
assertEquals(0, keyUse.compareTo(keyUse));
assertEquals(0, keyUse.compareTo(clonedKeyUse));
diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfModelTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfModelTest.java
index c124393fe..9e4e350a1 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/PfModelTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/PfModelTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -24,6 +24,7 @@ package org.onap.policy.models.base;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -65,7 +66,7 @@ public class PfModelTest {
assertEquals(0, dpm.compareTo(dpmClone));
assertEquals(-1, dpm.compareTo(null));
assertEquals(0, dpm.compareTo(dpm));
- assertFalse(dpm.compareTo(dpm.getKey()) == 0);
+ assertNotEquals(0, dpm.compareTo(dpm.getKey()));
}
@Test
diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java
index dd5c205a7..c1c13c8b3 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/PfReferenceKeyTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -103,16 +103,16 @@ public class PfReferenceKeyTest {
assertEquals("PfReferenceKey(parentKeyName=NPKN, parentKeyVersion=0.0.1, parentLocalName=NPKLN, localName=NLN)",
clonedReferenceKey.toString());
- assertFalse(testReferenceKey.hashCode() == 0);
+ assertNotEquals(0, testReferenceKey.hashCode());
- assertTrue(testReferenceKey.equals(testReferenceKey));
- assertTrue(testReferenceKey.equals(clonedReferenceKey));
- assertFalse(testReferenceKey.equals("Hello"));
- assertFalse(testReferenceKey.equals(new PfReferenceKey("PKN", VERSION002, "PLN", "LN")));
- assertFalse(testReferenceKey.equals(new PfReferenceKey("NPKN", VERSION002, "PLN", "LN")));
- assertFalse(testReferenceKey.equals(new PfReferenceKey("NPKN", VERSION001, "PLN", "LN")));
- assertFalse(testReferenceKey.equals(new PfReferenceKey("NPKN", VERSION001, "NPLN", "LN")));
- assertTrue(testReferenceKey.equals(new PfReferenceKey("NPKN", VERSION001, NPKLN, "NLN")));
+ assertEquals(testReferenceKey, testReferenceKey);
+ assertEquals(testReferenceKey, clonedReferenceKey);
+ assertNotEquals(testReferenceKey, (Object) "Hello");
+ assertNotEquals(testReferenceKey, new PfReferenceKey("PKN", VERSION002, "PLN", "LN"));
+ assertNotEquals(testReferenceKey, new PfReferenceKey("NPKN", VERSION002, "PLN", "LN"));
+ assertNotEquals(testReferenceKey, new PfReferenceKey("NPKN", VERSION001, "PLN", "LN"));
+ assertNotEquals(testReferenceKey, new PfReferenceKey("NPKN", VERSION001, "NPLN", "LN"));
+ assertEquals(testReferenceKey, new PfReferenceKey("NPKN", VERSION001, NPKLN, "NLN"));
assertEquals(0, testReferenceKey.compareTo(testReferenceKey));
assertEquals(0, testReferenceKey.compareTo(clonedReferenceKey));
@@ -123,7 +123,7 @@ public class PfReferenceKeyTest {
assertNotEquals(0, testReferenceKey.compareTo(new PfReferenceKey("NPKN", VERSION001, "NPLN", "LN")));
assertEquals(0, testReferenceKey.compareTo(new PfReferenceKey("NPKN", VERSION001, NPKLN, "NLN")));
- assertFalse(testReferenceKey.equals(null));
+ assertNotEquals(testReferenceKey, null);
assertThatThrownBy(() -> new PfReferenceKey((PfReferenceKey) null)).isInstanceOf(NullPointerException.class);
diff --git a/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java b/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java
index 8659b4cea..f5f5ad002 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/PfUtilsTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -24,6 +24,7 @@ package org.onap.policy.models.base;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNull;
import java.util.Arrays;
@@ -48,7 +49,7 @@ public class PfUtilsTest {
assertEquals(0, PfUtils.compareObjects(null, null));
assertEquals(-1, PfUtils.compareObjects(HELLO, null));
assertEquals(1, PfUtils.compareObjects(null, HELLO));
- assertFalse(PfUtils.compareObjects(HELLO, "goodbye") == 0);
+ assertNotEquals(PfUtils.compareObjects(HELLO, "goodbye"), 0);
assertEquals(0, PfUtils.compareObjects(HELLO, HELLO));
}
@@ -91,12 +92,12 @@ public class PfUtilsTest {
@Test
public void testMakeCopy() {
assertNull(PfUtils.makeCopy((MyObject) null));
-
+ NoCopyConstructor noCopyConstructor = new NoCopyConstructor();
MyObject origObject = new MyObject();
origObject.name = HELLO;
assertEquals(origObject.toString(), PfUtils.makeCopy(origObject).toString());
- assertThatThrownBy(() -> PfUtils.makeCopy(new NoCopyConstructor())).isInstanceOf(PfModelRuntimeException.class);
+ assertThatThrownBy(() -> PfUtils.makeCopy(noCopyConstructor)).isInstanceOf(PfModelRuntimeException.class);
}
@Getter
diff --git a/models-base/src/test/java/org/onap/policy/models/base/ValidatedTest.java b/models-base/src/test/java/org/onap/policy/models/base/ValidatedTest.java
index 64612238b..5d1367028 100644
--- a/models-base/src/test/java/org/onap/policy/models/base/ValidatedTest.java
+++ b/models-base/src/test/java/org/onap/policy/models/base/ValidatedTest.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP Policy Models
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -149,9 +149,10 @@ public class ValidatedTest {
assertTrue(msg.getMessage().contains("name invalid-null"));
assertTrue(it.next().getMessage().contains("version invalid-null"));
+ PfValidationResult pfValidationResult = new PfValidationResult();
final PfConceptKey key2 = key;
assertThatThrownBy(() -> validated.validateNotNull(key2, null)).isInstanceOf(NullPointerException.class);
- assertThatThrownBy(() -> validated.validateNotNull(null, new PfValidationResult()))
+ assertThatThrownBy(() -> validated.validateNotNull(null, pfValidationResult))
.isInstanceOf(NullPointerException.class);
}
diff --git a/models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java b/models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java
index 433196421..040b76b9b 100644
--- a/models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java
+++ b/models-dao/src/test/java/org/onap/policy/models/dao/EntityTest.java
@@ -26,7 +26,6 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Date;
@@ -184,13 +183,13 @@ public class EntityTest {
pfDao.create(keyInfo0);
final DummyConceptEntity keyInfoBack0 = pfDao.get(DummyConceptEntity.class, aKey0);
- assertTrue(keyInfo0.equals(keyInfoBack0));
+ assertEquals(keyInfo0, keyInfoBack0);
final DummyConceptEntity keyInfoBackNull = pfDao.get(DummyConceptEntity.class, PfConceptKey.getNullKey());
assertNull(keyInfoBackNull);
final DummyConceptEntity keyInfoBack1 = pfDao.getConcept(DummyConceptEntity.class, aKey0);
- assertTrue(keyInfoBack0.equals(keyInfoBack1));
+ assertEquals(keyInfoBack0, keyInfoBack1);
final DummyConceptEntity keyInfoBack2 =
pfDao.getConcept(DummyConceptEntity.class, new PfConceptKey("A-KEY3", VERSION001));
@@ -205,12 +204,12 @@ public class EntityTest {
Set<DummyConceptEntity> keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
keyInfoSetIn.add(keyInfo0);
- assertTrue(keyInfoSetIn.equals(keyInfoSetOut));
+ assertEquals(keyInfoSetIn, keyInfoSetOut);
pfDao.delete(keyInfo1);
keyInfoSetIn.remove(keyInfo1);
keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
- assertTrue(keyInfoSetIn.equals(keyInfoSetOut));
+ assertEquals(keyInfoSetIn, keyInfoSetOut);
pfDao.deleteCollection(keyInfoSetIn);
keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
@@ -221,7 +220,7 @@ public class EntityTest {
keyInfoSetIn.add(keyInfo0);
pfDao.createCollection(keyInfoSetIn);
keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
- assertTrue(keyInfoSetIn.equals(keyInfoSetOut));
+ assertEquals(keyInfoSetIn, keyInfoSetOut);
pfDao.delete(DummyConceptEntity.class, aKey0);
keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
@@ -243,7 +242,7 @@ public class EntityTest {
keyInfoSetIn.add(keyInfo0);
pfDao.createCollection(keyInfoSetIn);
keyInfoSetOut = new TreeSet<>(pfDao.getAll(DummyConceptEntity.class));
- assertTrue(keyInfoSetIn.equals(keyInfoSetOut));
+ assertEquals(keyInfoSetIn, keyInfoSetOut);
pfDao.deleteAll(DummyConceptEntity.class);
assertEquals(0, pfDao.size(DummyConceptEntity.class));
diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java
index 2fea0f868..f7b663e4b 100644
--- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java
+++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoRequestDetailsTest.java
@@ -24,11 +24,9 @@
package org.onap.policy.so;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
@@ -115,63 +113,63 @@ public class SoRequestDetailsTest {
SoRequestDetails copiedDetails = new SoRequestDetails(details);
- assertTrue(details.equals(details));
- assertTrue(details.equals(copiedDetails));
- assertFalse(details.equals(null));
- assertFalse(details.equals("Hello"));
+ assertEquals(details, details);
+ assertEquals(details, copiedDetails);
+ assertNotEquals(details, null);
+ assertNotEquals(details, (Object) "Hello");
details.setCloudConfiguration(null);
- assertFalse(details.equals(copiedDetails));
+ assertNotEquals(details, copiedDetails);
copiedDetails.setCloudConfiguration(null);
- assertTrue(details.equals(copiedDetails));
+ assertEquals(details, copiedDetails);
details.setCloudConfiguration(cloudConfiguration);
- assertFalse(details.equals(copiedDetails));
+ assertNotEquals(details, copiedDetails);
copiedDetails.setCloudConfiguration(cloudConfiguration);
- assertTrue(details.equals(copiedDetails));
+ assertEquals(details, copiedDetails);
details.setModelInfo(null);
- assertFalse(details.equals(copiedDetails));
+ assertNotEquals(details, copiedDetails);
copiedDetails.setModelInfo(null);
- assertTrue(details.equals(copiedDetails));
+ assertEquals(details, copiedDetails);
details.setModelInfo(modelInfo);
- assertFalse(details.equals(copiedDetails));
+ assertNotEquals(details, copiedDetails);
copiedDetails.setModelInfo(modelInfo);
- assertTrue(details.equals(copiedDetails));
+ assertEquals(details, copiedDetails);
details.setRequestInfo(null);
- assertFalse(details.equals(copiedDetails));
+ assertNotEquals(details, copiedDetails);
copiedDetails.setRequestInfo(null);
- assertTrue(details.equals(copiedDetails));
+ assertEquals(details, copiedDetails);
details.setRequestInfo(requestInfo);
- assertFalse(details.equals(copiedDetails));
+ assertNotEquals(details, copiedDetails);
copiedDetails.setRequestInfo(requestInfo);
- assertTrue(details.equals(copiedDetails));
+ assertEquals(details, copiedDetails);
details.setRequestParameters(null);
- assertFalse(details.equals(copiedDetails));
+ assertNotEquals(details, copiedDetails);
copiedDetails.setRequestParameters(null);
- assertTrue(details.equals(copiedDetails));
+ assertEquals(details, copiedDetails);
details.setRequestParameters(requestParameters);
- assertFalse(details.equals(copiedDetails));
+ assertNotEquals(details, copiedDetails);
copiedDetails.setRequestParameters(requestParameters);
- assertTrue(details.equals(copiedDetails));
+ assertEquals(details, copiedDetails);
details.setSubscriberInfo(null);
- assertFalse(details.equals(copiedDetails));
+ assertNotEquals(details, copiedDetails);
copiedDetails.setSubscriberInfo(null);
- assertTrue(details.equals(copiedDetails));
+ assertEquals(details, copiedDetails);
details.setSubscriberInfo(subscriberInfo);
- assertFalse(details.equals(copiedDetails));
+ assertNotEquals(details, copiedDetails);
copiedDetails.setSubscriberInfo(subscriberInfo);
- assertTrue(details.equals(copiedDetails));
+ assertEquals(details, copiedDetails);
details.setRelatedInstanceList(null);
- assertFalse(details.equals(copiedDetails));
+ assertNotEquals(details, copiedDetails);
copiedDetails.setRelatedInstanceList(null);
- assertTrue(details.equals(copiedDetails));
+ assertEquals(details, copiedDetails);
details.setRelatedInstanceList(relatedInstanceList);
- assertFalse(details.equals(copiedDetails));
+ assertNotEquals(details, copiedDetails);
copiedDetails.setRelatedInstanceList(relatedInstanceList);
- assertTrue(details.equals(copiedDetails));
+ assertEquals(details, copiedDetails);
}
}
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaIdentifierTestBase.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaIdentifierTestBase.java
index d7bca2808..5419b217b 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaIdentifierTestBase.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/concepts/ToscaIdentifierTestBase.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP Policy Models
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-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.
@@ -67,7 +67,7 @@ public class ToscaIdentifierTestBase<T extends Comparable<T>> {
assertTrue(ident.compareTo(null) > 0);
- assertTrue(ident.compareTo(makeIdent(NAME, VERSION)) == 0);
+ assertEquals(0, ident.compareTo(makeIdent(NAME, VERSION)));
assertTrue(ident.compareTo(makeIdent(NAME, null)) > 0);
assertTrue(ident.compareTo(makeIdent(null, VERSION)) > 0);
assertTrue(ident.compareTo(makeIdent(NAME, VERSION + "a")) < 0);
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java
index 969e24003..7d900ab3a 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/AuthorativeToscaProviderPolicyTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -129,7 +129,7 @@ public class AuthorativeToscaProviderPolicyTest {
ToscaPolicy createdPolicy =
createdServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get(policyKey.getName());
assertEquals(0, beforePolicy.compareNameVersion(beforePolicy, createdPolicy));
- assertTrue(beforePolicy.getType().equals(createdPolicy.getType()));
+ assertEquals(beforePolicy.getType(), createdPolicy.getType());
ToscaServiceTemplate gotServiceTemplate =
new AuthorativeToscaProvider().getPolicies(pfDao, policyKey.getName(), policyKey.getVersion());
@@ -137,7 +137,7 @@ public class AuthorativeToscaProviderPolicyTest {
ToscaPolicy gotPolicy =
gotServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get(policyKey.getName());
assertEquals(0, beforePolicy.compareNameVersion(beforePolicy, gotPolicy));
- assertTrue(beforePolicy.getType().equals(gotPolicy.getType()));
+ assertEquals(beforePolicy.getType(), gotPolicy.getType());
List<ToscaPolicy> gotPolicyList = new AuthorativeToscaProvider().getPolicyList(pfDao, POLICY1, VERSION_100);
assertEquals(1, gotPolicyList.size());
@@ -200,7 +200,7 @@ public class AuthorativeToscaProviderPolicyTest {
ToscaPolicy createdPolicy =
createdServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get(policyKey.getName());
assertEquals(0, beforePolicy.compareNameVersion(beforePolicy, createdPolicy));
- assertTrue(beforePolicy.getType().equals(createdPolicy.getType()));
+ assertEquals(beforePolicy.getType(), createdPolicy.getType());
ToscaServiceTemplate gotServiceTemplate =
new AuthorativeToscaProvider().getFilteredPolicies(pfDao, ToscaPolicyFilter.builder().build());
@@ -208,21 +208,21 @@ public class AuthorativeToscaProviderPolicyTest {
ToscaPolicy gotPolicy =
gotServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get(policyKey.getName());
assertEquals(0, beforePolicy.compareNameVersion(beforePolicy, gotPolicy));
- assertTrue(beforePolicy.getType().equals(gotPolicy.getType()));
+ assertEquals(beforePolicy.getType(), gotPolicy.getType());
gotServiceTemplate = new AuthorativeToscaProvider().getFilteredPolicies(pfDao,
ToscaPolicyFilter.builder().name(policyKey.getName()).build());
gotPolicy = gotServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get(policyKey.getName());
assertEquals(0, beforePolicy.compareNameVersion(beforePolicy, gotPolicy));
- assertTrue(beforePolicy.getType().equals(gotPolicy.getType()));
+ assertEquals(beforePolicy.getType(), gotPolicy.getType());
gotServiceTemplate = new AuthorativeToscaProvider().getFilteredPolicies(pfDao,
ToscaPolicyFilter.builder().name(policyKey.getName()).version(VERSION_100).build());
gotPolicy = gotServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get(policyKey.getName());
assertEquals(0, beforePolicy.compareNameVersion(beforePolicy, gotPolicy));
- assertTrue(beforePolicy.getType().equals(gotPolicy.getType()));
+ assertEquals(beforePolicy.getType(), gotPolicy.getType());
List<ToscaPolicy> gotPolicyList = new AuthorativeToscaProvider().getPolicyList(pfDao, POLICY1, VERSION_100);
assertEquals(1, gotPolicyList.size());
@@ -274,7 +274,7 @@ public class AuthorativeToscaProviderPolicyTest {
ToscaPolicy createdPolicy =
createdServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get(policyKey.getName());
assertEquals(0, beforePolicy.compareNameVersion(beforePolicy, createdPolicy));
- assertTrue(beforePolicy.getType().equals(createdPolicy.getType()));
+ assertEquals(beforePolicy.getType(), createdPolicy.getType());
}
@Test
@@ -311,7 +311,7 @@ public class AuthorativeToscaProviderPolicyTest {
ToscaPolicy createdPolicy =
createdServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get(policyKey.getName());
assertEquals(0, beforePolicy.compareNameVersion(beforePolicy, createdPolicy));
- assertTrue(beforePolicy.getType().equals(createdPolicy.getType()));
+ assertEquals(beforePolicy.getType(), createdPolicy.getType());
ToscaServiceTemplate updatedServiceTemplate =
new AuthorativeToscaProvider().updatePolicies(pfDao, toscaServiceTemplate);
@@ -319,7 +319,7 @@ public class AuthorativeToscaProviderPolicyTest {
ToscaPolicy updatedPolicy =
updatedServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get(policyKey.getName());
assertEquals(0, beforePolicy.compareNameVersion(beforePolicy, updatedPolicy));
- assertTrue(beforePolicy.getType().equals(updatedPolicy.getType()));
+ assertEquals(beforePolicy.getType(), updatedPolicy.getType());
}
@Test
@@ -368,7 +368,7 @@ public class AuthorativeToscaProviderPolicyTest {
ToscaPolicy createdPolicy =
createdServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get(policyKey.getName());
assertEquals(0, beforePolicy.compareNameVersion(beforePolicy, createdPolicy));
- assertTrue(beforePolicy.getType().equals(createdPolicy.getType()));
+ assertEquals(beforePolicy.getType(), createdPolicy.getType());
ToscaServiceTemplate deletedServiceTemplate =
new AuthorativeToscaProvider().deletePolicy(pfDao, policyKey.getName(), policyKey.getVersion());
@@ -376,7 +376,7 @@ public class AuthorativeToscaProviderPolicyTest {
ToscaPolicy deletedPolicy =
deletedServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get(policyKey.getName());
assertEquals(0, beforePolicy.compareNameVersion(beforePolicy, createdPolicy));
- assertTrue(beforePolicy.getType().equals(deletedPolicy.getType()));
+ assertEquals(beforePolicy.getType(), deletedPolicy.getType());
// @formatter:off
assertThatThrownBy(
@@ -438,7 +438,7 @@ public class AuthorativeToscaProviderPolicyTest {
ToscaPolicy createdPolicy =
createdServiceTemplate.getToscaTopologyTemplate().getPolicies().get(0).get(policyKey.getName());
assertEquals(0, beforePolicy.compareNameVersion(beforePolicy, createdPolicy));
- assertTrue(beforePolicy.getType().equals(createdPolicy.getType()));
+ assertEquals(beforePolicy.getType(), createdPolicy.getType());
assertEquals(1, toscaServiceTemplate.getToscaTopologyTemplate().getPoliciesAsMap().size());
assertEquals(1, createdServiceTemplate.getToscaTopologyTemplate().getPoliciesAsMap().size());
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/ToscaServiceTemplateMappingTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/ToscaServiceTemplateMappingTest.java
index cd35f710a..5258053e9 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/ToscaServiceTemplateMappingTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/authorative/provider/ToscaServiceTemplateMappingTest.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP Policy Model
* ================================================================================
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2019-2020 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -97,6 +97,6 @@ public class ToscaServiceTemplateMappingTest {
JpaToscaServiceTemplate internalPolicyTypes2 = new JpaToscaServiceTemplate();
internalPolicyTypes2.fromAuthorative(plainPolicyTypes2);
assertTrue(internalPolicyTypes2.validate(new PfValidationResult()).isValid());
- assertTrue(internalPolicyTypes.compareTo(internalPolicyTypes2) == 0);
+ assertEquals(0, internalPolicyTypes.compareTo(internalPolicyTypes2));
}
}
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypeTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypeTest.java
index c2f372f80..e00e48f21 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypeTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaDataTypeTest.java
@@ -24,6 +24,7 @@ package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -88,16 +89,16 @@ public class JpaToscaDataTypeTest {
assertEquals(-1, tdt.compareTo(null));
assertEquals(0, tdt.compareTo(tdt));
- assertFalse(tdt.compareTo(tdt.getKey()) == 0);
+ assertNotEquals(0, tdt.compareTo(tdt.getKey()));
PfConceptKey otherDtKey = new PfConceptKey("otherDt", VERSION_001);
JpaToscaDataType otherDt = new JpaToscaDataType(otherDtKey);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setKey(dtKey);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setConstraints(constraints);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setProperties(properties);
assertEquals(0, tdt.compareTo(otherDt));
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntrySchemaTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntrySchemaTest.java
index d897344e5..83d6aad97 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntrySchemaTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEntrySchemaTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -24,6 +24,7 @@ package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -78,11 +79,11 @@ public class JpaToscaEntrySchemaTest {
JpaToscaEntrySchema otherEs = new JpaToscaEntrySchema(typeKey);
- assertFalse(tes.compareTo(otherEs) == 0);
+ assertNotEquals(0, tes.compareTo(otherEs));
otherEs.setType(typeKey);
- assertFalse(tes.compareTo(otherEs) == 0);
+ assertNotEquals(0, tes.compareTo(otherEs));
otherEs.setDescription(A_DESCRIPTION);
- assertFalse(tes.compareTo(otherEs) == 0);
+ assertNotEquals(0, tes.compareTo(otherEs));
otherEs.setConstraints(constraints);
assertEquals(0, tes.compareTo(otherEs));
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilterTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilterTest.java
index 498a768ff..f07a18223 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilterTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaEventFilterTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -24,6 +24,7 @@ package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -84,18 +85,18 @@ public class JpaToscaEventFilterTest {
assertEquals(-1, tef.compareTo(null));
assertEquals(0, tef.compareTo(tef));
- assertFalse(tef.compareTo(tef.getKey()) == 0);
+ assertNotEquals(0, tef.compareTo(tef.getKey()));
PfReferenceKey otherDtKey = new PfReferenceKey("otherDt", VERSION_001, "OtherEventFilter");
JpaToscaEventFilter otherDt = new JpaToscaEventFilter(otherDtKey);
- assertFalse(tef.compareTo(otherDt) == 0);
+ assertNotEquals(0, tef.compareTo(otherDt));
otherDt.setKey(efKey);
- assertFalse(tef.compareTo(otherDt) == 0);
+ assertNotEquals(0, tef.compareTo(otherDt));
otherDt.setNode(nodeKey);
- assertFalse(tef.compareTo(otherDt) == 0);
+ assertNotEquals(0, tef.compareTo(otherDt));
otherDt.setRequirement(A_REQUREMENT);
- assertFalse(tef.compareTo(otherDt) == 0);
+ assertNotEquals(0, tef.compareTo(otherDt));
otherDt.setCapability(A_CAPABILITY);
assertEquals(0, tef.compareTo(otherDt));
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModelTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModelTest.java
index 51a5d3c7a..61118c4b6 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModelTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaModelTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -24,6 +24,7 @@ package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -80,14 +81,14 @@ public class JpaToscaModelTest {
assertEquals(-1, tm.compareTo(null));
assertEquals(0, tm.compareTo(tm));
- assertFalse(tm.compareTo(tm.getKey()) == 0);
+ assertNotEquals(0, tm.compareTo(tm.getKey()));
PfConceptKey otherDtKey = new PfConceptKey("otherDt", VERSION_001);
JpaToscaModel otherDt = new JpaToscaModel(otherDtKey);
- assertFalse(tm.compareTo(otherDt) == 0);
+ assertNotEquals(0, tm.compareTo(otherDt));
otherDt.setKey(tmKey);
- assertFalse(tm.compareTo(otherDt) == 0);
+ assertNotEquals(0, tm.compareTo(otherDt));
otherDt.setServiceTemplates(tsts);
assertEquals(0, tm.compareTo(otherDt));
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTest.java
index c4cb61cc8..14a0b6a96 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -24,6 +24,7 @@ package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -105,18 +106,18 @@ public class JpaToscaPolicyTest {
assertEquals(-1, tp.compareTo(null));
assertEquals(0, tp.compareTo(tp));
- assertFalse(tp.compareTo(tp.getKey()) == 0);
+ assertNotEquals(0, tp.compareTo(tp.getKey()));
PfConceptKey otherDtKey = new PfConceptKey("otherDt", VERSION_001);
JpaToscaPolicy otherDt = new JpaToscaPolicy(otherDtKey);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setKey(tpKey);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setType(ptKey);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setProperties(propertyMap);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setTargets(targets);
assertEquals(0, tp.compareTo(otherDt));
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypeTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypeTest.java
index 34cc504b8..5a18902d0 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypeTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPolicyTypeTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -24,6 +24,7 @@ package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -103,24 +104,24 @@ public class JpaToscaPolicyTypeTest {
assertEquals(-1, tpt.compareTo(null));
assertEquals(0, tpt.compareTo(tpt));
- assertFalse(tpt.compareTo(tpt.getKey()) == 0);
+ assertNotEquals(0, tpt.compareTo(tpt.getKey()));
PfConceptKey otherDtKey = new PfConceptKey("otherDt", VERSION_001);
JpaToscaPolicyType otherDt = new JpaToscaPolicyType(otherDtKey);
- assertFalse(tpt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tpt.compareTo(otherDt));
otherDt.setKey(ptKey);
- assertFalse(tpt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tpt.compareTo(otherDt));
otherDt.setDerivedFrom(derivedFromKey);
- assertFalse(tpt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tpt.compareTo(otherDt));
otherDt.setMetadata(metadata);
- assertFalse(tpt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tpt.compareTo(otherDt));
otherDt.setDescription(A_DESCRIPTION);
- assertFalse(tpt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tpt.compareTo(otherDt));
otherDt.setProperties(properties);
- assertFalse(tpt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tpt.compareTo(otherDt));
otherDt.setTargets(targets);
- assertFalse(tpt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tpt.compareTo(otherDt));
otherDt.setTriggers(triggers);
assertEquals(0, tpt.compareTo(otherDt));
@@ -181,7 +182,7 @@ public class JpaToscaPolicyTypeTest {
JpaToscaEntityType<ToscaPolicy> tet = new JpaToscaEntityType<>(tpt.getKey());
assertEquals(-1, tet.compareTo(null));
assertEquals(0, tet.compareTo(tet));
- assertFalse(tet.compareTo(tet.getKey()) == 0);
+ assertNotEquals(0, tet.compareTo(tet.getKey()));
assertNotNull(new JpaToscaPolicyType(new ToscaPolicyType()));
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPropertyTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPropertyTest.java
index f06d4ffcb..ac2f6030f 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPropertyTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaPropertyTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -24,7 +24,9 @@ package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
@@ -102,7 +104,7 @@ public class JpaToscaPropertyTest {
assertEquals(tp, tdtClone0);
assertEquals(0, tp.compareTo(tdtClone0));
- assertTrue(tdtClone0.getMetadata() != tp.getMetadata());
+ assertNotSame(tdtClone0.getMetadata(), tp.getMetadata());
JpaToscaProperty tdtClone1 = new JpaToscaProperty(tp);
assertEquals(tp, tdtClone1);
@@ -110,37 +112,37 @@ public class JpaToscaPropertyTest {
assertEquals(-1, tp.compareTo(null));
assertEquals(0, tp.compareTo(tp));
- assertFalse(tp.compareTo(tp.getKey()) == 0);
+ assertNotEquals(0, tp.compareTo(tp.getKey()));
PfReferenceKey otherDtKey = new PfReferenceKey("otherDt", VERSION_001, "OtherProperty");
JpaToscaProperty otherDt = new JpaToscaProperty(otherDtKey);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setKey(pkey);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setType(ptypeKey);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setDescription(A_DESCRIPTION);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setRequired(false);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setDefaultValue(DEFAULT_KEY);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setStatus(ToscaProperty.Status.SUPPORTED);
- assertFalse(tp.compareTo(otherDt) == 0);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setConstraints(constraints);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setEntrySchema(tes);
assertEquals(0, tp.compareTo(otherDt));
otherDt.setRequired(true);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setRequired(false);
assertEquals(0, tp.compareTo(otherDt));
otherDt.setStatus(ToscaProperty.Status.UNSUPPORTED);
- assertFalse(tp.compareTo(otherDt) == 0);
+ assertNotEquals(0, tp.compareTo(otherDt));
otherDt.setStatus(ToscaProperty.Status.SUPPORTED);
assertEquals(0, tp.compareTo(otherDt));
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplateTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplateTest.java
index c7a87e5fd..65d832b98 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplateTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaServiceTemplateTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -25,6 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -100,20 +101,20 @@ public class JpaToscaServiceTemplateTest {
assertEquals(-1, tst.compareTo(null));
assertEquals(0, tst.compareTo(tst));
- assertFalse(tst.compareTo(tst.getKey()) == 0);
+ assertNotEquals(0, tst.compareTo(tst.getKey()));
PfConceptKey otherDtKey = new PfConceptKey("otherDt", VERSION_001);
JpaToscaServiceTemplate otherDt = new JpaToscaServiceTemplate(otherDtKey);
- assertFalse(tst.compareTo(otherDt) == 0);
+ assertNotEquals(0, tst.compareTo(otherDt));
otherDt.setKey(tstKey);
- assertFalse(tst.compareTo(otherDt) == 0);
+ assertNotEquals(0, tst.compareTo(otherDt));
otherDt.setToscaDefinitionsVersion("Tosca Version");
- assertFalse(tst.compareTo(otherDt) == 0);
+ assertNotEquals(0, tst.compareTo(otherDt));
otherDt.setDataTypes(dataTypes);
- assertFalse(tst.compareTo(otherDt) == 0);
+ assertNotEquals(0, tst.compareTo(otherDt));
otherDt.setPolicyTypes(policyTypes);
- assertFalse(tst.compareTo(otherDt) == 0);
+ assertNotEquals(0, tst.compareTo(otherDt));
otherDt.setTopologyTemplate(ttt);
assertEquals(0, tst.compareTo(otherDt));
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTimeIntervalTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTimeIntervalTest.java
index 10e9388cb..ef9039af9 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTimeIntervalTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTimeIntervalTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -24,6 +24,7 @@ package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -88,16 +89,16 @@ public class JpaToscaTimeIntervalTest {
assertEquals(-1, tti.compareTo(null));
assertEquals(0, tti.compareTo(tti));
- assertFalse(tti.compareTo(tti.getKey()) == 0);
+ assertNotEquals(0, tti.compareTo(tti.getKey()));
PfReferenceKey otherDtKey = new PfReferenceKey("otherDt", "0.0.1", "OtherTimeInterval");
JpaToscaTimeInterval otherDt = new JpaToscaTimeInterval(otherDtKey);
- assertFalse(tti.compareTo(otherDt) == 0);
+ assertNotEquals(0, tti.compareTo(otherDt));
otherDt.setKey(ttiKey);
- assertFalse(tti.compareTo(otherDt) == 0);
+ assertNotEquals(0, tti.compareTo(otherDt));
otherDt.setStartTime(startTime);
- assertFalse(tti.compareTo(otherDt) == 0);
+ assertNotEquals(0, tti.compareTo(otherDt));
otherDt.setEndTime(endTime);
assertEquals(0, tti.compareTo(otherDt));
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTopologyTemplateTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTopologyTemplateTest.java
index b9d4ad487..d42dfb09d 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTopologyTemplateTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTopologyTemplateTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -24,6 +24,7 @@ package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -84,16 +85,16 @@ public class JpaToscaTopologyTemplateTest {
assertEquals(-1, ttt.compareTo(null));
assertEquals(0, ttt.compareTo(ttt));
- assertFalse(ttt.compareTo(ttt.getKey()) == 0);
+ assertNotEquals(0, ttt.compareTo(ttt.getKey()));
PfReferenceKey otherDtKey = new PfReferenceKey("otherSt", VERSION_001, "otherDt");
JpaToscaTopologyTemplate otherDt = new JpaToscaTopologyTemplate(otherDtKey);
- assertFalse(ttt.compareTo(otherDt) == 0);
+ assertNotEquals(0, ttt.compareTo(otherDt));
otherDt.setKey(tttKey);
- assertFalse(ttt.compareTo(otherDt) == 0);
+ assertNotEquals(0, ttt.compareTo(otherDt));
otherDt.setDescription(A_DESCRIPTION);
- assertFalse(ttt.compareTo(otherDt) == 0);
+ assertNotEquals(0, ttt.compareTo(otherDt));
otherDt.setPolicies(policies);
assertEquals(0, ttt.compareTo(otherDt));
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTriggerTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTriggerTest.java
index 62f96940b..3b196c478 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTriggerTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/concepts/JpaToscaTriggerTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019-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.
@@ -24,6 +24,7 @@ package org.onap.policy.models.tosca.simple.concepts;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -113,35 +114,35 @@ public class JpaToscaTriggerTest {
assertEquals(-1, tdt.compareTo(null));
assertEquals(0, tdt.compareTo(tdt));
- assertFalse(tdt.compareTo(tdt.getKey()) == 0);
+ assertNotEquals(0, tdt.compareTo(tdt.getKey()));
PfReferenceKey otherDtKey = new PfReferenceKey("otherDt", VERSION_001, "OtherTrigger");
JpaToscaTrigger otherDt = new JpaToscaTrigger(otherDtKey);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setKey(tkey);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setDescription(A_DESCRIPTION);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setEventType(EVENT_TYPE);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setSchedule(schedule);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setTargetFilter(targetFilter);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setCondition(lsc);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setConstraint(lsc);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setPeriod(Duration.ZERO);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setMethod(A_METHOD);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setAction(ACTION);
assertEquals(0, tdt.compareTo(otherDt));
otherDt.setEvaluations(100);
- assertFalse(tdt.compareTo(otherDt) == 0);
+ assertNotEquals(0, tdt.compareTo(otherDt));
otherDt.setEvaluations(0);
assertEquals(0, tdt.compareTo(otherDt));
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicySerializationTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicySerializationTest.java
index a4b3de36c..87a52242f 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicySerializationTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicySerializationTest.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019-2020 Nordix Foundation.
- * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2019-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.
@@ -109,7 +109,7 @@ public class MonitoringPolicySerializationTest {
ToscaServiceTemplateUtils.addFragment(policyTypeServiceTemplate, serviceTemplateFromJson);
verifyVcpeMonitoringInputDeserialization(mergedServiceTemplate);
JpaToscaServiceTemplate serviceTemplateFromYaml = deserializeMonitoringInputYaml(VCPE_MON_INPUT_YAML);
- assertTrue(serviceTemplateFromJson.compareTo(serviceTemplateFromYaml) == 0);
+ assertEquals(0, serviceTemplateFromJson.compareTo(serviceTemplateFromYaml));
// vDNS
serviceTemplateFromJson = deserializeMonitoringInputJson(VDNS_MON_INPUT_JSON);
@@ -117,7 +117,7 @@ public class MonitoringPolicySerializationTest {
ToscaServiceTemplateUtils.addFragment(policyTypeServiceTemplate, serviceTemplateFromJson);
verifyVdnsMonitoringInputDeserialization(mergedServiceTemplate);
serviceTemplateFromYaml = deserializeMonitoringInputYaml(VDNS_MON_INPUT_YAML);
- assertTrue(serviceTemplateFromJson.compareTo(serviceTemplateFromYaml) == 0);
+ assertEquals(0, serviceTemplateFromJson.compareTo(serviceTemplateFromYaml));
// vFirewall
serviceTemplateFromJson = deserializeMonitoringInputJson(VFW_MON_INPUT_JSON);
@@ -125,7 +125,7 @@ public class MonitoringPolicySerializationTest {
ToscaServiceTemplateUtils.addFragment(policyTypeServiceTemplate, serviceTemplateFromJson);
verifyVfwMonitoringInputDeserialization(mergedServiceTemplate);
serviceTemplateFromYaml = deserializeMonitoringInputYaml(VFW_MON_INPUT_YAML);
- assertTrue(serviceTemplateFromJson.compareTo(serviceTemplateFromYaml) == 0);
+ assertEquals(0, serviceTemplateFromJson.compareTo(serviceTemplateFromYaml));
}
@Test
@@ -189,7 +189,7 @@ public class MonitoringPolicySerializationTest {
serviceTemplate.getTopologyTemplate().getPolicies().getConceptMap();
// Check policies
- assertTrue(policiesConceptMap.size() == 1);
+ assertEquals(1, policiesConceptMap.size());
assertEquals(POLICY1, policiesConceptMap.keySet().iterator().next().getName());
assertEquals("onap.restart.tca:1.0.0",
serviceTemplate.getTopologyTemplate().getPolicies().get(POLICY1).getId());
@@ -197,12 +197,12 @@ public class MonitoringPolicySerializationTest {
JpaToscaPolicy policyVal = policiesConceptMap.values().iterator().next();
// Check metadata
- assertTrue(policyVal.getMetadata().size() == 2);
+ assertEquals(2, policyVal.getMetadata().size());
assertEquals(POLICY_ID, policyVal.getMetadata().entrySet().iterator().next().getKey());
assertEquals(POLICY1, policyVal.getMetadata().entrySet().iterator().next().getValue());
// Check properties
- assertTrue(policiesConceptMap.values().iterator().next().getProperties().size() == 1);
+ assertEquals(1, policiesConceptMap.values().iterator().next().getProperties().size());
assertEquals(TCA_POLICY, policyVal.getProperties().keySet().iterator().next());
assertNotNull(policyVal.getProperties().values().iterator().next());
}
@@ -221,7 +221,7 @@ public class MonitoringPolicySerializationTest {
serviceTemplate.getTopologyTemplate().getPolicies().getConceptMap();
// Check policies
- assertTrue(policiesConceptMap.size() == 1);
+ assertEquals(1, policiesConceptMap.size());
assertEquals(POLICY2, policiesConceptMap.keySet().iterator().next().getName());
assertEquals("onap.scaleout.tca:1.0.0",
serviceTemplate.getTopologyTemplate().getPolicies().get(POLICY2).getId());
@@ -229,12 +229,12 @@ public class MonitoringPolicySerializationTest {
JpaToscaPolicy policyVal = policiesConceptMap.values().iterator().next();
// Check metadata
- assertTrue(policyVal.getMetadata().size() == 2);
+ assertEquals(2, policyVal.getMetadata().size());
assertEquals(POLICY_ID, policyVal.getMetadata().entrySet().iterator().next().getKey());
assertEquals(POLICY2, policyVal.getMetadata().entrySet().iterator().next().getValue());
// Check properties
- assertTrue(policiesConceptMap.values().iterator().next().getProperties().size() == 1);
+ assertEquals(1, policiesConceptMap.values().iterator().next().getProperties().size());
assertEquals(TCA_POLICY, policyVal.getProperties().keySet().iterator().next());
assertNotNull(policyVal.getProperties().values().iterator().next());
}
@@ -253,7 +253,7 @@ public class MonitoringPolicySerializationTest {
serviceTemplate.getTopologyTemplate().getPolicies().getConceptMap();
// Check policies
- assertTrue(policiesConceptMap.size() == 1);
+ assertEquals(1, policiesConceptMap.size());
assertEquals(POLICY3, policiesConceptMap.keySet().iterator().next().getName());
assertEquals("onap.vfirewall.tca:1.0.0",
serviceTemplate.getTopologyTemplate().getPolicies().get(POLICY3).getId());
@@ -261,12 +261,12 @@ public class MonitoringPolicySerializationTest {
JpaToscaPolicy policyVal = policiesConceptMap.values().iterator().next();
// Check metadata
- assertTrue(policyVal.getMetadata().size() == 2);
+ assertEquals(2, policyVal.getMetadata().size());
assertEquals(POLICY_ID, policyVal.getMetadata().entrySet().iterator().next().getKey());
assertEquals(POLICY3, policyVal.getMetadata().entrySet().iterator().next().getValue());
// Check properties
- assertTrue(policiesConceptMap.values().iterator().next().getProperties().size() == 1);
+ assertEquals(1, policiesConceptMap.values().iterator().next().getProperties().size());
assertEquals(TCA_POLICY, policyVal.getProperties().keySet().iterator().next());
assertNotNull(policyVal.getProperties().values().iterator().next());
}
@@ -277,7 +277,7 @@ public class MonitoringPolicySerializationTest {
assertEquals(YAML_VERSION, serviceTemplateJsonObject.get(DEFINITION_VERSION).getAsString());
JsonObject topologyTemplateJsonObject = serviceTemplateJsonObject.get(TOPOLOGY_TEMPLATE).getAsJsonObject();
JsonArray policiesJsonArray = topologyTemplateJsonObject.get(POLICIES).getAsJsonArray();
- assertTrue(policiesJsonArray.size() == 1);
+ assertEquals(1, policiesJsonArray.size());
JsonObject policy = policiesJsonArray.iterator().next().getAsJsonObject();
assertNotNull(policy.get(POLICY1));
JsonObject policyVal = policy.get(POLICY1).getAsJsonObject();
@@ -294,7 +294,7 @@ public class MonitoringPolicySerializationTest {
assertEquals(YAML_VERSION, serviceTemplateJsonObject.get(DEFINITION_VERSION).getAsString());
JsonObject topologyTemplateJsonObject = serviceTemplateJsonObject.get(TOPOLOGY_TEMPLATE).getAsJsonObject();
JsonArray policiesJsonArray = topologyTemplateJsonObject.get(POLICIES).getAsJsonArray();
- assertTrue(policiesJsonArray.size() == 1);
+ assertEquals(1, policiesJsonArray.size());
JsonObject policy = policiesJsonArray.iterator().next().getAsJsonObject();
assertNotNull(policy.get(POLICY2));
JsonObject policyVal = policy.get(POLICY2).getAsJsonObject();
@@ -311,7 +311,7 @@ public class MonitoringPolicySerializationTest {
assertEquals(YAML_VERSION, serviceTemplateJsonObject.get(DEFINITION_VERSION).getAsString());
JsonObject topologyTemplateJsonObject = serviceTemplateJsonObject.get(TOPOLOGY_TEMPLATE).getAsJsonObject();
JsonArray policiesJsonArray = topologyTemplateJsonObject.get(POLICIES).getAsJsonArray();
- assertTrue(policiesJsonArray.size() == 1);
+ assertEquals(1, policiesJsonArray.size());
JsonObject policy = policiesJsonArray.iterator().next().getAsJsonObject();
assertNotNull(policy.get(POLICY3));
JsonObject policyVal = policy.get(POLICY3).getAsJsonObject();
diff --git a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicyTypeSerializationTest.java b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicyTypeSerializationTest.java
index 14d3a1980..4a8378f21 100644
--- a/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicyTypeSerializationTest.java
+++ b/models-tosca/src/test/java/org/onap/policy/models/tosca/simple/serialization/MonitoringPolicyTypeSerializationTest.java
@@ -148,7 +148,7 @@ public class MonitoringPolicyTypeSerializationTest {
// Check policy_types
Map<PfConceptKey, JpaToscaPolicyType> policyTypesConceptMap = serviceTemplate.getPolicyTypes().getConceptMap();
- assertTrue(policyTypesConceptMap.size() == 2);
+ assertEquals(2, policyTypesConceptMap.size());
Iterator<Entry<PfConceptKey, JpaToscaPolicyType>> policyTypesIter = policyTypesConceptMap.entrySet().iterator();
Entry<PfConceptKey, JpaToscaPolicyType> firstPolicyType = policyTypesIter.next();
@@ -162,7 +162,7 @@ public class MonitoringPolicyTypeSerializationTest {
assertEquals("onap.policies.monitoring.tcagen2", secondPolicyType.getKey().getName());
assertEquals(VERSION_100, secondPolicyType.getKey().getVersion());
assertEquals(MONITORING, secondPolicyType.getValue().getDerivedFrom().getName());
- assertTrue(secondPolicyType.getValue().getProperties().size() == 1);
+ assertEquals(1, secondPolicyType.getValue().getProperties().size());
JpaToscaProperty property = secondPolicyType.getValue().getProperties().values().iterator().next();
assertEquals("onap.policies.monitoring.tcagen2", property.getKey().getParentKeyName());
@@ -173,7 +173,7 @@ public class MonitoringPolicyTypeSerializationTest {
// Check data_types
Map<PfConceptKey, JpaToscaDataType> dataTypesConceptMap = serviceTemplate.getDataTypes().getConceptMap();
- assertTrue(dataTypesConceptMap.size() == 3);
+ assertEquals(3, dataTypesConceptMap.size());
Iterator<Entry<PfConceptKey, JpaToscaDataType>> dataTypesIter = dataTypesConceptMap.entrySet().iterator();
Entry<PfConceptKey, JpaToscaDataType> firstDataType = dataTypesIter.next();
@@ -181,7 +181,7 @@ public class MonitoringPolicyTypeSerializationTest {
JpaToscaDataType firstDataTypeVal = firstDataType.getValue();
assertEquals(DATATYPE_ROOT, firstDataTypeVal.getDerivedFrom().getName());
assertEquals(VERSION_000, firstDataTypeVal.getDerivedFrom().getVersion());
- assertTrue(firstDataTypeVal.getProperties().size() == 6);
+ assertEquals(6, firstDataTypeVal.getProperties().size());
Iterator<JpaToscaProperty> firstDataTypePropertiesIter = firstDataTypeVal.getProperties().values().iterator();
JpaToscaProperty firstDataTypeFirstProperty = firstDataTypePropertiesIter.next();
@@ -191,7 +191,7 @@ public class MonitoringPolicyTypeSerializationTest {
assertTrue(firstDataTypeFirstProperty.isRequired());
assertEquals("Specifies Control Loop Schema Type for the event Name e.g. VNF, VM",
firstDataTypeFirstProperty.getDescription());
- assertTrue(firstDataTypeFirstProperty.getConstraints().size() == 1);
+ assertEquals(1, firstDataTypeFirstProperty.getConstraints().size());
assertEquals("org.onap.policy.models.tosca.simple.concepts.JpaToscaConstraintValidValues",
firstDataTypeFirstProperty.getConstraints().iterator().next().getClass().getName());
assertEquals(2,
@@ -240,7 +240,7 @@ public class MonitoringPolicyTypeSerializationTest {
JpaToscaDataType secondDataTypeVal = secondDataType.getValue();
assertEquals(DATATYPE_ROOT, secondDataTypeVal.getDerivedFrom().getName());
assertEquals(VERSION_000, secondDataTypeVal.getDerivedFrom().getVersion());
- assertTrue(secondDataTypeVal.getProperties().size() == 2);
+ assertEquals(2, secondDataTypeVal.getProperties().size());
Iterator<JpaToscaProperty> secondDataTypePropertiesIter = secondDataTypeVal.getProperties().values().iterator();
JpaToscaProperty secondDataTypeFirstProperty = secondDataTypePropertiesIter.next();
@@ -250,7 +250,7 @@ public class MonitoringPolicyTypeSerializationTest {
assertTrue(secondDataTypeFirstProperty.isRequired());
assertEquals("Domain name to which TCA needs to be applied", secondDataTypeFirstProperty.getDescription());
assertEquals("measurementsForVfScaling", secondDataTypeFirstProperty.getDefaultValue());
- assertTrue(secondDataTypeFirstProperty.getConstraints().size() == 1);
+ assertEquals(1, secondDataTypeFirstProperty.getConstraints().size());
assertTrue(secondDataTypeFirstProperty.getConstraints().iterator().next() instanceof JpaToscaConstraintLogical);
assertEquals("measurementsForVfScaling",
((JpaToscaConstraintLogical) (secondDataTypeFirstProperty.getConstraints().iterator().next()))
@@ -271,7 +271,7 @@ public class MonitoringPolicyTypeSerializationTest {
JpaToscaDataType thirdDataTypeVal = thirdDataType.getValue();
assertEquals(DATATYPE_ROOT, thirdDataTypeVal.getDerivedFrom().getName());
assertEquals(VERSION_000, thirdDataTypeVal.getDerivedFrom().getVersion());
- assertTrue(thirdDataTypeVal.getProperties().size() == 7);
+ assertEquals(7, thirdDataTypeVal.getProperties().size());
Iterator<JpaToscaProperty> thirdDataTypePropertiesIter = thirdDataTypeVal.getProperties().values().iterator();
JpaToscaProperty thirdDataTypeFirstProperty = thirdDataTypePropertiesIter.next();
@@ -289,13 +289,14 @@ public class MonitoringPolicyTypeSerializationTest {
assertTrue(thirdDataTypeSecondProperty.isRequired());
assertEquals("Closed Loop Event Status of the threshold", thirdDataTypeSecondProperty.getDescription());
assertNotNull(thirdDataTypeSecondProperty.getConstraints());
- assertTrue(thirdDataTypeSecondProperty.getConstraints().size() == 1);
+ assertEquals(1, thirdDataTypeSecondProperty.getConstraints().size());
assertEquals("JpaToscaConstraintValidValues(validValues=[ONSET, ABATED])",
thirdDataTypeSecondProperty.getConstraints().iterator().next().toString());
assertTrue(thirdDataTypeSecondProperty.getConstraints().iterator()
.next() instanceof JpaToscaConstraintValidValues);
- assertTrue(((JpaToscaConstraintValidValues) (thirdDataTypeSecondProperty.getConstraints().iterator().next()))
- .getValidValues().size() == 2);
+ assertEquals(2,
+ ((JpaToscaConstraintValidValues) (thirdDataTypeSecondProperty.getConstraints().iterator().next()))
+ .getValidValues().size());
JpaToscaProperty thirdDataTypeThirdProperty = thirdDataTypePropertiesIter.next();
assertEquals(THRESHOLDS, thirdDataTypeThirdProperty.getKey().getParentKeyName());
@@ -304,12 +305,13 @@ public class MonitoringPolicyTypeSerializationTest {
assertTrue(thirdDataTypeThirdProperty.isRequired());
assertEquals("Direction of the threshold", thirdDataTypeThirdProperty.getDescription());
assertNotNull(thirdDataTypeThirdProperty.getConstraints());
- assertTrue(thirdDataTypeThirdProperty.getConstraints().size() == 1);
+ assertEquals(1, thirdDataTypeThirdProperty.getConstraints().size());
assertEquals(
"JpaToscaConstraintValidValues(validValues=[LESS, LESS_OR_EQUAL, GREATER, GREATER_OR_EQUAL, EQUAL])",
thirdDataTypeThirdProperty.getConstraints().iterator().next().toString());
- assertTrue(((JpaToscaConstraintValidValues) (thirdDataTypeThirdProperty.getConstraints().iterator().next()))
- .getValidValues().size() == 5);
+ assertEquals(5,
+ ((JpaToscaConstraintValidValues) (thirdDataTypeThirdProperty.getConstraints().iterator().next()))
+ .getValidValues().size());
JpaToscaProperty thirdDataTypeFourthProperty = thirdDataTypePropertiesIter.next();
assertEquals(THRESHOLDS, thirdDataTypeFourthProperty.getKey().getParentKeyName());
@@ -319,9 +321,10 @@ public class MonitoringPolicyTypeSerializationTest {
assertEquals("Json field Path as per CEF message which needs to be analyzed for TCA",
thirdDataTypeFourthProperty.getDescription());
assertNotNull(thirdDataTypeFourthProperty.getConstraints());
- assertTrue(thirdDataTypeFourthProperty.getConstraints().size() == 1);
- assertTrue(((JpaToscaConstraintValidValues) (thirdDataTypeFourthProperty.getConstraints().iterator().next()))
- .getValidValues().size() == 43);
+ assertEquals(1, thirdDataTypeFourthProperty.getConstraints().size());
+ assertEquals(43,
+ ((JpaToscaConstraintValidValues) (thirdDataTypeFourthProperty.getConstraints().iterator().next()))
+ .getValidValues().size());
JpaToscaProperty thirdDataTypeFifthProperty = thirdDataTypePropertiesIter.next();
assertEquals(THRESHOLDS, thirdDataTypeFifthProperty.getKey().getParentKeyName());
@@ -330,11 +333,12 @@ public class MonitoringPolicyTypeSerializationTest {
assertTrue(thirdDataTypeFifthProperty.isRequired());
assertEquals("Threshold Event Severity", thirdDataTypeFifthProperty.getDescription());
assertNotNull(thirdDataTypeFifthProperty.getConstraints());
- assertTrue(thirdDataTypeFifthProperty.getConstraints().size() == 1);
+ assertEquals(1, thirdDataTypeFifthProperty.getConstraints().size());
assertEquals("JpaToscaConstraintValidValues(validValues=[CRITICAL, MAJOR, MINOR, WARNING, NORMAL])",
thirdDataTypeFifthProperty.getConstraints().iterator().next().toString());
- assertTrue(((JpaToscaConstraintValidValues) (thirdDataTypeFifthProperty.getConstraints().iterator().next()))
- .getValidValues().size() == 5);
+ assertEquals(5,
+ ((JpaToscaConstraintValidValues) (thirdDataTypeFifthProperty.getConstraints().iterator().next()))
+ .getValidValues().size());
;
JpaToscaProperty thirdDataTypeSixthProperty = thirdDataTypePropertiesIter.next();
@@ -365,7 +369,7 @@ public class MonitoringPolicyTypeSerializationTest {
// Check policy_types
Map<PfConceptKey, JpaToscaPolicyType> policyTypesConceptMap = serviceTemplate.getPolicyTypes().getConceptMap();
- assertTrue(policyTypesConceptMap.size() == 2);
+ assertEquals(2, policyTypesConceptMap.size());
Iterator<Entry<PfConceptKey, JpaToscaPolicyType>> policyTypesIter = policyTypesConceptMap.entrySet().iterator();
Entry<PfConceptKey, JpaToscaPolicyType> firstPolicyType = policyTypesIter.next();
@@ -379,7 +383,7 @@ public class MonitoringPolicyTypeSerializationTest {
assertEquals(DCAE, secondPolicyType.getKey().getName());
assertEquals(VERSION_100, secondPolicyType.getKey().getVersion());
assertEquals("onap.policies.Monitoring", secondPolicyType.getValue().getDerivedFrom().getName());
- assertTrue(secondPolicyType.getValue().getProperties().size() == 2);
+ assertEquals(2, secondPolicyType.getValue().getProperties().size());
Iterator<JpaToscaProperty> propertiesIter = secondPolicyType.getValue().getProperties().values().iterator();