/*-
* ============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.
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;
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))
/*-
* ============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.
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;
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);
/*-
* ============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.
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));
/*-
* ============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.
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;
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
/*-
* ============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.
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));
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);
/*-
* ============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.
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;
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));
}
@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
* ============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");
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);
}
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;
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));
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));
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));
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));
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;
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);
}
}
* ============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.
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);
/*-
* ============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.
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());
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());
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());
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());
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
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);
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
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());
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(
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());
* ============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");
JpaToscaServiceTemplate internalPolicyTypes2 = new JpaToscaServiceTemplate();
internalPolicyTypes2.fromAuthorative(plainPolicyTypes2);
assertTrue(internalPolicyTypes2.validate(new PfValidationResult()).isValid());
- assertTrue(internalPolicyTypes.compareTo(internalPolicyTypes2) == 0);
+ assertEquals(0, internalPolicyTypes.compareTo(internalPolicyTypes2));
}
}
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;
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));
/*-
* ============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.
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;
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));
/*-
* ============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.
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;
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));
/*-
* ============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.
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;
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));
/*-
* ============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.
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;
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));
/*-
* ============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.
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;
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));
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()));
/*-
* ============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.
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;
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);
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));
/*-
* ============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.
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;
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));
/*-
* ============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.
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;
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));
/*-
* ============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.
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;
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));
/*-
* ============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.
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;
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));
/*-
* ============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.
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);
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);
ToscaServiceTemplateUtils.addFragment(policyTypeServiceTemplate, serviceTemplateFromJson);
verifyVfwMonitoringInputDeserialization(mergedServiceTemplate);
serviceTemplateFromYaml = deserializeMonitoringInputYaml(VFW_MON_INPUT_YAML);
- assertTrue(serviceTemplateFromJson.compareTo(serviceTemplateFromYaml) == 0);
+ assertEquals(0, serviceTemplateFromJson.compareTo(serviceTemplateFromYaml));
}
@Test
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());
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());
}
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());
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());
}
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());
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());
}
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();
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();
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();
// 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();
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());
// 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();
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();
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,
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();
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()))
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();
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());
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());
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());
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();
// 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();
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();