diff options
Diffstat (limited to 'model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/PolicyModelTest.java')
-rw-r--r-- | model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/PolicyModelTest.java | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/PolicyModelTest.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/PolicyModelTest.java index 820f2d1e6..829f93342 100644 --- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/PolicyModelTest.java +++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/PolicyModelTest.java @@ -1,20 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ @@ -22,10 +22,8 @@ package org.onap.policy.apex.model.policymodel.concepts; 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; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; @@ -44,7 +42,7 @@ import org.onap.policy.apex.model.policymodel.handling.SupportApexPolicyModelCre /** * Test policy models. - * + * * @author Liam Fallon (liam.fallon@ericsson.com) */ public class PolicyModelTest { @@ -79,36 +77,36 @@ public class PolicyModelTest { final AxPolicyModel clonedModel = new AxPolicyModel(model); - assertFalse(model.hashCode() == 0); + assertNotEquals(0, model.hashCode()); - assertTrue(model.equals(model)); - assertTrue(model.equals(clonedModel)); - assertFalse(model.equals((Object) "Hello")); - assertFalse(model.equals(new AxPolicyModel(new AxArtifactKey()))); - assertFalse(model.equals(new AxPolicyModel(AxArtifactKey.getNullKey(), new AxContextSchemas(schemasKey), + assertEquals(model, model); + assertEquals(model, clonedModel); + assertNotEquals(model, (Object) "Hello"); + assertNotEquals(model, new AxPolicyModel(new AxArtifactKey())); + assertNotEquals(model, new AxPolicyModel(AxArtifactKey.getNullKey(), new AxContextSchemas(schemasKey), new AxKeyInformation(keyInfoKey), new AxEvents(eventsKey), new AxContextAlbums(albumsKey), - new AxTasks(tasksKey), new AxPolicies(policiesKey)))); - assertFalse(model.equals(new AxPolicyModel(modelKey, new AxContextSchemas(), new AxKeyInformation(keyInfoKey), + new AxTasks(tasksKey), new AxPolicies(policiesKey))); + assertNotEquals(model, new AxPolicyModel(modelKey, new AxContextSchemas(), new AxKeyInformation(keyInfoKey), new AxEvents(eventsKey), new AxContextAlbums(albumsKey), new AxTasks(tasksKey), - new AxPolicies(policiesKey)))); - assertFalse(model.equals(new AxPolicyModel(modelKey, new AxContextSchemas(schemasKey), new AxKeyInformation(), + new AxPolicies(policiesKey))); + assertNotEquals(model, new AxPolicyModel(modelKey, new AxContextSchemas(schemasKey), new AxKeyInformation(), new AxEvents(eventsKey), new AxContextAlbums(albumsKey), new AxTasks(tasksKey), - new AxPolicies(policiesKey)))); - assertFalse(model.equals(new AxPolicyModel(modelKey, new AxContextSchemas(schemasKey), + new AxPolicies(policiesKey))); + assertNotEquals(model, new AxPolicyModel(modelKey, new AxContextSchemas(schemasKey), new AxKeyInformation(keyInfoKey), new AxEvents(), new AxContextAlbums(albumsKey), - new AxTasks(tasksKey), new AxPolicies(policiesKey)))); - assertFalse(model.equals(new AxPolicyModel(modelKey, new AxContextSchemas(schemasKey), + new AxTasks(tasksKey), new AxPolicies(policiesKey))); + assertNotEquals(model, new AxPolicyModel(modelKey, new AxContextSchemas(schemasKey), new AxKeyInformation(keyInfoKey), new AxEvents(eventsKey), new AxContextAlbums(), - new AxTasks(tasksKey), new AxPolicies(policiesKey)))); - assertFalse(model.equals(new AxPolicyModel(modelKey, new AxContextSchemas(schemasKey), + new AxTasks(tasksKey), new AxPolicies(policiesKey))); + assertNotEquals(model, new AxPolicyModel(modelKey, new AxContextSchemas(schemasKey), new AxKeyInformation(keyInfoKey), new AxEvents(eventsKey), new AxContextAlbums(albumsKey), - new AxTasks(), new AxPolicies(policiesKey)))); - assertFalse(model.equals(new AxPolicyModel(modelKey, new AxContextSchemas(schemasKey), + new AxTasks(), new AxPolicies(policiesKey))); + assertNotEquals(model, new AxPolicyModel(modelKey, new AxContextSchemas(schemasKey), new AxKeyInformation(keyInfoKey), new AxEvents(eventsKey), new AxContextAlbums(albumsKey), - new AxTasks(tasksKey), new AxPolicies()))); - assertTrue(model.equals(new AxPolicyModel(modelKey, new AxContextSchemas(schemasKey), + new AxTasks(tasksKey), new AxPolicies())); + assertEquals(model, new AxPolicyModel(modelKey, new AxContextSchemas(schemasKey), new AxKeyInformation(keyInfoKey), new AxEvents(eventsKey), new AxContextAlbums(albumsKey), - new AxTasks(tasksKey), new AxPolicies(policiesKey)))); + new AxTasks(tasksKey), new AxPolicies(policiesKey))); assertEquals(0, model.compareTo(model)); assertEquals(0, model.compareTo(clonedModel)); |