diff options
30 files changed, 1296 insertions, 1643 deletions
diff --git a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/CodeGeneratorCliEditorTest.java b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/CodeGeneratorCliEditorTest.java index 83aef2d07..921591b32 100644 --- a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/CodeGeneratorCliEditorTest.java +++ b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/CodeGeneratorCliEditorTest.java @@ -2,19 +2,20 @@ * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2019 Samsung Electronics Co., Ltd. + * Modifications Copyright (C) 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,11 +23,9 @@ package org.onap.policy.apex.auth.clicodegen; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; @@ -65,32 +64,25 @@ public class CodeGeneratorCliEditorTest { private File outFile = null; @Test - public void test() throws IOException { + public void test() throws IOException, ApexModelException { final CodeGeneratorCliEditor codeGen = new CodeGeneratorCliEditor(); outFile = File.createTempFile("ApexTestGenerated", ".apex"); ApexModelReader<AxPolicyModel> modelReader = null; - try { - modelReader = new ApexModelReader<>(AxPolicyModel.class); - } catch (ApexModelException e1) { - fail("test should not throw an exception"); - } + modelReader = new ApexModelReader<>(AxPolicyModel.class); + modelReader.setValidateFlag(false); AxPolicyModel apexPolicyModel = null; - try { - apexPolicyModel = modelReader + apexPolicyModel = modelReader .read(new FileInputStream(new File("src/test/resources/models/TestPolicyModel.json"))); - } catch (ApexModelException | FileNotFoundException e) { - fail("test should not throw an exception"); - } assertEquals(0, generateCli(codeGen, apexPolicyModel)); } /** * Generate the CLI from the model. - * + * * @param codeGen the code generator * @param policyModel the policy model * @throws IOException on generation exceptions diff --git a/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java b/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java index 51802919c..5aaa8a38a 100644 --- a/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java +++ b/context/context-management/src/test/java/org/onap/policy/apex/context/impl/ContextAlbumImplTest.java @@ -21,10 +21,10 @@ package org.onap.policy.apex.context.impl; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; import java.util.LinkedHashMap; import java.util.Map; @@ -33,14 +33,12 @@ import org.junit.BeforeClass; import org.junit.Test; import org.onap.policy.apex.context.ContextAlbum; import org.onap.policy.apex.context.ContextException; -import org.onap.policy.apex.context.ContextRuntimeException; import org.onap.policy.apex.context.Distributor; import org.onap.policy.apex.context.impl.distribution.jvmlocal.JvmLocalDistributor; import org.onap.policy.apex.context.impl.schema.java.JavaSchemaHelperParameters; import org.onap.policy.apex.context.parameters.ContextParameterConstants; import org.onap.policy.apex.context.parameters.ContextParameters; import org.onap.policy.apex.context.parameters.SchemaParameters; -import org.onap.policy.apex.model.basicmodel.concepts.ApexRuntimeException; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.basicmodel.concepts.AxConcept; import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey; @@ -93,42 +91,19 @@ public class ContextAlbumImplTest { @Test public void testNullsOnConstructor() { - try { - new ContextAlbumImpl(null, null, null); - fail("this test should throw an exception"); - } catch (IllegalArgumentException e) { - assertEquals("Context album definition may not be null", e.getMessage()); - } catch (ContextException e) { - fail("this test should throw an IllegalArgumentException"); - } - - try { - new ContextAlbumImpl(new AxContextAlbum(), null, null); - fail("this test should throw an exception"); - } catch (IllegalArgumentException e) { - assertEquals("Distributor may not be null", e.getMessage()); - } catch (ContextException e) { - fail("this test should throw an IllegalArgumentException"); - } - - try { - new ContextAlbumImpl(new AxContextAlbum(), new JvmLocalDistributor(), null); - fail("this test should throw an exception"); - } catch (IllegalArgumentException e) { - assertEquals("Album map may not be null", e.getMessage()); - } catch (ContextException e) { - fail("this test should throw an IllegalArgumentException"); - } - - try { - new ContextAlbumImpl(new AxContextAlbum(), new JvmLocalDistributor(), new LinkedHashMap<String, Object>()); - fail("this test should throw an exception"); - } catch (ApexRuntimeException e) { - assertEquals("Model for org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas " - + "not found in model service", e.getMessage()); - } catch (ContextException e) { - fail("this test should throw an ApexRuntimeException"); - } + assertThatThrownBy(() -> new ContextAlbumImpl(null, null, null)) + .hasMessage("Context album definition may not be null"); + + assertThatThrownBy(() -> new ContextAlbumImpl(new AxContextAlbum(), null, null)) + .hasMessage("Distributor may not be null"); + + assertThatThrownBy(() -> new ContextAlbumImpl(new AxContextAlbum(), new JvmLocalDistributor(), null)) + .hasMessage("Album map may not be null"); + + assertThatThrownBy(() -> new ContextAlbumImpl(new AxContextAlbum(), new JvmLocalDistributor(), + new LinkedHashMap<String, Object>())) + .hasMessage("Model for org.onap.policy.apex.model.contextmodel.concepts.AxContextSchemas " + + "not found in model service"); } @Test @@ -142,107 +117,63 @@ public class ContextAlbumImplTest { AxContextAlbum axContextAlbum = new AxContextAlbum(new AxArtifactKey("TestContextAlbum", "0.0.1"), "Policy", true, AxArtifactKey.getNullKey()); - try { - new ContextAlbumImpl(axContextAlbum, new JvmLocalDistributor(), new LinkedHashMap<String, Object>()); - fail("this test should throw an exception"); - } catch (ContextException e) { - assertEquals("could not initiate schema management for context album AxContextAlbum", - e.getMessage().substring(0, 69)); - } + assertThatThrownBy(() -> new ContextAlbumImpl(axContextAlbum, new JvmLocalDistributor(), + new LinkedHashMap<String, Object>())) + .hasMessageContaining("could not initiate schema management for context album AxContextAlbum"); axContextAlbum.setItemSchema(simpleStringSchema.getKey()); Distributor distributor = new JvmLocalDistributor(); distributor.init(axContextAlbum.getKey()); ContextAlbum album = new ContextAlbumImpl(axContextAlbum, distributor, new LinkedHashMap<String, Object>()); - AxContextAlbum axContextAlbumRo = new AxContextAlbum(new AxArtifactKey("TestContextAlbum", "0.0.1"), "Policy", - false, simpleStringSchema.getKey()); - ContextAlbum albumRo = new ContextAlbumImpl(axContextAlbumRo, distributor, new LinkedHashMap<String, Object>()); - assertEquals("TestContextAlbum", album.getName()); assertEquals("TestContextAlbum:0.0.1", album.getKey().getId()); assertEquals("TestContextAlbum:0.0.1", album.getAlbumDefinition().getId()); assertEquals("SimpleStringSchema:0.0.1", album.getSchemaHelper().getSchema().getId()); - try { - album.containsKey(null); - fail("test should throw an exception"); - } catch (ContextRuntimeException e) { - assertEquals("null values are illegal on method parameter \"key\"", e.getMessage()); - } + assertThatThrownBy(() -> album.containsKey(null)) + .hasMessage("null values are illegal on method parameter \"key\""); assertEquals(false, album.containsKey("Key0")); - try { - album.containsValue(null); - fail("test should throw an exception"); - } catch (ContextRuntimeException e) { - assertEquals("null values are illegal on method parameter \"value\"", e.getMessage()); - } + assertThatThrownBy(() -> album.containsValue(null)) + .hasMessage("null values are illegal on method parameter \"value\""); assertEquals(false, album.containsValue("some value")); - try { - album.get(null); - fail("test should throw an exception"); - } catch (ContextRuntimeException e) { - assertEquals("album \"TestContextAlbum:0.0.1\" null keys are illegal on keys for get()", e.getMessage()); - } - - try { - album.put(null, null); - fail("test should throw an exception"); - } catch (ContextRuntimeException e) { - assertEquals("album \"TestContextAlbum:0.0.1\" null keys are illegal on keys for put()", e.getMessage()); - } - - try { - album.put("KeyNull", null); - fail("test should throw an exception"); - } catch (ContextRuntimeException e) { - assertEquals("album \"TestContextAlbum:0.0.1\" null values are illegal on key \"KeyNull\" for put()", - e.getMessage()); - } - - try { - albumRo.put("KeyReadOnly", "A value for a Read Only Album"); - fail("test should throw an exception"); - } catch (ContextRuntimeException e) { - assertEquals("album \"TestContextAlbum:0.0.1\" put() not allowed on read only albums " - + "for key=\"KeyReadOnly\", value=\"A value for a Read Only Album", e.getMessage()); - } + assertThatThrownBy(() -> album.get(null)) + .hasMessage("album \"TestContextAlbum:0.0.1\" null keys are illegal on keys for get()"); + + assertThatThrownBy(() -> album.put(null, null)) + .hasMessage("album \"TestContextAlbum:0.0.1\" null keys are illegal on keys for put()"); + + assertThatThrownBy(() -> album.put("KeyNull", null)) + .hasMessage("album \"TestContextAlbum:0.0.1\" null values are illegal on key \"KeyNull\"" + + " for put()"); + + AxContextAlbum axContextAlbumRo = new AxContextAlbum(new AxArtifactKey("TestContextAlbum", "0.0.1"), "Policy", + false, simpleStringSchema.getKey()); + ContextAlbum albumRo = new ContextAlbumImpl(axContextAlbumRo, distributor, new LinkedHashMap<String, Object>()); + + assertThatThrownBy(() -> albumRo.put("KeyReadOnly", "A value for a Read Only Album")) + .hasMessage("album \"TestContextAlbum:0.0.1\" put() not allowed on read only albums " + + "for key=\"KeyReadOnly\", value=\"A value for a Read Only Album"); Map<String, Object> putAllData = new LinkedHashMap<>(); putAllData.put("AllKey0", "vaue of AllKey0"); putAllData.put("AllKey1", "vaue of AllKey1"); putAllData.put("AllKey2", "vaue of AllKey2"); - try { - albumRo.putAll(putAllData); - fail("test should throw an exception"); - } catch (ContextRuntimeException e) { - assertEquals("album \"TestContextAlbum:0.0.1\" putAll() not allowed on read only albums", e.getMessage()); - } - - try { - albumRo.remove("AllKey0"); - fail("test should throw an exception"); - } catch (ContextRuntimeException e) { - assertEquals("album \"TestContextAlbum:0.0.1\" remove() not allowed " - + "on read only albums for key=\"AllKey0\"", e.getMessage()); - } - - try { - album.remove(null); - fail("test should throw an exception"); - } catch (ContextRuntimeException e) { - assertEquals("null values are illegal on method parameter \"keyID\"", e.getMessage()); - } - - try { - albumRo.clear(); - fail("test should throw an exception"); - } catch (ContextRuntimeException e) { - assertEquals("album \"TestContextAlbum:0.0.1\" clear() not allowed on read only albums", e.getMessage()); - } + assertThatThrownBy(() -> albumRo.putAll(putAllData)) + .hasMessage("album \"TestContextAlbum:0.0.1\" putAll() not allowed on read only albums"); + + assertThatThrownBy(() -> albumRo.remove("AllKey0")) + .hasMessage("album \"TestContextAlbum:0.0.1\" remove() not allowed " + + "on read only albums for key=\"AllKey0\""); + + assertThatThrownBy(() -> album.remove(null)) + .hasMessage("null values are illegal on method parameter \"keyID\""); + + assertThatThrownBy(albumRo::clear) + .hasMessage("album \"TestContextAlbum:0.0.1\" clear() not allowed on read only albums"); // The following locking tests pass because the locking protects access to Key0 across all // copies of the distributed album whether the key exists or not @@ -286,13 +217,8 @@ public class ContextAlbumImplTest { // The flush() operation fails because the distributor is not initialized with the album which // is fine for unit test - try { - album.flush(); - fail("test should throw an exception"); - } catch (ContextException e) { - assertEquals("map flush failed, supplied map is null", e.getMessage()); - } - + assertThatThrownBy(album::flush) + .hasMessage("map flush failed, supplied map is null"); assertEquals(1, album.size()); assertEquals(false, album.isEmpty()); @@ -302,14 +228,9 @@ public class ContextAlbumImplTest { album.putAll(putAllData); putAllData.put("AllKey3", null); - try { - album.putAll(putAllData); - fail("test should throw an exception"); - } catch (ContextRuntimeException e) { - assertEquals("album \"TestContextAlbum:0.0.1\" null values are illegal on key \"AllKey3\" for put()", - e.getMessage()); - } - + assertThatThrownBy(() -> album.putAll(putAllData)) + .hasMessage("album \"TestContextAlbum:0.0.1\" null values are illegal on key " + + "\"AllKey3\" for put()"); assertEquals("New value of Key0", album.remove("Key0")); album.clear(); @@ -353,15 +274,13 @@ public class ContextAlbumImplTest { otherAlbum.put("Key", 123); assertNotEquals(album, otherAlbum); - try { - otherAlbum.put("Key", "BadValue"); - fail("test should throw an exception here"); - } catch (ContextRuntimeException cre) { - assertEquals("Failed to set context value for key \"Key\" in album \"TestContextAlbum:0.0.1\": " + assertThatThrownBy(() -> { + ContextAlbumImpl otherAlbumBad = new ContextAlbumImpl(axContextAlbum, distributor, + new LinkedHashMap<String, Object>()); + otherAlbumBad.put("Key", "BadValue"); + }).hasMessage("Failed to set context value for key \"Key\" in album \"TestContextAlbum:0.0.1\": " + "TestContextAlbum:0.0.1: object \"BadValue\" of class \"java.lang.String\" " - + "not compatible with class \"java.lang.Integer\"", cre.getMessage()); - } - + + "not compatible with class \"java.lang.Integer\""); AxContextAlbum otherAxContextAlbum = new AxContextAlbum(new AxArtifactKey("OtherTestContextAlbum", "0.0.1"), "Policy", true, AxArtifactKey.getNullKey()); @@ -369,13 +288,8 @@ public class ContextAlbumImplTest { otherAlbum = new ContextAlbumImpl(otherAxContextAlbum, distributor, new LinkedHashMap<String, Object>()); assertNotEquals(album, otherAlbum); - try { - album.flush(); - fail("test should throw an exception here"); - } catch (ContextException ce) { - assertEquals("map flush failed, supplied map is null", ce.getMessage()); - } - + assertThatThrownBy(album::flush) + .hasMessage("map flush failed, supplied map is null"); AxContextAlbums albums = new AxContextAlbums(); ModelService.registerModel(AxContextAlbums.class, albums); albums.getAlbumsMap().put(axContextAlbum.getKey(), axContextAlbum); diff --git a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineModelTest.java b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineModelTest.java index d0694ec30..6e4fbbf05 100644 --- a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineModelTest.java +++ b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineModelTest.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,7 +22,6 @@ package org.onap.policy.apex.model.enginemodel.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; @@ -112,36 +111,36 @@ public class EngineModelTest { final AxEngineModel clonedModel = new AxEngineModel(model); - assertFalse(model.hashCode() == 0); - - assertTrue(model.equals(model)); - assertTrue(model.equals(clonedModel)); - assertFalse(model.equals((Object) "Hello")); - assertFalse(model.equals(new AxEngineModel(new AxArtifactKey()))); - assertFalse(model.equals(new AxEngineModel(new AxArtifactKey(), new AxContextSchemas(schemasKey), - new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.READY, stats))); - assertFalse(model.equals(new AxEngineModel(modelKey, new AxContextSchemas(), new AxKeyInformation(keyInfoKey), - new AxContextAlbums(albumKey), AxEngineState.READY, stats))); - assertFalse(model.equals(new AxEngineModel(modelKey, new AxContextSchemas(schemasKey), new AxKeyInformation(), - new AxContextAlbums(albumKey), AxEngineState.READY, stats))); - assertFalse(model.equals(new AxEngineModel(modelKey, new AxContextSchemas(schemasKey), - new AxKeyInformation(keyInfoKey), new AxContextAlbums(), AxEngineState.READY, stats))); - assertFalse(model.equals(new AxEngineModel(modelKey, new AxContextSchemas(schemasKey), - new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.STOPPED, stats))); - assertFalse(model.equals(new AxEngineModel(modelKey, new AxContextSchemas(schemasKey), - new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.READY, otherStats))); + assertNotEquals(0, model.hashCode()); + + assertEquals(model, model); + assertEquals(model, clonedModel); + assertNotEquals(model, (Object) "Hello"); + assertNotEquals(model, new AxEngineModel(new AxArtifactKey())); + assertNotEquals(model, new AxEngineModel(new AxArtifactKey(), new AxContextSchemas(schemasKey), + new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.READY, stats)); + assertNotEquals(model, new AxEngineModel(modelKey, new AxContextSchemas(), new AxKeyInformation(keyInfoKey), + new AxContextAlbums(albumKey), AxEngineState.READY, stats)); + assertNotEquals(model, new AxEngineModel(modelKey, new AxContextSchemas(schemasKey), new AxKeyInformation(), + new AxContextAlbums(albumKey), AxEngineState.READY, stats)); + assertNotEquals(model, new AxEngineModel(modelKey, new AxContextSchemas(schemasKey), + new AxKeyInformation(keyInfoKey), new AxContextAlbums(), AxEngineState.READY, stats)); + assertNotEquals(model, new AxEngineModel(modelKey, new AxContextSchemas(schemasKey), + new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.STOPPED, stats)); + assertNotEquals(model, new AxEngineModel(modelKey, new AxContextSchemas(schemasKey), + new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.READY, otherStats)); model.setTimestamp(timestamp); - assertFalse(model.equals(new AxEngineModel(modelKey, new AxContextSchemas(schemasKey), - new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.READY, stats))); + assertNotEquals(model, new AxEngineModel(modelKey, new AxContextSchemas(schemasKey), + new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.READY, stats)); model.setTimestamp(0); - assertTrue(model.equals(new AxEngineModel(modelKey, new AxContextSchemas(schemasKey), - new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.READY, stats))); + assertEquals(model, new AxEngineModel(modelKey, new AxContextSchemas(schemasKey), + new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.READY, stats)); model.setTimestamp(-1); assertEquals(0, model.compareTo(model)); assertEquals(0, model.compareTo(clonedModel)); assertNotEquals(0, model.compareTo(new AxArtifactKey())); - assertFalse(model.equals(new AxEngineModel(new AxArtifactKey()))); + assertNotEquals(model, new AxEngineModel(new AxArtifactKey())); assertNotEquals(0, model.compareTo(new AxEngineModel(new AxArtifactKey(), new AxContextSchemas(schemasKey), new AxKeyInformation(keyInfoKey), new AxContextAlbums(albumKey), AxEngineState.READY, stats))); assertNotEquals(0, model.compareTo(new AxEngineModel(modelKey, new AxContextSchemas(), diff --git a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineStatsTest.java b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineStatsTest.java index 9e603f491..9f48d1da5 100644 --- a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineStatsTest.java +++ b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/concepts/EngineStatsTest.java @@ -22,7 +22,6 @@ package org.onap.policy.apex.model.enginemodel.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; @@ -137,15 +136,15 @@ public class EngineStatsTest { assertNotNull(stats.getKeys()); - assertFalse(stats.hashCode() == 0); + assertNotEquals(0, stats.hashCode()); - assertTrue(stats.equals(stats)); - assertTrue(stats.equals(clonedStats)); - assertFalse(stats.equals(null)); + assertEquals(stats, stats); + assertEquals(stats, clonedStats); + assertNotNull(stats); Object helloObject = "Hello"; - assertFalse(stats.equals(helloObject)); - assertFalse(stats.equals(new AxEngineStats(new AxReferenceKey()))); + assertNotEquals(stats, helloObject); + assertNotEquals(stats, new AxEngineStats(new AxReferenceKey())); assertEquals(0, stats.compareTo(stats)); assertEquals(0, stats.compareTo(clonedStats)); @@ -154,51 +153,51 @@ public class EngineStatsTest { assertNotEquals(0, stats.compareTo(new AxEngineStats(new AxReferenceKey()))); stats.setTimeStamp(1); - assertFalse(stats.equals(new AxEngineStats(statsKey))); + assertNotEquals(stats, new AxEngineStats(statsKey)); assertNotEquals(0, stats.compareTo(new AxEngineStats(statsKey))); stats.setTimeStamp(0); - assertTrue(stats.equals(new AxEngineStats(statsKey))); + assertEquals(stats, new AxEngineStats(statsKey)); assertEquals(0, stats.compareTo(new AxEngineStats(statsKey))); stats.setEventCount(1); - assertFalse(stats.equals(new AxEngineStats(statsKey))); + assertNotEquals(stats, new AxEngineStats(statsKey)); assertNotEquals(0, stats.compareTo(new AxEngineStats(statsKey))); stats.setEventCount(0); - assertTrue(stats.equals(new AxEngineStats(statsKey))); + assertEquals(stats, new AxEngineStats(statsKey)); assertEquals(0, stats.compareTo(new AxEngineStats(statsKey))); stats.setLastExecutionTime(1); - assertFalse(stats.equals(new AxEngineStats(statsKey))); + assertNotEquals(stats, new AxEngineStats(statsKey)); assertNotEquals(0, stats.compareTo(new AxEngineStats(statsKey))); stats.setLastExecutionTime(0); - assertTrue(stats.equals(new AxEngineStats(statsKey))); + assertEquals(stats, new AxEngineStats(statsKey)); assertEquals(0, stats.compareTo(new AxEngineStats(statsKey))); stats.setAverageExecutionTime(1); - assertFalse(stats.equals(new AxEngineStats(statsKey))); + assertNotEquals(stats, new AxEngineStats(statsKey)); assertNotEquals(0, stats.compareTo(new AxEngineStats(statsKey))); stats.setAverageExecutionTime(0); - assertTrue(stats.equals(new AxEngineStats(statsKey))); + assertEquals(stats, new AxEngineStats(statsKey)); assertEquals(0, stats.compareTo(new AxEngineStats(statsKey))); stats.setUpTime(1); - assertFalse(stats.equals(new AxEngineStats(statsKey))); + assertNotEquals(stats, new AxEngineStats(statsKey)); assertNotEquals(0, stats.compareTo(new AxEngineStats(statsKey))); stats.setUpTime(0); - assertTrue(stats.equals(new AxEngineStats(statsKey))); + assertEquals(stats, new AxEngineStats(statsKey)); assertEquals(0, stats.compareTo(new AxEngineStats(statsKey))); assertEquals(-1, stats.compareTo(new AxEngineStats(statsKey, 0, 0, 0, 0.0, 0, 1))); stats.engineStart(); - assertFalse(stats.equals(new AxEngineStats(statsKey))); + assertNotEquals(stats, new AxEngineStats(statsKey)); final AxEngineStats newStats = new AxEngineStats(statsKey); newStats.setTimeStamp(stats.getTimeStamp()); - assertFalse(stats.equals(newStats)); + assertNotEquals(stats, newStats); assertNotEquals(0, stats.compareTo(newStats)); stats.engineStop(); stats.reset(); - assertTrue(stats.equals(new AxEngineStats(statsKey))); + assertEquals(stats, new AxEngineStats(statsKey)); assertEquals(0, stats.compareTo(new AxEngineStats(statsKey))); } diff --git a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java index 770c29a93..063424b3d 100644 --- a/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java +++ b/model/engine-model/src/test/java/org/onap/policy/apex/model/enginemodel/handling/ApexEngineModelTest.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 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. @@ -20,7 +21,7 @@ package org.onap.policy.apex.model.enginemodel.handling; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Test; @@ -45,19 +46,19 @@ public class ApexEngineModelTest { @Test public void testModelValid() throws Exception { final AxValidationResult result = testApexModel.testApexModelValid(); - assertTrue(result.toString().equals(VALID_MODEL_STRING)); + assertEquals(VALID_MODEL_STRING, result.toString()); } @Test public void testModelVaidateInvalidModel() throws Exception { final AxValidationResult result = testApexModel.testApexModelVaidateInvalidModel(); - assertTrue(result.toString().equals(INVALID_MODEL_STRING)); + assertEquals(INVALID_MODEL_STRING, result.toString()); } @Test public void testModelVaidateMalstructured() throws Exception { final AxValidationResult result = testApexModel.testApexModelVaidateMalstructured(); - assertTrue(result.toString().equals(INVALID_MODEL_MALSTRUCTURED_STRING)); + assertEquals(INVALID_MODEL_MALSTRUCTURED_STRING, result.toString()); } @Test diff --git a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventModelTest.java b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventModelTest.java index 3ae5ac267..c86ba12e7 100644 --- a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventModelTest.java +++ b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventModelTest.java @@ -1,7 +1,7 @@ /*- * ============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. @@ -22,10 +22,8 @@ package org.onap.policy.apex.model.eventmodel.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; @@ -59,20 +57,20 @@ public class EventModelTest { final AxEventModel clonedModel = new AxEventModel(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 AxEventModel(new AxArtifactKey()))); - assertFalse(model.equals(new AxEventModel(modelKey, new AxContextSchemas(), new AxKeyInformation(keyInfoKey), - new AxEvents(eventsKey)))); - assertFalse(model.equals(new AxEventModel(modelKey, new AxContextSchemas(schemasKey), new AxKeyInformation(), - new AxEvents(eventsKey)))); - assertFalse(model.equals(new AxEventModel(modelKey, new AxContextSchemas(schemasKey), - new AxKeyInformation(keyInfoKey), new AxEvents()))); - assertTrue(model.equals(new AxEventModel(modelKey, new AxContextSchemas(schemasKey), - new AxKeyInformation(keyInfoKey), new AxEvents(eventsKey)))); + assertEquals(model, model); + assertEquals(model, clonedModel); + assertNotEquals(model, (Object) "Hello"); + assertNotEquals(model, new AxEventModel(new AxArtifactKey())); + assertNotEquals(model, new AxEventModel(modelKey, new AxContextSchemas(), new AxKeyInformation(keyInfoKey), + new AxEvents(eventsKey))); + assertNotEquals(model, new AxEventModel(modelKey, new AxContextSchemas(schemasKey), new AxKeyInformation(), + new AxEvents(eventsKey))); + assertNotEquals(model, new AxEventModel(modelKey, new AxContextSchemas(schemasKey), + new AxKeyInformation(keyInfoKey), new AxEvents())); + assertEquals(model, new AxEventModel(modelKey, new AxContextSchemas(schemasKey), + new AxKeyInformation(keyInfoKey), new AxEvents(eventsKey))); assertEquals(0, model.compareTo(model)); assertEquals(0, model.compareTo(clonedModel)); diff --git a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventsTest.java b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventsTest.java index a82be12be..629df1a5f 100644 --- a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventsTest.java +++ b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/EventsTest.java @@ -1,7 +1,7 @@ /*- * ============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. @@ -22,7 +22,6 @@ package org.onap.policy.apex.model.eventmodel.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; @@ -186,19 +185,19 @@ public class EventsTest { assertEquals("AxEvent:(key=AxArtifactKey:(name=EventName,version=0.0.1),nameSpace=namespace", clonedEvent.toString().substring(0, 77)); - assertFalse(event.hashCode() == 0); + assertNotEquals(0, event.hashCode()); - assertTrue(event.equals(event)); - assertTrue(event.equals(clonedEvent)); - assertFalse(event.equals(null)); - assertFalse(event.equals((Object) "Hello")); - assertFalse( - event.equals(new AxEvent(AxArtifactKey.getNullKey(), "namespace", "source", "target", parameterMap))); - assertFalse(event.equals(new AxEvent(eventKey, "namespace1", "source", "target", parameterMap))); - assertFalse(event.equals(new AxEvent(eventKey, "namespace", "source2", "target", parameterMap))); - assertFalse(event.equals(new AxEvent(eventKey, "namespace", "source", "target3", parameterMap))); - assertFalse(event.equals(new AxEvent(eventKey, "namespace", "source", "target", parameterMapEmpty))); - assertTrue(event.equals(new AxEvent(eventKey, "namespace", "source", "target", parameterMap))); + assertEquals(event, event); + assertEquals(event, clonedEvent); + assertNotNull(event); + assertNotEquals(event, (Object) "Hello"); + assertNotEquals( + event, new AxEvent(AxArtifactKey.getNullKey(), "namespace", "source", "target", parameterMap)); + assertNotEquals(event, new AxEvent(eventKey, "namespace1", "source", "target", parameterMap)); + assertNotEquals(event, new AxEvent(eventKey, "namespace", "source2", "target", parameterMap)); + assertNotEquals(event, new AxEvent(eventKey, "namespace", "source", "target3", parameterMap)); + assertNotEquals(event, new AxEvent(eventKey, "namespace", "source", "target", parameterMapEmpty)); + assertEquals(event, new AxEvent(eventKey, "namespace", "source", "target", parameterMap)); assertEquals(0, event.compareTo(event)); assertEquals(0, event.compareTo(clonedEvent)); @@ -269,13 +268,13 @@ public class EventsTest { assertEquals("AxEvents:(key=AxArtifactKey:(name=EventsKey,version=0.0.1),e", clonedEvents.toString().substring(0, 60)); - assertFalse(events.hashCode() == 0); + assertNotEquals(0, events.hashCode()); - assertTrue(events.equals(events)); - assertTrue(events.equals(clonedEvents)); - assertFalse(events.equals(null)); - assertFalse(events.equals((Object) "Hello")); - assertFalse(events.equals(new AxEvents(new AxArtifactKey()))); + assertEquals(events, events); + assertEquals(events, clonedEvents); + assertNotNull(events); + assertNotEquals(events, (Object) "Hello"); + assertNotEquals(events, new AxEvents(new AxArtifactKey())); assertEquals(0, events.compareTo(events)); assertEquals(0, events.compareTo(clonedEvents)); diff --git a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/FieldTest.java b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/FieldTest.java index a2587b503..e5a01ed6f 100644 --- a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/FieldTest.java +++ b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/concepts/FieldTest.java @@ -1,7 +1,7 @@ /*- * ============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. @@ -22,10 +22,8 @@ package org.onap.policy.apex.model.eventmodel.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; @@ -35,7 +33,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.Validat /** * Test fields. - * + * * @author Liam Fallon (liam.fallon@ericsson.com) */ public class FieldTest { @@ -110,16 +108,16 @@ public class FieldTest { + "parentLocalName=PLN,localName=LN),fieldSchemaKey=" + "AxArtifactKey:(name=SchemaName,version=0.0.1),optional=true)", clonedField.toString()); - assertFalse(field.hashCode() == 0); + assertNotEquals(0, field.hashCode()); - assertTrue(field.equals(field)); - assertTrue(field.equals(clonedField)); - assertFalse(field.equals(null)); - assertFalse(field.equals((Object) "Hello")); - assertFalse(field.equals(new AxField(AxReferenceKey.getNullKey(), AxArtifactKey.getNullKey(), false))); - assertFalse(field.equals(new AxField(fieldKey, AxArtifactKey.getNullKey(), false))); - assertFalse(field.equals(new AxField(fieldKey, schemaKey, false))); - assertTrue(field.equals(new AxField(fieldKey, schemaKey, true))); + assertEquals(field, field); + assertEquals(field, clonedField); + assertNotNull(field); + assertNotEquals(field, (Object) "Hello"); + assertNotEquals(field, new AxField(AxReferenceKey.getNullKey(), AxArtifactKey.getNullKey(), false)); + assertNotEquals(field, new AxField(fieldKey, AxArtifactKey.getNullKey(), false)); + assertNotEquals(field, new AxField(fieldKey, schemaKey, false)); + assertEquals(field, new AxField(fieldKey, schemaKey, true)); assertEquals(0, field.compareTo(field)); assertEquals(0, field.compareTo(clonedField)); diff --git a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/handling/ApexEventModelTest.java b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/handling/ApexEventModelTest.java index db752a61b..c31597413 100644 --- a/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/handling/ApexEventModelTest.java +++ b/model/event-model/src/test/java/org/onap/policy/apex/model/eventmodel/handling/ApexEventModelTest.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 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. @@ -20,7 +21,7 @@ package org.onap.policy.apex.model.eventmodel.handling; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Test; @@ -45,31 +46,31 @@ public class ApexEventModelTest { @Test public void testModelValid() throws Exception { final AxValidationResult result = testApexModel.testApexModelValid(); - assertTrue(result.toString().equals(VALID_MODEL_STRING)); + assertEquals(VALID_MODEL_STRING, result.toString()); } @Test public void testApexModelVaidateObservation() throws Exception { final AxValidationResult result = testApexModel.testApexModelVaidateObservation(); - assertTrue(result.toString().equals(OBSERVATION_MODEL_STRING)); + assertEquals(OBSERVATION_MODEL_STRING, result.toString()); } @Test public void testApexModelVaidateWarning() throws Exception { final AxValidationResult result = testApexModel.testApexModelVaidateWarning(); - assertTrue(result.toString().equals(WARNING_MODEL_STRING)); + assertEquals(WARNING_MODEL_STRING, result.toString()); } @Test public void testModelVaidateInvalidModel() throws Exception { final AxValidationResult result = testApexModel.testApexModelVaidateInvalidModel(); - assertTrue(result.toString().equals(INVALID_MODEL_STRING)); + assertEquals(INVALID_MODEL_STRING, result.toString()); } @Test public void testModelVaidateMalstructured() throws Exception { final AxValidationResult result = testApexModel.testApexModelVaidateMalstructured(); - assertTrue(result.toString().equals(INVALID_MODEL_MALSTRUCTURED_STRING)); + assertEquals(INVALID_MODEL_MALSTRUCTURED_STRING, result.toString()); } @Test diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiContextAlbumTest.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiContextAlbumTest.java index 0d442e95f..e6ed351ae 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiContextAlbumTest.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiContextAlbumTest.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 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========================================================= */ @@ -21,7 +22,6 @@ package org.onap.policy.apex.model.modelapi; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import org.junit.Test; @@ -41,49 +41,49 @@ public class ApexEditorApiContextAlbumTest { assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextAlbum("MyMap002", "0.0.2", "APPLICATION", "true", "MapType", "0.0.1", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextAlbum("MyMap012", "0.1.2", "ZOOBY", "false", "MapType", "0.0.1", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 012"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextAlbum("MyMap012", "0.1.4", "UNDEFINED", null, "MapType", "0.0.1", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 014"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextAlbum("MyMap012", null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "+++", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "MapZooby", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "MapType", "--++", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "MapType", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "MapType", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextAlbum("MyMap012", null, "EPHEMERAL", "false", "MapType", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createContextAlbum("MyMap002", "0.0.2", "APPLICATION", "true", "MapType", null, "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createContextAlbum("MyMap011", "0.1.2", "APPLICATION", "true", "MapType", "0.0.1", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteContextAlbum("MyMap012", "0.1.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextAlbum("MyMap012", "0.1.2", "ZOOBY", "false", "MapType", "0.0.1", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 012"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.validateContextAlbum(null, null); assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); @@ -91,84 +91,84 @@ public class ApexEditorApiContextAlbumTest { result = apexModel.updateContextAlbum(null, null, null, null, null, null, null, null); assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updateContextAlbum("MyMap002", "0.0.2", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextAlbum("MyMap002", "0.0.2", "ZOOBY", "true", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextAlbum("MyMap002", "0.0.2", null, null, null, null, "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextAlbum("MyMap012", null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextAlbum("MyMap012", null, null, "true", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextAlbum("MyMap015", null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updateContextAlbum("MyMap014", "0.1.5", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", "false", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", "false", "StringType", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", "false", "String", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", "false", "StringType", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", "false", "StringType", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextAlbum("MyMap012", null, "APPLICATION", "Hello", "StringType", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listContextAlbum("@£%%$", null); assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listContextAlbum(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listContextAlbum("MyMap012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listContextAlbum("MyMap012", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listContextAlbum("MyMap012", "0.2.5"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listContextAlbum("MyMap014", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteContextAlbum("@£%%$", null); assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteContextAlbum("MyMap012", "0.1.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteContextAlbum("MyMap012oooo", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listContextAlbum("MyMap012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 3); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(3, result.getMessages().size()); result = apexModel.deleteContextAlbum("MyMap012", "0.1.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listContextAlbum("MyMap012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 2); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(2, result.getMessages().size()); result = apexModel.deleteContextAlbum("MyMap012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listContextAlbum("MyMap012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteContextAlbum(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(4, result.getMessages().size()); result = apexModel.listContextAlbum(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(0, result.getMessages().size()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiContextSchemaTest.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiContextSchemaTest.java index 9f297203b..04605f4a1 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiContextSchemaTest.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiContextSchemaTest.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 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========================================================= */ @@ -21,7 +22,6 @@ package org.onap.policy.apex.model.modelapi; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import org.junit.Test; @@ -41,45 +41,45 @@ public class ApexEditorApiContextSchemaTest { assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listContextSchemas(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextSchema("Hello", "0.0.2", "Java", "java.lang.String", "1fa2e430-f2b2-11e6-bc64-92361f002671", "A description of hello"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextSchema("Hello", "0.1.2", "Java", "java.lang.String", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of hola"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextSchema("Hello", "0.1.4", "Java", "java.lang.String", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of connichi wa"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextSchema("Hello", null, "Java", "java.lang.String", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextSchema("Hello", null, "Java", "java.lang.String", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.deleteContextSchema("Hello", "0.1.4"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextSchema("Hello", "0.1.4", "Java", "java.lang.String", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of connichi wa"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextSchema("Hello2", null, null, "java.lang.String", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createContextSchema("Hello2", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createContextSchema("Hello2", null, "Java", "java.lang.String", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextSchema("Hello", "0.1.2", "Java", "java.lang.Float", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of hola"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.deleteContextSchema("Hello", "0.1.4"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createContextSchema("Hello", "0.1.4", "Java", "java.lang.String", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of connichi wa"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.validateContextSchemas(null, null); assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); @@ -88,66 +88,66 @@ public class ApexEditorApiContextSchemaTest { assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updateContextSchema("Hello", "0.0.2", null, null, null, "An updated description of hello"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextSchema("Hello", "0.0.2", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextSchema("Hello", "0.1.2", "Java", "java.lang.Integer", "1fa2e430-f2b2-11e6-bc64-92361f002673", "A further updated description of hola"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateContextSchema("Hello2", "0.0.2", null, null, null, "An updated description of hello"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listContextSchemas("@£%%$", null); assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listContextSchemas("Hello", "0.1.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 2); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(2, result.getMessages().size()); result = apexModel.listContextSchemas("Hello", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 4); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(4, result.getMessages().size()); result = apexModel.listContextSchemas(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 9); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(9, result.getMessages().size()); result = apexModel.deleteContextSchema("@£%%$", null); assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteContextSchema("Hello", "0.1.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteContextSchema("Hellooooo", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listContextSchemas("Hello", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 4); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(4, result.getMessages().size()); result = apexModel.deleteContextSchema("Hello", "0.1.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listContextSchemas("Hello", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 3); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(3, result.getMessages().size()); result = apexModel.deleteContextSchema("Hello", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listContextSchemas("Hello", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listContextSchemas(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteContextSchema(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(5, result.getMessages().size()); result = apexModel.listContextSchemas(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(0, result.getMessages().size()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiEventTest.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiEventTest.java index 6bb85a634..bc46ee3d3 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiEventTest.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiEventTest.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 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========================================================= */ @@ -21,7 +22,6 @@ package org.onap.policy.apex.model.modelapi; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import org.junit.Test; @@ -41,33 +41,33 @@ public class ApexEditorApiEventTest { assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createEvent("MyEvent002", "0.0.2", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createEvent("MyEvent012", "0.1.2", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 012"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createEvent("MyEvent012", "0.1.4", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 014"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createEvent("MyEvent012", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createEvent("MyEvent012", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createEvent("MyEvent002", "0.0.2", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createEvent("@£$%^", "0.2.5", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteEvent("MyEvent012", "0.1.4"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createEvent("MyEvent012", "0.1.4", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 014"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.validateEvent(null, null); assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); @@ -75,123 +75,123 @@ public class ApexEditorApiEventTest { result = apexModel.updateContextSchema(null, null, null, null, null, null); assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updateEvent("MyEvent012", "0.1.2", "Another Namespace", null, "Another target", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateEvent("MyEvent002", "0.0.2", "My Namespace", "My Source", "my target", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateEvent("MyEvent012", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateEvent("MyEvent015", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updateEvent("MyEvent014", "0.1.5", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updateEvent("@£$%^^", "0.6.9", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listEvent("@£$%", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listEvent(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listEvent("MyEvent012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listEvent("MyEvent012", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listEvent("MyEvent012", "0.2.5"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listEvent("MyEvent123", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteEvent("@£$%^", "0.1.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteEvent("MyEvent012", "0.1.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteEvent("MyEvent012oooo", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listEvent("MyEvent012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 3); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(3, result.getMessages().size()); result = apexModel.deleteEvent("MyEvent012", "0.1.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listEvent("MyEvent012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 2); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(2, result.getMessages().size()); result = apexModel.deleteEvent("MyEvent012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listEvent("MyEvent012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createEventPar("MyEvent123", null, "NewPar00", null, null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createEventPar("MyEvent002", "4.5.6", "NewPar00", null, null, true); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createEventPar("MyEvent002", "0.1.4", "NewPar00", null, null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createEventPar("MyEvent002", "0.0.2", "NewPar00", null, null, true); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createEventPar("MyEvent002", "0.0.2", "NewPar00", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createEventPar("MyEvent002", "0.0.2", "NewPar00", "eventContextItem0", null, true); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createEventPar("MyEvent002", "0.0.2", "NewPar01", "eventContextItem0", "0.0.1", false); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createEventPar("MyEvent002", "0.0.2", "NewPar02", "eventContextItem0", "0.0.2", true); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createEventPar("MyEvent002", null, "NewPar02", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createEventPar("MyEvent002", null, "NewPar03", "eventContextItem0", null, true); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listEventPar("@£%%$", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listEventPar("MyEvent002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listEventPar("MyEvent002", "0.0.1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listEventPar("MyEvent002", "0.0.2", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listEventPar("MyEvent002", "0.0.2", "NewPar01"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listEventPar("MyEvent002", "0.0.2", "NewPar02"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listEventPar("MyEvent002", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteEventPar("@££%%%", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteEventPar("NonExistantEvent", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(4, apexModel.listEventPar("MyEvent002", null, null).getMessages().size()); result = apexModel.deleteEventPar("MyEvent002", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(4, apexModel.listEventPar("MyEvent002", null, null).getMessages().size()); result = apexModel.deleteEventPar("MyEvent002", null, "NewPar02"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(3, apexModel.listEventPar("MyEvent002", null, null).getMessages().size()); result = apexModel.deleteEventPar("MyEvent002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listEventPar("MyEvent002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteEventPar("MyEvent002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listEventPar("MyEvent002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteEvent(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(4, result.getMessages().size()); result = apexModel.listEvent(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(0, result.getMessages().size()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiKeyInfoTest.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiKeyInfoTest.java index 3635abbe0..caa25e4a4 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiKeyInfoTest.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiKeyInfoTest.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 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========================================================= */ @@ -21,7 +22,6 @@ package org.onap.policy.apex.model.modelapi; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import org.junit.Test; @@ -42,28 +42,28 @@ public class ApexEditorApiKeyInfoTest { assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createKeyInformation(null, null, null, null); assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createKeyInformation("Hello", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002671", "A description of hello"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createKeyInformation("Hello", "0.1.2", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of hola"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createKeyInformation("Hello", "0.1.4", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of connichi wa"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createKeyInformation("Hello", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createKeyInformation("Hello", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createKeyInformation("Hello", "0.1.2", "1fa2e430-f2b2-11e6-bc64-92361f002672", "A description of hola"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.validateKeyInformation(null, null); assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); @@ -72,15 +72,15 @@ public class ApexEditorApiKeyInfoTest { assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updateKeyInformation("Hello", "0.0.2", null, "An updated description of hello"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateKeyInformation("Hello", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateKeyInformation("Hello", "0.1.2", "1fa2e430-f2b2-11e6-bc64-92361f002673", "A further updated description of hola"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateKeyInformation("Hello2", "0.0.2", null, "An updated description of hello"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listKeyInformation(null, null); assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); @@ -89,49 +89,49 @@ public class ApexEditorApiKeyInfoTest { assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listKeyInformation("Hello", "0.1.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 2); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(2, result.getMessages().size()); result = apexModel.listKeyInformation("Hello", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 4); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(4, result.getMessages().size()); result = apexModel.deleteKeyInformation("Hello", "0.1.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteKeyInformation("Hellooooo", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listKeyInformation("Hello", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 4); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(4, result.getMessages().size()); result = apexModel.listKeyInformation(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 22); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(22, result.getMessages().size()); result = apexModel.deleteKeyInformation("%%%$$", null); assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteKeyInformation("Hello", "0.1.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listKeyInformation("Hello", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 3); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(3, result.getMessages().size()); result = apexModel.deleteKeyInformation("Hello", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listKeyInformation("Hello", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteKeyInformation(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(18, result.getMessages().size()); result = apexModel.listKeyInformation(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(0, result.getMessages().size()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiPolicyTest.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiPolicyTest.java index 515ff8038..3e78921e9 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiPolicyTest.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiPolicyTest.java @@ -22,7 +22,6 @@ package org.onap.policy.apex.model.modelapi; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import org.junit.Test; @@ -43,983 +42,983 @@ public class ApexEditorApiPolicyTest { assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicy("MyPolicy002", "0.0.2", "SomeTemplate", "AState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicy("MyPolicy002", "0.0.2", "SomeTemplate", "AState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createPolicy("MyPolicy012", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicy("MyPolicy012", null, "SomeTemplate", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicy("MyPolicy013", null, null, "AState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicy("MyPolicy012", null, "SomeTemplate", "AState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicy("MyPolicy002", "0.0.2", "SomeTemplate", "AState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createPolicy("MyPolicy012", "0.1.2", "SomeTemplate", "AState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicy("MyTestPolicy", "0.0.1", "SomeTemplate", "TestState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deletePolicy("MyPolicy002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicy("MyPolicy002", "0.0.2", "SomeTemplate", "AState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.validatePolicy(null, null); assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicy("@£$$", "0.0.2", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updatePolicy("MyPolicy002", "0.0.2", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicy("MyPolicy002", "0.0.1", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicy("MyPolicy002", "0.0.2", "SomeOtherTemplate", "BState", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicy("MyPolicy012", null, "SomeOtherTemplate", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicy("MyPolicy012", null, null, "CState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicy("MyPolicy012", null, "SomeOtherTemplate", "BState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicy("MyPolicy015", null, "SomeOtherTemplate", "DState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicy("MyPolicy014", "0.1.5", "SomeOtherTemplate", "EState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicy("@£$%%", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicy(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(6, result.getMessages().size()); result = apexModel.listPolicy("MyPolicy012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicy("MyPolicy012", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicy("MyPolicy012", "0.2.5"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicy("MyPolicy014", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicy("@£$%", "0.1.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicy("MyPolicy012", "0.1.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicy("MyPolicy012oooo", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicy("MyPolicy012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 2); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(2, result.getMessages().size()); result = apexModel.deletePolicy("MyPolicy002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 1); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(1, result.getMessages().size()); result = apexModel.listPolicy("MyPolicy012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 2); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(2, result.getMessages().size()); result = apexModel.deletePolicy("MyPolicy012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 2); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(2, result.getMessages().size()); result = apexModel.createPolicyState(null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyState("MyPolicy123", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyState("MyPolicy123", null, "AState", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", "0.0.2", "AState", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "ATrigger", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", null, "ATask", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", null, "task", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", null, "task", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", null, "AState", "inEvent", null, "task", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "AState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "BState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "CState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "DState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyState(null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updatePolicyState("MyPolicy123", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updatePolicyState("MyPolicy123", null, "AState", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", "0.0.2", "AState", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", null, "ZState", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "ATrigger", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", null, "ATask", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", null, "task", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", null, "task", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", null, "AState", "inEvent", null, "task", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", "0.0.1", "AState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", "0.0.1", "BState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", "0.0.1", "CState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyState("MyTestPolicy", "0.0.1", "DState", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listPolicyState("MyTestPolicy", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(4, result.getMessages().size()); result = apexModel.listPolicyState(null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyState("SomeOtherPolicy", "0.0.1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyState("SomeOtherPolicy", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyState("MyTestPolicy", "0.0.2", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyState("MyTestPolicy", "0.0.1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(4, result.getMessages().size()); result = apexModel.listPolicyState("MyTestPolicy", "0.0.1", "CState"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyState("MyTestPolicy", null, "CState"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyState("MyTestPolicy", "0.0.1", "AState"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyState("MyTestPolicy", "0.0.1", "EState"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyState("@£$$", "0.0.2", "Trigger04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); assertEquals(4, apexModel.listPolicyState("MyTestPolicy", null, null).getMessages().size()); result = apexModel.deletePolicyState("MyTestPolicy", "0.0.2", "Trigger04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(4, apexModel.listPolicyState("MyTestPolicy", null, null).getMessages().size()); result = apexModel.deletePolicyState("MyTestPolicy", null, "CState"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deletePolicyState("MyTestPolicy", null, "ZState"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(3, apexModel.listPolicyState("MyTestPolicy", null, null).getMessages().size()); result = apexModel.deletePolicyState("MyTestPolicy", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listPolicyState("MyTestPolicy", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyState("MyTestPolicy", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "TestState1", "inEvent", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "TestState2", "outEvent0", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyState("MyTestPolicy", "0.0.1", "TestState3", "outEvent1", "0.0.1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskSelectionLogic(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "1.2.3", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "NewTSL00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "UNDEFINED", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "MVEL", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "JAVA", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "JYTHON", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", "JAVASCRIPT", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", "JRUBY", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState99", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy2", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy1", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "NonExistantState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "", "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1", "MVEL", "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyPolicy012", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", null, "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyPolicy015", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyPolicy014", "0.1.5", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskSelectionLogic(null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateTaskSelectionLogic("zooby", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateTaskSelectionLogic("zooby", null, "looby"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskSelectionLogic("zooby", null, "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskSelectionLogic("MyTestPolicy", null, "looby"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.2", "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.deletePolicyStateTaskSelectionLogic(null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateTaskSelectionLogic("zooby", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateTaskSelectionLogic("zooby", null, "looby"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateTaskSelectionLogic("zooby", null, "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", null, "looby"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.2", "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", null, "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.createPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1", "JRUBY", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listPolicyStateTaskSelectionLogic("MyTestPolicy", null, "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deletePolicyStateTaskSelectionLogic("MyTestPolicy", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateOutput(null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", null, "SomeState", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", null, "SomeState", "SomeOutput", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "1.2.3", "TestState1", "SomeOutput", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOutput", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOutput", "SomeDummyEvent", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOutput", "inEvent", "1.2.3", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOutput", "inEvent", "0.0.1", "SomeDummyNextState"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOutput", "inEvent", "0.0.1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOtherOutput", "inEvent", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOtherOutput", "inEvent", "0.0.1", "TestState2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOtherOutput", "inEvent", "0.0.1", "TestState2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState2", "AnotherOtherOutput", "outEvent0", "0.0.1", "TestState3"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState2", "YetAnotherOtherOutput", "outEvent0", "0.0.1", "TestState3"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listPolicyStateOutput(null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.2", "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, "SomeState", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState2", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "YetAnotherOtherOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState2", "YetAnotherOtherOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState3", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateOutput(null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", "0.0.2", "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", null, "SomeState", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", "0.0.1", "TestState3", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", "0.0.1", "TestState3", "DummyOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, "TestState1", null); assertEquals(2, result.getMessages().size()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", null, "TestState1", "SomeOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, "TestState2", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, result.getMessages().size()); result = apexModel.deletePolicyStateOutput("MyTestPolicy", null, "TestState2", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicyStateOutput("MyTestPolicy", null, "TestState2", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOutput", "inEvent", "0.0.1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOtherOutput", "inEvent", "0.0.1", "TestState1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState1", "SomeOtherOutput", "inEvent", "0.0.1", "TestState2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState2", "AnotherOtherOutput", "outEvent0", "0.0.1", "TestState3"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateOutput("MyTestPolicy", "0.0.1", "TestState2", "YetAnotherOtherOutput", "outEvent0", "0.0.1", "TestState3"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic(null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, "SomeState", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, "SomeState", "SFLName01", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "1.2.3", "TestState1", "SFLName01", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName01", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName01", "NewTSL00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName02", "UNDEFINED", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName03", "MVEL", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName03", "MVEL", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName04", "JAVA", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName05", "JYTHON", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName06", "JAVASCRIPT", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName07", "JRUBY", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic(null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", null, "TestState99", "SomeSFLName", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy2", null, "TestState1", "SomeSFLName", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy1", "0.0.2", "TestState1", "SomeSFLName", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "NonEistantSFL", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName06", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName06", "", "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName06", "MVEL", "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyPolicy012", null, "TestState1", "SFLName06", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName06", null, "Some Other Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName06", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyPolicy015", null, "TestState1", "SFLName06", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updatePolicyStateFinalizerLogic("MyPolicy014", "0.1.5", "TestState1", "SFLName06", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic(null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", "0.0.2", "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "SomeState", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("zooby", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("zooby", null, "looby", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("zooby", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "looby", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", "0.0.2", "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(6, result.getMessages().size()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName06"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.deletePolicyStateFinalizerLogic(null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.2", "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", null, "SomeState", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("zooby", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("zooby", null, "looby", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("zooby", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", null, "looby", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.2", "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName06"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName06"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName06"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(5, result.getMessages().size()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName02"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName02"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName02"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(4, result.getMessages().size()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(4, result.getMessages().size()); result = apexModel.deletePolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName02", "UNDEFINED", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName03", "MVEL", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName04", "JAVA", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", "0.0.1", "TestState1", "SFLName05", "JYTHON", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName06", "JAVASCRIPT", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateFinalizerLogic("MyTestPolicy", null, "TestState1", "SFLName07", "JRUBY", "Some Policy Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTask("TestTask0", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTask("TestTask1", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTask("TestTask2", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTask("TestTask3", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTask("TestTask4", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskRef(null, null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, null, null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "SomeState", null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "SomeState", null, null, null, null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "1.2.3", "SomeState", null, null, null, null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateTaskRef("AnyOldPolicy", "1.2.3", "SomeState", null, null, null, null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", null, null, null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", "SomeTask", "Zooby|", null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", "SomeTask", "0.0.1", null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", "task", "0.0.1", null, "DummyOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", "task", "0.0.1", "Some Policy Logic", "DummyOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", "task", "0.0.1", "DIRECT", "DummyOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTaskLocalName", "task", "0.0.1", "LOGIC", "DummyOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "task", "0.0.1", "DIRECT", "SFLName07"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "task", "0.0.1", "LOGIC", "SomeOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "task", "0.0.1", "DIRECT", "SomeOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "NonExistantTask", "0.0.1", "DIRECT", "SomeOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "task", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask0", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask1", "0.0.1", "DIRECT", "SomeOtherOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask2", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask3", "0.0.1", "DIRECT", "SomeOtherOutput"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, "TestTask4", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, "TestTask4", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, "TestState1", "TestTask4", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask4", "0.0.1", "FUNKY", "SFLName07"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask4", "0.0.1", "UNDEFINED", "SFLName07"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeTaskLocalName", "TestTask4", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, "TestTask0", "0.0.1", "LOGIC", "SFLName07"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.listPolicyStateTaskRef(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateTaskRef("zooby", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateTaskRef("zooby", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskRef("zooby", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(12, result.getMessages().size()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "SomeOldTask", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "task", "1.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", "task", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, result.getMessages().size()); result = apexModel.deletePolicyStateTaskRef(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateTaskRef("zooby", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateTaskRef("zooby", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateTaskRef("zooby", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "ADummyTask", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", "0.0.1", "TestState1", "task", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(12, result.getMessages().size()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, "TestState1", "TestTask0", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(10, result.getMessages().size()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, "TestState1", "TestTask2", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(8, result.getMessages().size()); result = apexModel.deletePolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(4, result.getMessages().size()); result = apexModel.listPolicyStateTaskRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "1.2.3", "SomeState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef("AnyOldPolicy", "1.2.3", "SomeState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTask", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTask", "Zooby|"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "SomeTask", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "task", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef("MyPolicy123", null, null, "AContextMap00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateContextRef("MyPolicy123", null, "TestState1", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "4.5.6", "TestState1", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.1.4", "TestState1", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", ""); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", null, "TestState1", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.listPolicyStateContextRef(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateContextRef("zooby", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateContextRef("zooby", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateContextRef("zooby", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, result.getMessages().size()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "AContextMap04", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "1.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateContextRef(null, null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "SomeState", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.1", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateContextRef("zooby", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateContextRef("zooby", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateContextRef("zooby", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "looby", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.2", "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "ADummyContextMap", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "AContextMap04", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "TestState1", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "TestState1", "contextAlbum0", "0.1.5"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "TestState1", "contextAlbum1", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.createPolicyStateContextRef("MyTestPolicy", "0.0.1", "TestState1", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deletePolicyStateContextRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listPolicyStateContextRef("MyTestPolicy", null, "TestState1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deletePolicy(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(3, result.getMessages().size()); result = apexModel.listPolicy(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(0, result.getMessages().size()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiTaskTest.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiTaskTest.java index 050025537..f2c41318c 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiTaskTest.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexEditorApiTaskTest.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 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========================================================= */ @@ -21,7 +22,6 @@ package org.onap.policy.apex.model.modelapi; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; import org.junit.Test; @@ -41,445 +41,445 @@ public class ApexEditorApiTaskTest { assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTask("@^^$^^$", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createTask("MyTask002", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTask("MyTask002", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createTask("MyTask012", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTask("MyTask012", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.listTask(null, null); result = apexModel.createTask("MyTask002", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createTask("MyTask012", "0.1.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteTask("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTask("MyTask002", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.validateTask(null, null); assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateTask("@$$$£", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updateTask("MyTask002", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateTask("MyTask002", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updateTask("MyTask002", "0.0.2", "1fa2e430-f2b2-11e6-bc64-92361f002700", "A description of 002"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateTask("MyTask012", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateTask("MyTask012", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateTask("MyTask012", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateTask("MyTask015", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updateTask("MyTask014", "0.1.5", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listTask("£@£@@£@£", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listTask(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTask("MyTask012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTask("MyTask012", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTask("MyTask012", "0.2.5"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listTask("MyTask014", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTask("@£££@", "0.1.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteTask("MyTask012", "0.1.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTask("MyTask012oooo", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listTask("MyTask012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 2); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(2, result.getMessages().size()); result = apexModel.deleteTask("MyTask012", "0.1.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTask("MyTask012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); - assertTrue(result.getMessages().size() == 1); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); + assertEquals(1, result.getMessages().size()); result = apexModel.deleteTask("MyTask012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTask("MyTask012", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updateTaskLogic("MyTask002", null, "NewLogic00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskLogic("MyTask123", null, "NewLogic00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskLogic("MyTask002", "4.5.6", "NewLogic00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskLogic("MyTask002", "0.1.4", "NewLogic00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskLogic("MyTask002", "0.0.2", "NewLogic00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createTaskLogic("MyTask002", "0.0.2", "UNDEFINED", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskLogic("MyTask002", "0.0.2", "MVEL", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskLogic("MyTask002", "0.0.2", "JAVA", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskLogic("MyTask002", "0.0.2", "JYTHON", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskLogic("MyTask002", null, "JAVASCRIPT", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskLogic("MyTask002", null, "JRUBY", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateTaskLogic("MyTask002", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateTaskLogic("MyTask002", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updateTaskLogic("MyTask002", "0.0.2", "", "Some Other Task Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.updateTaskLogic("MyTask002", "0.0.2", "MVEL", "Some Other Task Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateTaskLogic("MyTask012", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updateTaskLogic("MyTask002", null, null, "Some Other Task Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateTaskLogic("MyTask002", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.updateTaskLogic("MyTask015", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.updateTaskLogic("MyTask014", "0.1.5", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listTaskLogic("MyTask002", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskLogic("MyTask002", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskLogic(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteTaskLogic("@£@£@£", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteTaskLogic("NonExistantTask", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(1, apexModel.listTaskLogic("MyTask002", null).getMessages().size()); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskLogic("MyTask002", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(1, apexModel.listTaskLogic("MyTask002", null).getMessages().size()); result = apexModel.createTaskLogic("MyTask002", null, "JRUBY", "Some Task Logic"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskLogic("MyTask002", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteTaskLogic("MyTask002", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskInputField("MyTask123", null, "NewField00", null, null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskInputField("MyTask002", "4.5.6", "NewField00", null, null, true); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskInputField("MyTask002", "0.1.4", "NewField00", null, null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskInputField("MyTask002", "0.0.2", "NewField00", null, null, true); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createTaskInputField("MyTask002", "0.0.2", "NewField00", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskInputField("MyTask002", "0.0.2", "NewField00", "eventContextItem0", null, true); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createTaskInputField("MyTask002", "0.0.2", "NewField01", "eventContextItem0", "0.0.1", false); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskInputField("MyTask002", "0.0.2", "NewField02", "eventContextItem0", "0.0.2", true); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskInputField("MyTask002", null, "NewField02", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskInputField("MyTask002", null, "NewField03", "eventContextItem0", null, true); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskInputField("@£$%", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listTaskInputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskInputField("MyTask002", "0.0.1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listTaskInputField("MyTask002", "0.0.2", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskInputField("MyTask002", "0.0.2", "NewField01"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskInputField("MyTask002", "0.0.2", "NewField02"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskInputField("MyTask002", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTaskInputField("@£$%", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteTaskInputField("NonExistantTask", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(4, apexModel.listTaskInputField("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskInputField("MyTask002", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(4, apexModel.listTaskInputField("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskInputField("MyTask002", null, "NewField02"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(3, apexModel.listTaskInputField("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskInputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskInputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTaskInputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskOutputField("MyTask123", null, "NewField00", null, null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskOutputField("MyTask002", "4.5.6", "NewField00", null, null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskOutputField("MyTask002", "0.1.4", "NewField00", null, null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskOutputField("MyTask002", "0.0.2", "NewField00", null, null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createTaskOutputField("MyTask002", "0.0.2", "NewField00", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskOutputField("MyTask002", "0.0.2", "NewField00", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createTaskOutputField("MyTask002", "0.0.2", "NewField01", "eventContextItem0", "0.0.1", false); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskOutputField("MyTask002", "0.0.2", "NewField02", "eventContextItem0", "0.0.2", false); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskOutputField("MyTask002", null, "NewField02", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskOutputField("MyTask002", null, "NewField03", "eventContextItem0", null, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskOutputField("@£$%", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listTaskOutputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskOutputField("MyTask002", "0.0.1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listTaskOutputField("MyTask002", "0.0.2", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskOutputField("MyTask002", "0.0.2", "NewField01"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskOutputField("MyTask002", "0.0.2", "NewField02"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskOutputField("MyTask002", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTaskOutputField("@£$%", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteTaskOutputField("NonExistantTask", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(4, apexModel.listTaskOutputField("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskOutputField("MyTask002", "0.0.2", "NewField04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(4, apexModel.listTaskOutputField("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskOutputField("MyTask002", null, "NewField02"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(3, apexModel.listTaskOutputField("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskOutputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskOutputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTaskOutputField("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskParameter("MyTask123", null, "NewPar00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskParameter("MyTask002", "4.5.6", "NewPar00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskParameter("MyTask002", "0.1.4", "NewPar00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar00", "eventContextItem0"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar00", "eventContextItem0"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar01", "eventContextItem0"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar02", "eventContextItem0"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar02", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createTaskParameter("MyTask002", "0.0.2", "NewPar03", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createTaskParameter("MyTask002", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createTaskParameter("MyTask002", null, null, "Default value"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listTaskParameter("@£$%", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listTaskParameter("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskParameter("MyTask002", "0.0.3", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listTaskParameter("MyTask002", "0.0.2", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskParameter("MyTask002", "0.0.2", "NewPar01"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskParameter("MyTask002", "0.0.2", "NewPar02"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskParameter("MyTask002", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTaskParameter("@£$%", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteTaskParameter("NonExistantTask", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(3, apexModel.listTaskParameter("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskParameter("MyTask002", "0.0.2", "NewPar04"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(3, apexModel.listTaskParameter("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskParameter("MyTask002", null, "NewPar02"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, apexModel.listTaskParameter("MyTask002", null, null).getMessages().size()); result = apexModel.deleteTaskParameter("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.listTaskParameter("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTaskParameter("MyTask002", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskContextRef("@£$$", null, "AContextMap00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.createTaskContextRef("MyTask123", null, "AContextMap00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskContextRef("MyTask123", null, "AContextMap00", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskContextRef("MyTask123", null, "AContextMap00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskContextRef("MyTask002", "4.5.6", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskContextRef("MyTask002", "0.1.4", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "AContextMap00", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "contextAlbum2", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "contextAlbum1", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.createTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.createTaskContextRef("MyTask002", null, "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_EXISTS)); + assertEquals(ApexApiResult.Result.CONCEPT_EXISTS, result.getResult()); result = apexModel.listTaskContextRef("@£$%", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.listTaskContextRef("MyTask002", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", "0.0.1", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "AContextMap04", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "contextAlbum0", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "contextAlbum1", "0.0.1"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", "0.0.2", "contextAlbum1", "0.0.2"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTaskContextRef("@£$%", "0.0.2", "AContextMap04", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.deleteTaskContextRef("NonExistantTask", "0.0.2", "AContextMap04", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); assertEquals(2, apexModel.listTaskContextRef("MyTask002", null, null, null).getMessages().size()); result = apexModel.deleteTaskContextRef("MyTask002", "0.0.2", "AContextMap04", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTaskContextRef("MyTask002", null, "contextAlbum0", "0.0.3"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTaskContextRef("MyTask002", null, "contextAlbum0", "0.1.5"); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTaskContextRef("MyTask002", null, "contextAlbum0", null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.deleteTaskContextRef("MyTask002", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(1, result.getMessages().size()); result = apexModel.listTaskContextRef("MyTask002", null, null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST)); + assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); result = apexModel.deleteTask(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(2, result.getMessages().size()); result = apexModel.listTask(null, null); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); assertEquals(0, result.getMessages().size()); } } diff --git a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexModelApiTest.java b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexModelApiTest.java index f8d7fd696..e7330ee47 100644 --- a/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexModelApiTest.java +++ b/model/model-api/src/test/java/org/onap/policy/apex/model/modelapi/ApexModelApiTest.java @@ -64,23 +64,23 @@ public class ApexModelApiTest { final ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); ApexApiResult result = apexModel.loadFromFile("src/main/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteModel(); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.xml"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteModel(); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.junk"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); - assertTrue(result.getMessages().get(0).equals("format of input for Apex concept is neither JSON nor XML")); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); + assertEquals("format of input for Apex concept is neither JSON nor XML", result.getMessages().get(0)); } @Test @@ -88,24 +88,24 @@ public class ApexModelApiTest { final ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); ApexApiResult result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); final File tempJsonModelFile = File.createTempFile("ApexModelTest", ".json"); result = apexModel.saveToFile(tempJsonModelFile.getCanonicalPath(), false); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); final ApexModel jsonApexModel = new ApexModelFactory().createApexModel(null, false); result = jsonApexModel.loadFromFile(tempJsonModelFile.getCanonicalPath()); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); tempJsonModelFile.delete(); final File tempXmlModelFile = File.createTempFile("ApexModelTest", ".xml"); result = apexModel.saveToFile(tempXmlModelFile.getCanonicalPath(), true); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); final ApexModel xmlApexModel = new ApexModelFactory().createApexModel(null, false); result = xmlApexModel.loadFromFile(tempXmlModelFile.getCanonicalPath()); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); tempXmlModelFile.delete(); } @@ -114,32 +114,32 @@ public class ApexModelApiTest { final ApexModel apexModel = new ApexModelFactory().createApexModel(null, false); ApexApiResult result = apexModel.loadFromFile("src/test/resources/models/PolicyModel.json"); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); final DaoParameters DaoParameters = new DaoParameters(); DaoParameters.setPluginClass("org.onap.policy.apex.model.basicmodel.dao.impl.DefaultApexDao"); DaoParameters.setPersistenceUnit("DAOTest"); result = apexModel.saveToDatabase(DaoParameters); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteModel(); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.loadFromDatabase("PolicyModel", "0.0.1", DaoParameters); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteModel(); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.loadFromDatabase("PolicyModel", null, DaoParameters); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.deleteModel(); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.loadFromDatabase("VPNPolicyModel", "0.0.1", DaoParameters); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); } @Test @@ -163,30 +163,30 @@ public class ApexModelApiTest { } result = apexModel.readFromUrl("zooby/looby"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.writeToUrl("zooby/looby", true); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.readFromUrl("zooby://zooby/looby"); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); result = apexModel.writeToUrl("zooby://zooby/looby", false); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); apexModel = new ApexModelFactory().createApexModel(null, false); final File tempJsonModelFile = File.createTempFile("ApexModelTest", ".json"); result = apexModel.saveToFile(tempJsonModelFile.getCanonicalPath(), false); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); final String tempFileUrlString = tempJsonModelFile.toURI().toString(); result = apexModel.readFromUrl(tempFileUrlString); - assertTrue(result.getResult().equals(ApexApiResult.Result.SUCCESS)); + assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); result = apexModel.writeToUrl(tempFileUrlString, false); - assertTrue(result.getResult().equals(ApexApiResult.Result.FAILED)); - assertTrue(result.getMessages().get(0).equals("protocol doesn't support output")); + assertEquals(ApexApiResult.Result.FAILED, result.getResult()); + assertEquals("protocol doesn't support output", result.getMessages().get(0)); tempJsonModelFile.delete(); } diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/LogicTest.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/LogicTest.java index d3d533400..655df059a 100644 --- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/LogicTest.java +++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/LogicTest.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 static org.junit.Assert.fail; import org.junit.Test; @@ -36,7 +34,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.Validat /** * Test apex logic. - * + * * @author Liam Fallon (liam.fallon@ericsson.com) */ public class LogicTest { @@ -154,16 +152,16 @@ public class LogicTest { + "parentLocalName=PLN,localName=LN),logicFlavour=LogicFlavour,logic=Logic)", clonedLogic.toString()); - assertFalse(logic.hashCode() == 0); + assertNotEquals(0, logic.hashCode()); - assertTrue(logic.equals(logic)); - assertTrue(logic.equals(clonedLogic)); - assertFalse(logic.equals(null)); - assertFalse(logic.equals((Object) "Hello")); - assertFalse(logic.equals(new AxLogic(AxReferenceKey.getNullKey(), "LogicFlavour", "Logic"))); - assertFalse(logic.equals(new AxLogic(logicKey, "AnotherLogicFlavour", "Logic"))); - assertFalse(logic.equals(new AxLogic(logicKey, "LogicFlavour", "AnotherLogic"))); - assertTrue(logic.equals(new AxLogic(logicKey, "LogicFlavour", "Logic"))); + assertEquals(logic, logic); + assertEquals(logic, clonedLogic); + assertNotNull(logic); + assertNotEquals(logic, (Object) "Hello"); + assertNotEquals(logic, new AxLogic(AxReferenceKey.getNullKey(), "LogicFlavour", "Logic")); + assertNotEquals(logic, new AxLogic(logicKey, "AnotherLogicFlavour", "Logic")); + assertNotEquals(logic, new AxLogic(logicKey, "LogicFlavour", "AnotherLogic")); + assertEquals(logic, new AxLogic(logicKey, "LogicFlavour", "Logic")); assertEquals(0, logic.compareTo(logic)); assertEquals(0, logic.compareTo(clonedLogic)); diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/PoliciesTest.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/PoliciesTest.java index 084623f6f..662b8bd02 100644 --- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/PoliciesTest.java +++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/PoliciesTest.java @@ -23,10 +23,8 @@ package org.onap.policy.apex.model.policymodel.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; import java.util.Map; import java.util.TreeMap; @@ -40,7 +38,7 @@ import org.onap.policy.apex.model.policymodel.handling.SupportApexPolicyModelCre /** * Test apex policies. - * + * * @author Liam Fallon (liam.fallon@ericsson.com) */ public class PoliciesTest { @@ -210,18 +208,18 @@ public class PoliciesTest { assertEquals("AxPolicy:(key=AxArtifactKey:(name=policy,version=0.0.1),template=FREEFORM,sta", clonedPolicy.toString().substring(0, 77)); - assertFalse(policyPN.hashCode() == 0); + assertNotEquals(0, policyPN.hashCode()); - assertTrue(policyPN.equals(policyPN)); - assertTrue(policyPN.equals(clonedPolicy)); - assertFalse(policyPN.equals(null)); - assertFalse(policyPN.equals((Object) "Hello")); - assertFalse(policyPN.equals( - new AxPolicy(AxArtifactKey.getNullKey(), savedTemplate, savedStateMap, savedFirstState))); - assertFalse(policyPN.equals(new AxPolicy(savedPolicyKey, "SomeTemplate", savedStateMap, savedFirstState))); - assertFalse(policyPN.equals(new AxPolicy(savedPolicyKey, savedTemplate, stateMapEmpty, savedFirstState))); - assertFalse(policyPN.equals(new AxPolicy(savedPolicyKey, savedTemplate, savedStateMap, "SomeFirstState"))); - assertTrue(policyPN.equals(new AxPolicy(savedPolicyKey, savedTemplate, savedStateMap, savedFirstState))); + assertEquals(policyPN, policyPN); + assertEquals(policyPN, clonedPolicy); + assertNotNull(policyPN); + assertNotEquals(policyPN, (Object) "Hello"); + assertNotEquals(policyPN, + new AxPolicy(AxArtifactKey.getNullKey(), savedTemplate, savedStateMap, savedFirstState)); + assertNotEquals(policyPN, new AxPolicy(savedPolicyKey, "SomeTemplate", savedStateMap, savedFirstState)); + assertNotEquals(policyPN, new AxPolicy(savedPolicyKey, savedTemplate, stateMapEmpty, savedFirstState)); + assertNotEquals(policyPN, new AxPolicy(savedPolicyKey, savedTemplate, savedStateMap, "SomeFirstState")); + assertEquals(policyPN, new AxPolicy(savedPolicyKey, savedTemplate, savedStateMap, savedFirstState)); assertEquals(0, policyPN.compareTo(policyPN)); assertEquals(0, policyPN.compareTo(clonedPolicy)); @@ -295,13 +293,13 @@ public class PoliciesTest { assertEquals("AxPolicies:(key=AxArtifactKey:(name=PoliciesKey,version=0.0.", clonedPolicies.toString().substring(0, 60)); - assertFalse(policies.hashCode() == 0); + assertNotEquals(0, policies.hashCode()); - assertTrue(policies.equals(policies)); - assertTrue(policies.equals(clonedPolicies)); - assertFalse(policies.equals(null)); - assertFalse(policies.equals((Object) "Hello")); - assertFalse(policies.equals(new AxPolicies(new AxArtifactKey()))); + assertEquals(policies, policies); + assertEquals(policies, clonedPolicies); + assertNotNull(policies); + assertNotEquals(policies, (Object) "Hello"); + assertNotEquals(policies, new AxPolicies(new AxArtifactKey())); assertEquals(0, policies.compareTo(policies)); assertEquals(0, policies.compareTo(clonedPolicies)); 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)); diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/StateOutputTest.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/StateOutputTest.java index 77ce93d4c..ff3267c8c 100644 --- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/StateOutputTest.java +++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/StateOutputTest.java @@ -23,10 +23,8 @@ package org.onap.policy.apex.model.policymodel.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; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; @@ -99,16 +97,16 @@ public class StateOutputTest { final AxStateOutput clonedPar = new AxStateOutput(so); assertEquals("AxStateOutput:(stateKey=AxReferenceKey:(parentKeyN", clonedPar.toString().substring(0, 50)); - assertFalse(so.hashCode() == 0); + assertNotEquals(0, so.hashCode()); - assertTrue(so.equals(so)); - assertTrue(so.equals(clonedPar)); - assertFalse(so.equals(null)); - assertFalse(so.equals((Object) "Hello")); - assertFalse(so.equals(new AxStateOutput(AxReferenceKey.getNullKey(), eKey, nsKey))); - assertFalse(so.equals(new AxStateOutput(soKey, new AxArtifactKey(), nsKey))); - assertFalse(so.equals(new AxStateOutput(soKey, eKey, new AxReferenceKey()))); - assertTrue(so.equals(new AxStateOutput(soKey, eKey, nsKey))); + assertEquals(so, so); + assertEquals(so, clonedPar); + assertNotNull(so); + assertNotEquals(so, (Object) "Hello"); + assertNotEquals(so, new AxStateOutput(AxReferenceKey.getNullKey(), eKey, nsKey)); + assertNotEquals(so, new AxStateOutput(soKey, new AxArtifactKey(), nsKey)); + assertNotEquals(so, new AxStateOutput(soKey, eKey, new AxReferenceKey())); + assertEquals(so, new AxStateOutput(soKey, eKey, nsKey)); assertEquals(0, so.compareTo(so)); assertEquals(0, so.compareTo(clonedPar)); diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/StateTaskReferenceTest.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/StateTaskReferenceTest.java index aa5dd6109..31012c68c 100644 --- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/StateTaskReferenceTest.java +++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/StateTaskReferenceTest.java @@ -23,10 +23,8 @@ package org.onap.policy.apex.model.policymodel.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; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; @@ -114,18 +112,17 @@ public class StateTaskReferenceTest { AxStateTaskReference clonedStRef = new AxStateTaskReference(stRef); assertEquals("AxStateTaskReference:(stateKey=AxReferenceKey:(par", clonedStRef.toString().substring(0, 50)); - assertFalse(stRef.hashCode() == 0); - - assertTrue(stRef.equals(stRef)); - assertTrue(stRef.equals(clonedStRef)); - assertFalse(stRef.equals(null)); - assertFalse(stRef.equals((Object) "Hello")); - assertFalse(stRef.equals( - new AxStateTaskReference(AxReferenceKey.getNullKey(), AxStateTaskOutputType.LOGIC, soKey))); - assertFalse(stRef.equals(new AxStateTaskReference(stRefKey, AxStateTaskOutputType.DIRECT, soKey))); - assertFalse(stRef - .equals(new AxStateTaskReference(stRefKey, AxStateTaskOutputType.LOGIC, new AxReferenceKey()))); - assertTrue(stRef.equals(new AxStateTaskReference(stRefKey, AxStateTaskOutputType.LOGIC, soKey))); + assertNotEquals(0, stRef.hashCode()); + + assertEquals(stRef, stRef); + assertEquals(stRef, clonedStRef); + assertNotNull(stRef); + assertNotEquals(stRef, (Object) "Hello"); + assertNotEquals(stRef, new AxStateTaskReference(AxReferenceKey.getNullKey(), AxStateTaskOutputType.LOGIC, + soKey)); + assertNotEquals(stRef, new AxStateTaskReference(stRefKey, AxStateTaskOutputType.DIRECT, soKey)); + assertNotEquals(stRef, new AxStateTaskReference(stRefKey, AxStateTaskOutputType.LOGIC, new AxReferenceKey())); + assertEquals(stRef, new AxStateTaskReference(stRefKey, AxStateTaskOutputType.LOGIC, soKey)); assertNotNull(new AxStateTaskReference(new AxReferenceKey(), new AxArtifactKey(), AxStateTaskOutputType.UNDEFINED, new AxReferenceKey())); diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/StateTest.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/StateTest.java index ef015e798..4c5ad4ad3 100644 --- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/StateTest.java +++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/StateTest.java @@ -23,10 +23,8 @@ package org.onap.policy.apex.model.policymodel.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; import java.util.Set; import java.util.TreeMap; @@ -384,40 +382,40 @@ public class StateTest { final AxState clonedState = new AxState(state); assertEquals("AxState:(stateKey=AxReferenceKey:(parent", clonedState.toString().substring(0, 40)); - assertFalse(state.hashCode() == 0); + assertNotEquals(0, state.hashCode()); - assertTrue(state.equals(state)); - assertTrue(state.equals(clonedState)); - assertFalse(state.equals(null)); - assertFalse(state.equals((Object) "Hello")); - assertFalse(state.equals(new AxState(new AxStateParamsBuilder().key(new AxReferenceKey()).trigger(triggerKey) + assertEquals(state, state); + assertEquals(state, clonedState); + assertNotNull(state); + assertNotEquals(state, (Object) "Hello"); + assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(new AxReferenceKey()).trigger(triggerKey) .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl) - .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap)))); - assertFalse(state.equals(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(new AxArtifactKey()) + .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap))); + assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(new AxArtifactKey()) .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl) - .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap)))); - assertFalse(state.equals(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) + .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap))); + assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) .stateOutputs(soEmptyMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl) - .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap)))); - assertFalse(state.equals(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) + .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap))); + assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) .stateOutputs(soMap).contextAlbumReferenceSet(ctxtEmptySet).taskSelectionLogic(tsl) - .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap)))); - assertFalse(state.equals(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) + .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap))); + assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet) .taskSelectionLogic(new AxTaskSelectionLogic()).stateFinalizerLogicMap(sflMap) - .defaultTask(defTaskKey).taskReferenceMap(trMap)))); - assertFalse(state.equals(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) + .defaultTask(defTaskKey).taskReferenceMap(trMap))); + assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl) - .stateFinalizerLogicMap(sflEmptyMap).defaultTask(defTaskKey).taskReferenceMap(trMap)))); - assertFalse(state.equals(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) + .stateFinalizerLogicMap(sflEmptyMap).defaultTask(defTaskKey).taskReferenceMap(trMap))); + assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl) - .stateFinalizerLogicMap(sflMap).defaultTask(new AxArtifactKey()).taskReferenceMap(trMap)))); - assertFalse(state.equals(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) - .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl) - .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trEmptyMap)))); - assertTrue(state.equals(new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) + .stateFinalizerLogicMap(sflMap).defaultTask(new AxArtifactKey()).taskReferenceMap(trMap))); + assertNotEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl) - .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap)))); + .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trEmptyMap))); + assertEquals(state, new AxState(new AxStateParamsBuilder().key(stateKey).trigger(triggerKey) + .stateOutputs(soMap).contextAlbumReferenceSet(ctxtSet).taskSelectionLogic(tsl) + .stateFinalizerLogicMap(sflMap).defaultTask(defTaskKey).taskReferenceMap(trMap))); assertEquals(0, state.compareTo(state)); assertEquals(0, state.compareTo(clonedState)); diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TaskParameterTest.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TaskParameterTest.java index 3dcc5e8d7..e14dec059 100644 --- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TaskParameterTest.java +++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TaskParameterTest.java @@ -23,10 +23,8 @@ package org.onap.policy.apex.model.policymodel.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; import static org.junit.Assert.fail; import org.junit.Test; @@ -37,7 +35,7 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult.Validat /** * Test task parameters. - * + * * @author Liam Fallon (liam.fallon@ericsson.com) */ public class TaskParameterTest { @@ -90,15 +88,15 @@ public class TaskParameterTest { assertEquals("AxTaskParameter:(key=AxReferenceKey:(parentKeyName=ParParentName,parentKeyVersion=0.0.1," + "parentLocalName=PLN,localName=LN),defaultValue=DefaultValue)", clonedPar.toString()); - assertFalse(par.hashCode() == 0); + assertNotEquals(0, par.hashCode()); - assertTrue(par.equals(par)); - assertTrue(par.equals(clonedPar)); - assertFalse(par.equals(null)); - assertFalse(par.equals((Object) "Hello")); - assertFalse(par.equals(new AxTaskParameter(AxReferenceKey.getNullKey(), "DefaultValue"))); - assertFalse(par.equals(new AxTaskParameter(parKey, "OtherDefaultValue"))); - assertTrue(par.equals(new AxTaskParameter(parKey, "DefaultValue"))); + assertEquals(par, par); + assertEquals(par, clonedPar); + assertNotNull(par); + assertNotEquals(par, (Object) "Hello"); + assertNotEquals(par, new AxTaskParameter(AxReferenceKey.getNullKey(), "DefaultValue")); + assertNotEquals(par, new AxTaskParameter(parKey, "OtherDefaultValue")); + assertEquals(par, new AxTaskParameter(parKey, "DefaultValue")); assertEquals(0, par.compareTo(par)); assertEquals(0, par.compareTo(clonedPar)); diff --git a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TasksTest.java b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TasksTest.java index 9089e1837..17601c878 100644 --- a/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TasksTest.java +++ b/model/policy-model/src/test/java/org/onap/policy/apex/model/policymodel/concepts/TasksTest.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========================================================= */ @@ -40,7 +40,7 @@ import org.onap.policy.apex.model.eventmodel.concepts.AxOutputField; /** * Test policy tasks. - * + * * @author Liam Fallon (liam.fallon@ericsson.com) */ public class TasksTest { diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java index 71968fffe..53c8d1fb8 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/ContextUpdate.java @@ -1,7 +1,7 @@ /*- * ============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. @@ -21,14 +21,12 @@ package org.onap.policy.apex.testsuites.integration.context.distribution; -import static org.junit.Assert.assertEquals; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.APEX_DISTRIBUTOR; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.DATE_CONTEXT_ALBUM; -import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.EXCEPTION_MESSAGE; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.LONG_CONTEXT_ALBUM; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.MAP_CONTEXT_ALBUM; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.TIME_ZONE; @@ -41,7 +39,6 @@ import java.util.Locale; import java.util.Map; import org.onap.policy.apex.context.ContextAlbum; import org.onap.policy.apex.context.ContextException; -import org.onap.policy.apex.context.ContextRuntimeException; import org.onap.policy.apex.context.Distributor; import org.onap.policy.apex.context.impl.distribution.DistributorFactory; import org.onap.policy.apex.context.test.concepts.TestContextDateItem; @@ -89,43 +86,18 @@ public class ContextUpdate { longContextAlbum.put(NUMBER_ZERO, 0); longContextAlbum.put(NUMBER_ZERO, NUMBER_ZERO); - try { - longContextAlbum.put(NUMBER_ZERO, ZERO); - fail(EXCEPTION_MESSAGE); - } catch (final ContextRuntimeException e) { - assertEquals("Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\":" + assertThatThrownBy(() -> longContextAlbum.put(NUMBER_ZERO, ZERO)) + .hasMessage("Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\":" + " LongContextAlbum:0.0.1: object \"zero\" of class \"java.lang.String\" not compatible with" - + " class \"java.lang.Long\"", e.getMessage()); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } - - try { - longContextAlbum.put(NUMBER_ZERO, ""); - fail(EXCEPTION_MESSAGE); - } catch (final ContextRuntimeException e) { - assertEquals( - "Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\": LongContextAlbum" - + ":0.0.1: object \"\" of class \"java.lang.String\" not compatible with class \"java.lang.Long\"", - e.getMessage()); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } - - try { - longContextAlbum.put(NUMBER_ZERO, null); - fail(EXCEPTION_MESSAGE); - } catch (final ContextRuntimeException e) { - assertEquals("album \"LongContextAlbum:0.0.1\" null values are illegal on key \"0\" for put()", - e.getMessage()); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } - - try { - longContextAlbum.put(null, null); - fail(EXCEPTION_MESSAGE); - } catch (final ContextRuntimeException e) { - assertEquals("album \"LongContextAlbum:0.0.1\" null keys are illegal on keys for put()", e.getMessage()); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } + + " class \"java.lang.Long\""); + assertThatThrownBy(() -> longContextAlbum.put(NUMBER_ZERO, "")) + .hasMessage("Failed to set context value for key \"0\" in album \"LongContextAlbum:0.0.1\": " + + "LongContextAlbum:0.0.1: object \"\" of class \"java.lang.String\" not " + + "compatible with class \"java.lang.Long\""); + assertThatThrownBy(() -> longContextAlbum.put(NUMBER_ZERO, null)) + .hasMessage("album \"LongContextAlbum:0.0.1\" null values are illegal on key \"0\" for put()"); + assertThatThrownBy(() -> longContextAlbum.put(null, null)) + .hasMessage("album \"LongContextAlbum:0.0.1\" null keys are illegal on keys for put()"); assertNull(dateContextAlbum.put("date0", tciA)); assertTrue(dateContextAlbum.put("date0", tciA).equals(tciA)); diff --git a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/SequentialContextInstantiation.java b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/SequentialContextInstantiation.java index 3f690f0b5..287dd6147 100644 --- a/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/SequentialContextInstantiation.java +++ b/testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/distribution/SequentialContextInstantiation.java @@ -1,7 +1,7 @@ /*- * ============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. @@ -21,16 +21,15 @@ package org.onap.policy.apex.testsuites.integration.context.distribution; +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 static org.junit.Assert.fail; import static org.onap.policy.apex.testsuites.integration.context.factory.TestContextAlbumFactory.createMultiAlbumsContextModel; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.APEX_DISTRIBUTOR; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.BYTE_VAL; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.DATE_CONTEXT_ALBUM; -import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.EXCEPTION_MESSAGE; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.FLOAT_VAL; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.INT_VAL; import static org.onap.policy.apex.testsuites.integration.context.utils.Constants.LONG_VAL; @@ -115,15 +114,10 @@ public class SequentialContextInstantiation { final TestContextDateTzItem tci9 = getTestContextDateTzItem(testDate); - try { - dateAlbum.put("tci9", tci9); - } catch (final Exception e) { - final String message = "class \"" + TestContextDateTzItem.class.getName() - + "\" not compatible with class \"" + TestContextDateLocaleItem.class.getName() - + "\""; - assertTrue(e.getMessage().contains(message)); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } + assertThatThrownBy(() -> dateAlbum.put("tci9", tci9)) + .hasMessageContaining("class \"" + TestContextDateTzItem.class.getName() + + "\" not compatible with class \"" + TestContextDateLocaleItem.class.getName() + + "\""); final TestContextDateLocaleItem tciA01 = new TestContextDateLocaleItem(tciA00); final TestContextDateLocaleItem tciA02 = new TestContextDateLocaleItem(tciA00); @@ -145,14 +139,9 @@ public class SequentialContextInstantiation { // Get another reference to the album final ContextAlbum dateAlbum1 = getContextAlbum(DATE_CONTEXT_ALBUM, contextDistributor); - try { - dateAlbum1.putAll(valueMap1); - fail(EXCEPTION_MESSAGE); - } catch (final Exception e) { - assertTrue(e.getMessage().endsWith("not compatible with class \"" - + TestContextDateLocaleItem.class.getName() + "\"")); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } + assertThatThrownBy(() -> dateAlbum1.putAll(valueMap1)) + .hasMessageContaining("not compatible with class \"" + + TestContextDateLocaleItem.class.getName() + "\""); assertEquals(5, dateAlbum1.size()); valueMap1.clear(); @@ -217,23 +206,14 @@ public class SequentialContextInstantiation { } private void assertContains(final ContextAlbum dateAlbum, final TestContextDateLocaleItem tciA01) { - try { - dateAlbum.containsKey(null); - fail(EXCEPTION_MESSAGE); - } catch (final Exception e) { - assertEquals("null values are illegal on method parameter \"key\"", e.getMessage()); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } + assertThatThrownBy(() -> dateAlbum.containsKey(null)) + .hasMessageContaining("null values are illegal on method parameter \"key\""); assertTrue(dateAlbum.containsKey(ITEM05)); assertTrue(!dateAlbum.containsKey("Item07")); - try { - dateAlbum.containsValue(null); - } catch (final Exception e) { - assertEquals("null values are illegal on method parameter \"value\"", e.getMessage()); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } + assertThatThrownBy(() -> dateAlbum.containsValue(null)) + .hasMessageContaining("null values are illegal on method parameter \"value\""); assertTrue(dateAlbum.containsValue(tciA01)); assertTrue(!dateAlbum.containsValue("Hello")); @@ -241,32 +221,18 @@ public class SequentialContextInstantiation { private void assertAlbumGetAndPutMethods(final ContextAlbum dateAlbum, final TestContextDateLocaleItem tciA03, final TestContextDateLocaleItem tciA00) { - try { - dateAlbum.get(null); - fail(EXCEPTION_MESSAGE); - } catch (final Exception e) { - assertEquals("album \"DateContextAlbum:0.0.1\" null keys are illegal on keys for get()", e.getMessage()); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } + assertThatThrownBy(() -> dateAlbum.get(null)) + .hasMessageContaining("album \"DateContextAlbum:0.0.1\" null keys are illegal on keys for get()"); final Object aObject = dateAlbum.get(ITEM03); assertEquals(tciA03, aObject); - try { - dateAlbum.put(null, null); - fail(EXCEPTION_MESSAGE); - } catch (final Exception e) { - assertEquals("album \"DateContextAlbum:0.0.1\" null keys are illegal on keys for put()", e.getMessage()); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } + assertThatThrownBy(() -> dateAlbum.put(null, null)) + .hasMessageContaining("album \"DateContextAlbum:0.0.1\" null keys are illegal on keys for put()"); // Put null ContextItem should work (return null) - try { - dateAlbum.put(ITEM_NULL, null); - } catch (final Exception e) { - assertEquals("album \"DateContextAlbum:0.0.1\" null values are illegal on key \"ItemNull\" for put()", - e.getMessage()); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } + assertThatThrownBy(() -> dateAlbum.put(ITEM_NULL, null)) + .hasMessageContaining("album \"DateContextAlbum:0.0.1\" null values are illegal on " + + "key \"ItemNull\" for put()"); // Should return null assertNull(dateAlbum.get(ITEM_NULL)); @@ -279,37 +245,21 @@ public class SequentialContextInstantiation { retItem = (TestContextDateLocaleItem) dateAlbum.put(ITEM03, tciA03); assertEquals(tciA03Clone, retItem); - try { - dateAlbum.put(ITEM_NULL, null); - fail(EXCEPTION_MESSAGE); - - } catch (final Exception e) { - assert ("album \"DateContextAlbum:0.0.1\" null values are illegal on key \"ItemNull\" for put()" - .equals(e.getMessage())); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } + assertThatThrownBy(() -> dateAlbum.put(ITEM_NULL, null)) + .hasMessageContaining("album \"DateContextAlbum:0.0.1\" null values are illegal on " + + "key \"ItemNull\" for put()"); dateAlbum.put(TEST_AA, tciA00); assertEquals(tciA00, dateAlbum.get(TEST_AA)); // Should print warning - try { - dateAlbum.put(TEST_AA, null); - fail(EXCEPTION_MESSAGE); - } catch (final Exception e) { - assertEquals("album \"DateContextAlbum:0.0.1\" null values are illegal on key \"TestAA\" for put()", - e.getMessage()); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } + assertThatThrownBy(() -> dateAlbum.put(TEST_AA, null)) + .hasMessageContaining("album \"DateContextAlbum:0.0.1\" null values are illegal on key \"TestAA\" " + + "for put()"); assertEquals(8, dateAlbum.size()); - try { - dateAlbum.put(TEST_AB, null); - fail(EXCEPTION_MESSAGE); - } catch (final Exception e) { - assertEquals("album \"DateContextAlbum:0.0.1\" null values are illegal on key \"TestAB\" for put()", - e.getMessage()); - LOGGER.trace(NORMAL_TEST_EXCEPTION, e); - } + assertThatThrownBy(() -> dateAlbum.put(TEST_AB, null)) + .hasMessageContaining("album \"DateContextAlbum:0.0.1\" null values are illegal on key \"TestAB\" " + + "for put()"); assertEquals(8, dateAlbum.size()); } diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/event/TestEventInstantiation.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/event/TestEventInstantiation.java index 5f89db675..bf883d761 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/event/TestEventInstantiation.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/event/TestEventInstantiation.java @@ -21,6 +21,7 @@ package org.onap.policy.apex.testsuites.integration.executor.event; +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; @@ -168,19 +169,10 @@ public class TestEventInstantiation { value = event.get("TestMatchCase"); assertNull(value); - try { - event.put("TestMatchCase", "Hello"); - } catch (final Exception e) { - assertEquals("Event0000:0.0.1:NULL:TestMatchCase: object \"Hello\" of class \"java.lang.String\" " - + "not compatible with class \"java.lang.Byte\"", e.getMessage()); - } - - try { - event.put("TestMatchCase", 123.45); - } catch (final Exception e) { - assertEquals("Event0000:0.0.1:NULL:TestMatchCase: object \"123.45\" of class \"java.lang.Double\" " - + "not compatible with class \"java.lang.Byte\"", e.getMessage()); - } + assertThatThrownBy(() -> event.put("TestMatchCase", "Hello")) + .hasMessage("Event0000:0.0.1:NULL:TestMatchCase: object \"Hello\" of class \"java.lang.String\" " + + "not compatible with class \"java.lang.Byte\""); + event.put("TestMatchCase", 123.45); event.put("TestMatchCase", Byte.valueOf("16")); diff --git a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexModelExport.java b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexModelExport.java index d73b51147..aaf640bb4 100644 --- a/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexModelExport.java +++ b/testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/handling/TestApexModelExport.java @@ -1,19 +1,20 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 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========================================================= */ @@ -99,15 +100,8 @@ public class TestApexModelExport { exportPolicyList.clear(); exportPolicyList.add(new AxArtifactKey("NonExistentPolicy", "0.0.1")); - try { - final AxPolicyModel emptyExportedModel = PolicyModelSplitter.getSubPolicyModel(model, exportPolicyList); - assertNotNull(emptyExportedModel); - } catch (final Exception e) { - assertTrue(e.getMessage() - .equals("new model is invalid:\n" + "***validation of model failed***\n" - + "AxPolicies:Policies:0.0.1 - policyMap may not be null or empty\n" - + "AxEvents:Events:0.0.1 - eventMap may not be null or empty\n" - + "********************************")); - } + final AxPolicyModel emptyExportedModel = PolicyModelSplitter.getSubPolicyModel(model, exportPolicyList); + assertNotNull(emptyExportedModel); + } } diff --git a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/engine/ApexServiceModelUpdateTest.java b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/engine/ApexServiceModelUpdateTest.java index 7ba309cc0..fdc60d765 100644 --- a/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/engine/ApexServiceModelUpdateTest.java +++ b/testsuites/integration/integration-uservice-test/src/test/java/org/onap/policy/apex/testsuites/integration/uservice/engine/ApexServiceModelUpdateTest.java @@ -21,10 +21,10 @@ package org.onap.policy.apex.testsuites.integration.uservice.engine; +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.assertTrue; -import static org.junit.Assert.fail; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -159,14 +159,9 @@ public class ApexServiceModelUpdateTest { */ @Test public void testNoModelStart() { - try { - service.startAll(); - fail("Engine should not start with no model"); - } catch (final Exception e) { - e.printStackTrace(); - assertEquals("start()<-Machine-1_process-1_engine-1-0:0.0.0,STOPPED, cannot start engine, " - + "engine has not been initialized, its model is not loaded", e.getMessage()); - } + assertThatThrownBy(service::startAll) + .hasMessage("start()<-Machine-1_process-1_engine-1-0:0.0.0,STOPPED, cannot start engine, " + + "engine has not been initialized, its model is not loaded"); } /** @@ -227,16 +222,10 @@ public class ApexServiceModelUpdateTest { final AxPolicyModel incoPolicyModel0 = new AxPolicyModel(apexSamplePolicyModel); incoPolicyModel0.getKey().setName("INCOMPATIBLE"); - try { - service.updateModel(parameters.getEngineKey(), incoPolicyModel0, false); - fail("model update should fail on incompatible model without force being true"); - } catch (final Exception e) { - System.err.println(e.getMessage()); - assertEquals("apex model update failed, supplied model with key \"INCOMPATIBLE:0.0.1\" is not a compatible " - + "model update from the existing engine model " + "with key \"SamplePolicyModelJAVASCRIPT:0.0.1\"", - e.getMessage()); - } - + assertThatThrownBy(() -> service.updateModel(parameters.getEngineKey(), incoPolicyModel0, false)) + .hasMessage("apex model update failed, supplied model with key \"INCOMPATIBLE:0.0.1\" is " + + "not a compatible model update from the existing engine model " + "with key " + + "\"SamplePolicyModelJAVASCRIPT:0.0.1\""); // Still on old model sendEvents(); @@ -244,17 +233,10 @@ public class ApexServiceModelUpdateTest { final AxPolicyModel incoPolicyModel1 = new AxPolicyModel(apexSamplePolicyModel); incoPolicyModel1.getKey().setVersion("1.0.1"); - try { - service.updateModel(parameters.getEngineKey(), incoPolicyModel1, false); - fail("model update should fail on incompatible model without force being true"); - } catch (final Exception e) { - System.err.println(e.getMessage()); - e.printStackTrace(); - assertEquals("apex model update failed, supplied model with key \"SamplePolicyModelJAVASCRIPT:1.0.1\" " - + "is not a compatible model update from the existing engine model with key " - + "\"SamplePolicyModelJAVASCRIPT:0.0.1\"", e.getMessage()); - } - + assertThatThrownBy(() -> service.updateModel(parameters.getEngineKey(), incoPolicyModel1, false)) + .hasMessage("apex model update failed, supplied model with key \"SamplePolicyModelJAVASCRIPT:" + + "1.0.1\" is not a compatible model update from the existing engine model with key " + + "\"SamplePolicyModelJAVASCRIPT:0.0.1\""); // Still on old model sendEvents(); diff --git a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParametersHandlerTest.java b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParametersHandlerTest.java index 9a099b54e..6b15ae454 100644 --- a/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParametersHandlerTest.java +++ b/testsuites/performance/performance-benchmark-test/src/test/java/org/onap/policy/apex/testsuites/performance/benchmark/eventgenerator/EventGeneratorParametersHandlerTest.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 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. @@ -20,11 +21,10 @@ package org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator; +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 static org.junit.Assert.fail; import org.apache.commons.cli.ParseException; import org.junit.Test; @@ -35,287 +35,165 @@ import org.junit.Test; public class EventGeneratorParametersHandlerTest { @Test - public void testEventGeneratorParameterhandler() { + public void testEventGeneratorParameterhandler() throws ParseException { EventGeneratorParameterHandler handler = new EventGeneratorParameterHandler(); assertNotNull(handler); - try { - String[] args = - { "-h" }; - EventGeneratorParameters parameters = handler.parse(args); - assertNull(parameters); - assertEquals("usage: EventGenerator [options...]", - handler.getHelp(EventGenerator.class.getSimpleName()).substring(0, 34)); - } catch (ParseException pe) { - fail("test should not throw an exception"); - } - - try { - String[] args = - {}; - EventGeneratorParameters parameters = handler.parse(args); - assertEquals("localhost", parameters.getHost()); - assertEquals(32801, parameters.getPort()); - } catch (ParseException pe) { - fail("test should not throw an exception"); - } - - try { - String[] args = - { "-H", "MyHost" }; - EventGeneratorParameters parameters = handler.parse(args); - assertEquals("MyHost", parameters.getHost()); - } catch (ParseException pe) { - fail("test should not throw an exception"); - } - - try { - String[] args = - { "-p", "12345" }; - EventGeneratorParameters parameters = handler.parse(args); - assertEquals(12345, parameters.getPort()); - } catch (ParseException pe) { - fail("test should not throw an exception"); - } - - try { - String[] args = - { "-H", "MyHost", "-p", "12345" }; - EventGeneratorParameters parameters = handler.parse(args); - assertEquals("MyHost", parameters.getHost()); - assertEquals(12345, parameters.getPort()); - } catch (ParseException pe) { - fail("test should not throw an exception"); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/Valid.json" }; - EventGeneratorParameters parameters = handler.parse(args); - assertEquals("ValidPars", parameters.getName()); - assertEquals("FileHost", parameters.getHost()); - assertEquals(54321, parameters.getPort()); - } catch (ParseException pe) { - fail("test should not throw an exception"); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/Default.json" }; - EventGeneratorParameters parameters = handler.parse(args); - assertEquals("localhost", parameters.getHost()); - assertEquals(32801, parameters.getPort()); - } catch (ParseException pe) { - fail("test should not throw an exception"); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/Default.json", "-bc", "100" }; - EventGeneratorParameters parameters = handler.parse(args); - assertEquals(100, parameters.getBatchCount()); - } catch (ParseException pe) { - fail("test should not throw an exception"); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/Default.json", "-bc", "-1" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("specified parameters are not valid: parameter group \"EventGeneratorParameters\" " + String[] args = { "-h" }; + EventGeneratorParameters parameters = handler.parse(args); + assertNull(parameters); + assertEquals("usage: EventGenerator [options...]", + handler.getHelp(EventGenerator.class.getSimpleName()).substring(0, 34)); + + args = new String[] {}; + parameters = handler.parse(args); + assertEquals("localhost", parameters.getHost()); + assertEquals(32801, parameters.getPort()); + + args = new String[] { "-H", "MyHost" }; + parameters = handler.parse(args); + assertEquals("MyHost", parameters.getHost()); + + args = new String[] { "-p", "12345" }; + parameters = handler.parse(args); + assertEquals(12345, parameters.getPort()); + + + args = new String[] { "-H", "MyHost", "-p", "12345" }; + parameters = handler.parse(args); + assertEquals("MyHost", parameters.getHost()); + assertEquals(12345, parameters.getPort()); + + args = new String[] { "-c", "src/test/resources/parameters/unit/Valid.json" }; + parameters = handler.parse(args); + assertEquals("ValidPars", parameters.getName()); + assertEquals("FileHost", parameters.getHost()); + assertEquals(54321, parameters.getPort()); + + args = new String[] { "-c", "src/test/resources/parameters/unit/Default.json" }; + parameters = handler.parse(args); + assertEquals("localhost", parameters.getHost()); + assertEquals(32801, parameters.getPort()); + + args = new String[] { "-c", "src/test/resources/parameters/unit/Default.json", "-bc", "100" }; + parameters = handler.parse(args); + assertEquals(100, parameters.getBatchCount()); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-c", "src/test/resources/parameters/unit/Default.json", "-bc", "-1" }; + handler.parse(arguments); + }).hasMessage("specified parameters are not valid: parameter group \"EventGeneratorParameters\" " + "type \"org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator." + "EventGeneratorParameters\" INVALID, parameter group has status INVALID\n" + " field \"batchCount\" type \"int\" value \"-1\" INVALID, " + "batchCount must be an integer with a value of zero or more, " - + "zero means generate batches forever\n", pe.getMessage()); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/Default.json", "-bs", "12345" }; - EventGeneratorParameters parameters = handler.parse(args); - assertEquals(12345, parameters.getBatchSize()); - } catch (ParseException pe) { - fail("test should not throw an exception"); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/Default.json", "-bs", "0" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("specified parameters are not valid: parameter group \"EventGeneratorParameters\" " + + "zero means generate batches forever\n"); + args = new String[] { "-c", "src/test/resources/parameters/unit/Default.json", "-bs", "12345" }; + parameters = handler.parse(args); + assertEquals(12345, parameters.getBatchSize()); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-c", "src/test/resources/parameters/unit/Default.json", "-bs", "0" }; + handler.parse(arguments); + }).hasMessage("specified parameters are not valid: parameter group \"EventGeneratorParameters\" " + "type \"org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator." + "EventGeneratorParameters\" INVALID, parameter group has status INVALID\n" + " field \"batchSize\" type \"int\" value \"0\" INVALID, " - + "batchSize must be an integer greater than zero\n", pe.getMessage()); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/Default.json", "-bd", "1000" }; - EventGeneratorParameters parameters = handler.parse(args); - assertEquals(1000, parameters.getDelayBetweenBatches()); - } catch (ParseException pe) { - fail("test should not throw an exception"); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/Default.json", "-bd", "-1" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("specified parameters are not valid: parameter group \"EventGeneratorParameters\" " + + "batchSize must be an integer greater than zero\n"); + args = new String[] { "-c", "src/test/resources/parameters/unit/Default.json", "-bd", "1000" }; + parameters = handler.parse(args); + assertEquals(1000, parameters.getDelayBetweenBatches()); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-c", "src/test/resources/parameters/unit/Default.json", "-bd", "-1" }; + handler.parse(arguments); + }).hasMessage("specified parameters are not valid: parameter group \"EventGeneratorParameters\" " + "type \"org.onap.policy.apex.testsuites.performance.benchmark.eventgenerator." + "EventGeneratorParameters\" INVALID, parameter group has status INVALID\n" + " field \"batchSize\" type \"int\" value \"1\" INVALID, " - + "batchSize must be an integer with a value of zero or more\n", pe.getMessage()); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/Default.json", "-o", "Zooby" }; - EventGeneratorParameters parameters = handler.parse(args); - assertEquals("Zooby", parameters.getOutFile()); - } catch (ParseException pe) { - fail("test should not throw an exception"); - } - - try { - String[] args = - { "-z" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("Unrecognized option: -z", pe.getMessage()); - } - - try { - String[] args = - { "-H" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("Missing argument for option: H", pe.getMessage()); - } - - try { - String[] args = - { "-p" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("Missing argument for option: p", pe.getMessage()); - } - - try { - String[] args = - { "-p", "12345", "-z" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("Unrecognized option: -z", pe.getMessage()); - } - - try { - String[] args = - { "-p", "12345", "somethingElse" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("too many command line arguments specified : [somethingElse]", pe.getMessage()); - } - - try { - String[] args = - { "-c" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("Missing argument for option: c", pe.getMessage()); - } - - try { - String[] args = - { "-H", "MyHost", "-c", "src/test/resources/parameters/unit/Valid.json" }; - EventGeneratorParameters pars = handler.parse(args); - assertEquals("MyHost", pars.getHost()); - - } catch (ParseException pe) { - fail("test should not throw an exception"); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/NonExistant.json" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertTrue(pe.getMessage().startsWith("Could not read parameters from configuration file ")); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/BadHost.json" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("Error parsing JSON parameters from configuration file " + + "batchSize must be an integer with a value of zero or more\n"); + + args = new String[] { "-c", "src/test/resources/parameters/unit/Default.json", "-o", "Zooby" }; + parameters = handler.parse(args); + assertEquals("Zooby", parameters.getOutFile()); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-z" }; + handler.parse(arguments); + }).hasMessage("Unrecognized option: -z"); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-H" }; + handler.parse(arguments); + }).hasMessage("Missing argument for option: H"); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-p" }; + handler.parse(arguments); + }).hasMessage("Missing argument for option: p"); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-p", "12345", "-z" }; + handler.parse(arguments); + }).hasMessage("Unrecognized option: -z"); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-p", "12345", "somethingElse" }; + handler.parse(arguments); + }).hasMessage("too many command line arguments specified : [somethingElse]"); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-c" }; + handler.parse(arguments); + }).hasMessage("Missing argument for option: c"); + + args = new String[] { "-H", "MyHost", "-c", "src/test/resources/parameters/unit/Valid.json" }; + parameters = handler.parse(args); + assertEquals("MyHost", parameters.getHost()); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-c", "src/test/resources/parameters/unit/NonExistant.json" }; + handler.parse(arguments); + }).hasMessageStartingWith("Could not read parameters from configuration file "); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-c", "src/test/resources/parameters/unit/BadHost.json" }; + handler.parse(arguments); + }).hasMessage("Error parsing JSON parameters from configuration file " + "\"src/test/resources/parameters/unit/BadHost.json\": " + "com.google.gson.stream.MalformedJsonException: " - + "Unexpected value at line 3 column 14 path $.host", pe.getMessage()); - } + + "Unexpected value at line 3 column 14 path $.host"); - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/BadPort.json" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("Error parsing JSON parameters from configuration file " + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-c", "src/test/resources/parameters/unit/BadPort.json" }; + handler.parse(arguments); + }).hasMessage("Error parsing JSON parameters from configuration file " + "\"src/test/resources/parameters/unit/BadPort.json\": " + "java.lang.IllegalStateException: Expected an int " - + "but was BOOLEAN at line 4 column 18 path $.port", pe.getMessage()); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/Empty.json" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("No parameters found in configuration file " - + "\"src/test/resources/parameters/unit/Empty.json\"", pe.getMessage()); - } - - try { - String[] args = - { "-c", "src/test/resources/parameters/unit/NullHost.json" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("specified parameters are not valid: parameter group \"ValidPars\" " + + "but was BOOLEAN at line 4 column 18 path $.port"); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-c", "src/test/resources/parameters/unit/Empty.json" }; + handler.parse(arguments); + }).hasMessage("No parameters found in configuration file " + + "\"src/test/resources/parameters/unit/Empty.json\""); + + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-c", "src/test/resources/parameters/unit/NullHost.json" }; + handler.parse(arguments); + }).hasMessage("specified parameters are not valid: parameter group \"ValidPars\" " + "type \"org.onap.policy.apex.testsuites.performance." + "benchmark.eventgenerator.EventGeneratorParameters\" INVALID, " + "parameter group has status INVALID\n" + " field \"host\" type \"java.lang.String\" " - + "value \"null\" INVALID, host must be a non-blank string\n", pe.getMessage()); - } + + "value \"null\" INVALID, host must be a non-blank string\n"); - try { - String[] args = - { "-p", "1023" }; - handler.parse(args); - fail("test should throw an exception"); - } catch (ParseException pe) { - assertEquals("specified parameters are not valid: parameter group \"" + assertThatThrownBy(() -> { + String[] arguments = new String[] { "-p", "1023" }; + handler.parse(arguments); + }).hasMessage("specified parameters are not valid: parameter group \"" + "EventGeneratorParameters\" type \"org.onap.policy.apex.testsuites.performance.benchmark." + "eventgenerator.EventGeneratorParameters\" INVALID, parameter group has status INVALID\n" + " field \"port\" type \"int\" value \"1023\" INVALID, " - + "port must be an integer between 1024 and 65535 inclusive\n" + "", pe.getMessage()); - } + + "port must be an integer between 1024 and 65535 inclusive\n" + ""); } } |