From 93b5533e44728faa87c291fbf44120ea013fab51 Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Thu, 10 Mar 2022 14:39:42 +0000 Subject: Upgrade apex-pdp version in Apex Editor Upgrade apex-pdp version to 2.7.1-SNAPSHOT Fix NullPointerException in ModelHandler::setUuidAndDescription Allow parsing models from policy_type_impl or apexPolicyModel Remove deprecated Task input and output field functionality Fix JS REST calls and tests after JAXB to Gson changes Fix bugs in Task Edit form relating to task logic edit area Issue-ID: POLICY-3990 Signed-off-by: danielhanrahan Change-Id: I4f506889df46619a0178ab99c99c73ec2fd5a1e3 --- .../rest/handling/ApexEditorRestResourceTest.java | 70 ---------------------- .../src/test/resources/models/PolicyModel.json | 68 --------------------- .../src/test/resources/models/PolicyModel.yaml | 40 ------------- 3 files changed, 178 deletions(-) (limited to 'gui-editors/gui-editor-apex/src/test') diff --git a/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/ApexEditorRestResourceTest.java b/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/ApexEditorRestResourceTest.java index e5f24ff..90a9b4d 100644 --- a/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/ApexEditorRestResourceTest.java +++ b/gui-editors/gui-editor-apex/src/test/java/org/onap/policy/gui/editors/apex/rest/handling/ApexEditorRestResourceTest.java @@ -781,76 +781,6 @@ class ApexEditorRestResourceTest { result = apexRequest(post(BASE_URL + "/Task/Create", sessionId) .content(entityString).contentType(APPLICATION_JSON)); assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); - - entityString = "{" + "\"name\" : \"HowsItGoing\"," + "\"version\" : \"0.0.2\"," - + "\"inputFields\" : {\"IField0\" : {\"name\" : \"StringType\", \"version\" : \"0.0.1\", " - + "\"localName\" : \"IField0\", \"optional\" : false}}," - + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," - + "\"description\" : \"A description of hello\"" + "}"; - result = apexRequest(post(BASE_URL + "/Task/Create", sessionId) - .content(entityString).contentType(APPLICATION_JSON)); - assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); - - entityString = "{" + "\"name\" : \"Hi\"," + "\"version\" : \"0.0.2\"," - + "\"inputFields\" : {\"IField0\" : null}," - + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," - + "\"description\" : \"A description of hello\"" + "}"; - result = apexRequest(post(BASE_URL + "/Task/Create", sessionId) - .content(entityString).contentType(APPLICATION_JSON)); - assertEquals(ApexApiResult.Result.FAILED, result.getResult()); - - entityString = "{" + "\"name\" : \"GoodDay\"," + "\"version\" : \"0.0.2\"," - + "\"inputFields\" : {\"IField0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\", " - + "\"localName\" : \"IField0\", \"optional\" : false}}," - + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," - + "\"description\" : \"A description of hello\"" + "}"; - result = apexRequest(post(BASE_URL + "/Task/Create", sessionId) - .content(entityString).contentType(APPLICATION_JSON)); - assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); - - entityString = "{" + "\"name\" : \"Howdy\"," + "\"version\" : \"0.0.2\"," - + "\"inputFields\" : {\"IField0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\", " - + "\"localName\" : \"NotIField0\", \"optional\" : false}}," - + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," - + "\"description\" : \"A description of hello\"" + "}"; - result = apexRequest(post(BASE_URL + "/Task/Create", sessionId) - .content(entityString).contentType(APPLICATION_JSON)); - assertEquals(ApexApiResult.Result.FAILED, result.getResult()); - - entityString = "{" + "\"name\" : \"HowsItGoing2\"," + "\"version\" : \"0.0.2\"," - + "\"outputFields\" : {\"OField0\" : {\"name\" : \"StringType\", \"version\" : \"0.0.1\", " - + "\"localName\" : \"OField0\", \"optional\" : false}}," - + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," - + "\"description\" : \"A description of hello\"" + "}"; - result = apexRequest(post(BASE_URL + "/Task/Create", sessionId) - .content(entityString).contentType(APPLICATION_JSON)); - assertEquals(ApexApiResult.Result.SUCCESS, result.getResult()); - - entityString = "{" + "\"name\" : \"Hi2\"," + "\"version\" : \"0.0.2\"," - + "\"outputFields\" : {\"OField0\" : null}," - + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," - + "\"description\" : \"A description of hello\"" + "}"; - result = apexRequest(post(BASE_URL + "/Task/Create", sessionId) - .content(entityString).contentType(APPLICATION_JSON)); - assertEquals(ApexApiResult.Result.FAILED, result.getResult()); - - entityString = "{" + "\"name\" : \"GoodDay2\"," + "\"version\" : \"0.0.2\"," - + "\"outputFields\" : {\"OField0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\"," - + " \"localName\" : \"OField0\", \"optional\" : false}}," - + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," - + "\"description\" : \"A description of hello\"" + "}"; - result = apexRequest(post(BASE_URL + "/Task/Create", sessionId) - .content(entityString).contentType(APPLICATION_JSON)); - assertEquals(ApexApiResult.Result.CONCEPT_DOES_NOT_EXIST, result.getResult()); - - entityString = "{" + "\"name\" : \"Howdy2\"," + "\"version\" : \"0.0.2\"," - + "\"outputFields\" : {\"OField0\" : {\"name\" : \"NonExistantType\", \"version\" : \"0.0.1\", " - + "\"localName\" : \"NotOField0\", \"optional\" : false}}," - + "\"uuid\" : \"1fa2e430-f2b2-11e6-bc64-92361f002799\"," - + "\"description\" : \"A description of hello\"" + "}"; - result = apexRequest(post(BASE_URL + "/Task/Create", sessionId) - .content(entityString).contentType(APPLICATION_JSON)); - assertEquals(ApexApiResult.Result.FAILED, result.getResult()); } @Test diff --git a/gui-editors/gui-editor-apex/src/test/resources/models/PolicyModel.json b/gui-editors/gui-editor-apex/src/test/resources/models/PolicyModel.json index 9e3ea51..096e64a 100644 --- a/gui-editors/gui-editor-apex/src/test/resources/models/PolicyModel.json +++ b/gui-editors/gui-editor-apex/src/test/resources/models/PolicyModel.json @@ -439,74 +439,6 @@ "name": "task", "version": "0.0.1" }, - "inputFields": { - "entry": [ - { - "key": "IEPAR0", - "value": { - "key": "IEPAR0", - "fieldSchemaKey": { - "name": "eventContextItem0", - "version": "0.0.1" - } - } - }, - { - "key": "IEPAR1", - "value": { - "key": "IEPAR1", - "fieldSchemaKey": { - "name": "eventContextItem1", - "version": "0.0.1" - } - } - } - ] - }, - "outputFields": { - "entry": [ - { - "key": "OE0PAR0", - "value": { - "key": "OE0PAR0", - "fieldSchemaKey": { - "name": "eventContextItem0", - "version": "0.0.1" - } - } - }, - { - "key": "OE0PAR1", - "value": { - "key": "OE0PAR1", - "fieldSchemaKey": { - "name": "eventContextItem1", - "version": "0.0.1" - } - } - }, - { - "key": "OE1PAR0", - "value": { - "key": "OE1PAR0", - "fieldSchemaKey": { - "name": "eventContextItem0", - "version": "0.0.1" - } - } - }, - { - "key": "OE1PAR1", - "value": { - "key": "OE1PAR1", - "fieldSchemaKey": { - "name": "eventContextItem1", - "version": "0.0.1" - } - } - } - ] - }, "taskParameters": { "entry": [ { diff --git a/gui-editors/gui-editor-apex/src/test/resources/models/PolicyModel.yaml b/gui-editors/gui-editor-apex/src/test/resources/models/PolicyModel.yaml index 201085c..54bb592 100644 --- a/gui-editors/gui-editor-apex/src/test/resources/models/PolicyModel.yaml +++ b/gui-editors/gui-editor-apex/src/test/resources/models/PolicyModel.yaml @@ -307,46 +307,6 @@ topology_template: key: name: task version: 0.0.1 - inputFields: - entry: - - key: IEPAR0 - value: - key: IEPAR0 - fieldSchemaKey: - name: eventContextItem0 - version: 0.0.1 - - key: IEPAR1 - value: - key: IEPAR1 - fieldSchemaKey: - name: eventContextItem1 - version: 0.0.1 - outputFields: - entry: - - key: OE0PAR0 - value: - key: OE0PAR0 - fieldSchemaKey: - name: eventContextItem0 - version: 0.0.1 - - key: OE0PAR1 - value: - key: OE0PAR1 - fieldSchemaKey: - name: eventContextItem1 - version: 0.0.1 - - key: OE1PAR0 - value: - key: OE1PAR0 - fieldSchemaKey: - name: eventContextItem0 - version: 0.0.1 - - key: OE1PAR1 - value: - key: OE1PAR1 - fieldSchemaKey: - name: eventContextItem1 - version: 0.0.1 taskParameters: entry: - key: taskParameter0 -- cgit 1.2.3-korg