diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-11-06 12:02:46 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-11-07 12:41:09 +0000 |
commit | 53d8916cc60d97e2ce7ae345f8cc25f5602567da (patch) | |
tree | ee2f3a8e543c31993c51a58257354ccffb648dfe /client/client-editor/src/test/java | |
parent | 9dc414a0cabc9074e87a7c9cd5c3e5ceee733e5a (diff) |
Refactor unit test data
There were many copies of test policies and examples
strewn through the Apex unit tests. This change cleans
up the unit tests so that a single version of all example
policies is used in all tests.
Also added a new relative file root command line parameter
to Apex to allow the root of relative paths in configuration
files to be set.
Apologies for the size of this review but unfortunately
all of this must be done in one shot.
Issue-ID: POLICY-1252
Change-Id: Ibbb18fbf18e3897a1c61301d0a65e62bc643a0e9
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'client/client-editor/src/test/java')
-rw-r--r-- | client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/RestInterfaceTest.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/RestInterfaceTest.java b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/RestInterfaceTest.java index 7af4b37c3..260a898df 100644 --- a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/RestInterfaceTest.java +++ b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/RestInterfaceTest.java @@ -54,7 +54,7 @@ import org.onap.policy.common.utils.resources.ResourceUtils; public class RestInterfaceTest { // CHECKSTYLE:OFF: MagicNumber - private static final String TESTMODELFILE = "models/SamplePolicyModelMVEL.json"; + private static final String TESTMODELFILE = "models/PolicyModel.json"; private static final String TESTPORTNUM = "18989"; private static final long MAX_WAIT = 15000; // 15 sec private static final InputStream SYSIN = System.in; @@ -181,7 +181,7 @@ public class RestInterfaceTest { uploadPolicy(sessionId, localmodelString); final ApexApiResult responseMsg = target.path("editor/" + sessionId + "/Policy/Get") - .queryParam("name", "Policy0").queryParam("version", "0.0.1").request().get(ApexApiResult.class); + .queryParam("name", "policy").queryParam("version", "0.0.1").request().get(ApexApiResult.class); assertTrue(responseMsg.isOk()); // The string in responseMsg.Messages[0] is a JSON representation of a AxPolicy object. Lets parse it @@ -191,7 +191,7 @@ public class RestInterfaceTest { // AxPolicy returnedpolicy = RestUtils.getConceptFromJSON(returnedPolicyAsString, AxPolicy.class); // Extract the local copy of that policy from the local Apex Policy Model - final AxPolicy localpolicy = localmodel.getPolicies().get("Policy0", "0.0.1"); + final AxPolicy localpolicy = localmodel.getPolicies().get("policy", "0.0.1"); // Write that local copy of the AxPolicy object to a Json String, ten parse it again final ApexModelStringWriter<AxPolicy> apexModelWriter = new ApexModelStringWriter<>(false); |