aboutsummaryrefslogtreecommitdiffstats
path: root/intentanalysis/src/test
diff options
context:
space:
mode:
authorkaixiliu <liukaixi@chinamobile.com>2023-08-29 10:45:18 +0800
committerkaixiliu <liukaixi@chinamobile.com>2023-08-29 10:45:56 +0800
commitb32a2d2af10287b1420f8c54b6a90b6aeabff12f (patch)
tree754e63eb3a7fed43304ac4cc71c2b1c511deea71 /intentanalysis/src/test
parentd87439a9b1e844c130ab1581e3fd174f401a498d (diff)
Modify Intent Model
Issue-ID: USECASEUI-819 Change-Id: I63041d772aac1e4591d2f8d71be7f699c25be3a1 Signed-off-by: kaixiliu <liukaixi@chinamobile.com>
Diffstat (limited to 'intentanalysis/src/test')
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationObjectTest.java3
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceActuationModuleTest.java5
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/clldeliveryIntentmgt/clldeliverymodule/CLLDeliveryActuationModuleTest.java5
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/ExpectationObjectServiceTest.java3
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/ExpectationServiceTest.java3
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/IntentServiceTest.java5
-rw-r--r--intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/impl/IntentReportServiceTest.java6
-rw-r--r--intentanalysis/src/test/resources/intent.json6
-rw-r--r--intentanalysis/src/test/resources/intentdb-test-data.sql12
-rw-r--r--intentanalysis/src/test/resources/intentdb-test-init.sql1
10 files changed, 27 insertions, 22 deletions
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationObjectTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationObjectTest.java
index 7f9ca6d..3b854f6 100644
--- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationObjectTest.java
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/ExpectationObjectTest.java
@@ -21,6 +21,7 @@ import org.junit.Test;
import org.onap.usecaseui.intentanalysis.bean.enums.ObjectType;
import java.util.ArrayList;
+import java.util.Collections;
public class ExpectationObjectTest {
@Before
@@ -43,7 +44,7 @@ public class ExpectationObjectTest {
public void testSetExpectationObjectTest() {
ExpectationObject test = new ExpectationObject();
test.setObjectType(ObjectType.SLICING);
- test.setObjectInstance("");
+ test.setObjectInstance(Collections.singletonList(""));
test.setObjectContexts(new ArrayList<>());
}
}
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceActuationModuleTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceActuationModuleTest.java
index 95cb3e0..7b1948a 100644
--- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceActuationModuleTest.java
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceActuationModuleTest.java
@@ -34,6 +34,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import static org.mockito.ArgumentMatchers.any;
@@ -61,7 +62,7 @@ public class CLLAssuranceActuationModuleTest {
deliveryExpectation.setExpectationName("CLL Delivery Expectation");
deliveryExpectation.setExpectationType(ExpectationType.DELIVERY);
ExpectationObject expectationObject = new ExpectationObject();
- expectationObject.setObjectInstance("");
+ expectationObject.setObjectInstance(Collections.singletonList(""));
deliveryExpectation.setExpectationObject(expectationObject);
List<ExpectationTarget> targetList = new ArrayList<>();
@@ -85,7 +86,7 @@ public class CLLAssuranceActuationModuleTest {
Expectation assuranceExceptation = new Expectation();
assuranceExceptation.setExpectationType(ExpectationType.ASSURANCE);
ExpectationObject expectationObject2 = new ExpectationObject();
- expectationObject2.setObjectInstance("");
+ expectationObject2.setObjectInstance(Collections.singletonList(""));
assuranceExceptation.setExpectationObject(expectationObject2);
expectationList.add(assuranceExceptation);
intent.setIntentExpectations(expectationList);
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/clldeliveryIntentmgt/clldeliverymodule/CLLDeliveryActuationModuleTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/clldeliveryIntentmgt/clldeliverymodule/CLLDeliveryActuationModuleTest.java
index c88070f..245752a 100644
--- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/clldeliveryIntentmgt/clldeliverymodule/CLLDeliveryActuationModuleTest.java
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/clldeliveryIntentmgt/clldeliverymodule/CLLDeliveryActuationModuleTest.java
@@ -34,6 +34,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import static org.mockito.ArgumentMatchers.any;
@@ -60,7 +61,7 @@ public class CLLDeliveryActuationModuleTest {
List<Expectation> expectationList = new ArrayList<>();
Expectation exp = new Expectation();
ExpectationObject expectationObject = new ExpectationObject();
- expectationObject.setObjectInstance("objectInstance");
+ expectationObject.setObjectInstance(Collections.singletonList("objectInstance"));
exp.setExpectationObject(expectationObject);
expectationList.add(exp);
originalIntent.setIntentExpectations(expectationList);
@@ -69,7 +70,7 @@ public class CLLDeliveryActuationModuleTest {
Expectation deliveryExpectation = new Expectation();
ExpectationObject deliveryExpectationObject = new ExpectationObject();
- deliveryExpectationObject.setObjectInstance("deliveryObjectInstance");
+ deliveryExpectationObject.setObjectInstance(Collections.singletonList("deliveryObjectInstance"));
deliveryExpectation.setExpectationObject(deliveryExpectationObject);
deliveryExpectation.setExpectationType(ExpectationType.DELIVERY);
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/ExpectationObjectServiceTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/ExpectationObjectServiceTest.java
index eb530d5..70ea564 100644
--- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/ExpectationObjectServiceTest.java
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/ExpectationObjectServiceTest.java
@@ -19,6 +19,7 @@
package org.onap.usecaseui.intentanalysis.service;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.junit.Assert;
import org.junit.jupiter.api.BeforeEach;
@@ -51,7 +52,7 @@ class ExpectationObjectServiceTest extends AbstractJUnit4SpringContextTests {
public ExpectationObject createTestObject(String testName) {
ExpectationObject expectationObject = new ExpectationObject();
expectationObject.setObjectType(ObjectType.SLICING);
- expectationObject.setObjectInstance("true");
+ expectationObject.setObjectInstance(Collections.singletonList("true"));
List<Context> contextList = new ArrayList<>();
Context context = new Context();
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/ExpectationServiceTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/ExpectationServiceTest.java
index 7539b6c..c4e77e8 100644
--- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/ExpectationServiceTest.java
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/ExpectationServiceTest.java
@@ -19,6 +19,7 @@
package org.onap.usecaseui.intentanalysis.service;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.junit.Assert;
import org.junit.jupiter.api.BeforeEach;
@@ -66,7 +67,7 @@ class ExpectationServiceTest extends AbstractJUnit4SpringContextTests {
ExpectationObject object = new ExpectationObject();
object.setObjectType(ObjectType.valueOf("SLICING"));
- object.setObjectInstance("objectInstance");
+ object.setObjectInstance(Collections.singletonList("objectInstance"));
Condition targetCondition = new Condition();
targetCondition.setConditionId(testName + "-conditionId");
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/IntentServiceTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/IntentServiceTest.java
index f1003f0..908e7d8 100644
--- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/IntentServiceTest.java
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/IntentServiceTest.java
@@ -16,6 +16,7 @@ package org.onap.usecaseui.intentanalysis.service;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.junit.Assert;
@@ -77,7 +78,7 @@ public class IntentServiceTest extends AbstractJUnit4SpringContextTests {
List<ExpectationTarget> expectationTargetList = new ArrayList<>();
expectationTargetList.add(target1);
object1.setObjectType(ObjectType.valueOf("SLICING"));
- object1.setObjectInstance("objectInstance");
+ object1.setObjectInstance(Collections.singletonList("objectInstance"));
expectation1.setExpectationId("expectationId");
expectation1.setExpectationName("expectationName");
expectation1.setExpectationType(ExpectationType.valueOf("DELIVERY"));
@@ -137,7 +138,7 @@ public class IntentServiceTest extends AbstractJUnit4SpringContextTests {
Expectation expectation = expectationList.get(0);
expectation.setExpectationName("new expectation name");
ExpectationObject expectationObject = expectation.getExpectationObject();
- expectationObject.setObjectInstance("new object instance");
+ expectationObject.setObjectInstance(Collections.singletonList("new object instance"));
expectation.setExpectationObject(expectationObject);
List<ExpectationTarget> expectationTargetList = expectation.getExpectationTargets();
ExpectationTarget expectationTarget = expectationTargetList.get(0);
diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/impl/IntentReportServiceTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/impl/IntentReportServiceTest.java
index da9c794..d195d7f 100644
--- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/impl/IntentReportServiceTest.java
+++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/impl/IntentReportServiceTest.java
@@ -21,7 +21,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.usecaseui.intentanalysis.IntentAnalysisApplicationTests;
import org.onap.usecaseui.intentanalysis.bean.models.*;
-import org.onap.usecaseui.intentanalysis.mapper.ExpectationObjectMapper;
+import org.onap.usecaseui.intentanalysis.mapper.ObjectInstanceMapper;
import org.onap.usecaseui.intentanalysis.service.IntentReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -41,11 +41,11 @@ public class IntentReportServiceTest {
ComponentNotificationServiceImpl componentNotificationService;
@Autowired
- private ExpectationObjectMapper expectationObjectMapper;
+ private ObjectInstanceMapper objectInstanceMapper;
@Test
public void getIntentReportByIntentIdTest() {
- List<String> allObjectInstances = expectationObjectMapper.getAllObjectInstances();
+ List<String> allObjectInstances = objectInstanceMapper.queryAllObjectInstances();
List<String> cll = new ArrayList<>();
for (String target : allObjectInstances) {
if (target != null && target.contains("cll")) {
diff --git a/intentanalysis/src/test/resources/intent.json b/intentanalysis/src/test/resources/intent.json
index 66ebb21..3fe6c83 100644
--- a/intentanalysis/src/test/resources/intent.json
+++ b/intentanalysis/src/test/resources/intent.json
@@ -8,7 +8,7 @@
"expectationType":"DELIVERY",
"expectationObject":{
"objectType":"CCVPN",
- "objectInstance":""
+ "objectInstance":[]
},
"expectationTargets":[
{
@@ -58,7 +58,7 @@
"expectationType":"ASSURANCE",
"expectationObject":{
"objectType":"CCVPN",
- "objectInstance":""
+ "objectInstance":[]
},
"expectationTargets":[
{
@@ -82,7 +82,7 @@
"expectationType":"REPORT",
"expectationObject":{
"objectType":"CCVPN",
- "objectInstance":""
+ "objectInstance":[]
},
"expectationTargets":[
{
diff --git a/intentanalysis/src/test/resources/intentdb-test-data.sql b/intentanalysis/src/test/resources/intentdb-test-data.sql
index 1105411..647ecd2 100644
--- a/intentanalysis/src/test/resources/intentdb-test-data.sql
+++ b/intentanalysis/src/test/resources/intentdb-test-data.sql
@@ -44,12 +44,12 @@ values ('expectation without affiliate 2', 'CLL Assurance Expectation', 'ASSURAN
-- ----------------------------
-- Records of expectation_object
-- ----------------------------
-MERGE INTO expectation_object (object_id, object_type, object_instance, expectation_id) KEY (object_id)
-values ('b1bc45a6-f396-4b65-857d-6d2312bfb352', 'SLICING', '', 'expectationId1');
-MERGE INTO expectation_object (object_id, object_type, object_instance, expectation_id) KEY (object_id)
-values ('931a8690-fa61-4c2b-a387-9e0fa6152136', 'CCVPN', '', 'expectationId2');
-MERGE INTO expectation_object (object_id, object_type, object_instance, expectation_id) KEY (object_id)
-values ('3f36bf22-3416-4150-8005-cdc406a43310', 'CCVPN', '', 'expectationId3');
+MERGE INTO expectation_object (object_id, object_type, expectation_id) KEY (object_id)
+values ('b1bc45a6-f396-4b65-857d-6d2312bfb352', 'SLICING', 'expectationId1');
+MERGE INTO expectation_object (object_id, object_type, expectation_id) KEY (object_id)
+values ('931a8690-fa61-4c2b-a387-9e0fa6152136', 'CCVPN', 'expectationId2');
+MERGE INTO expectation_object (object_id, object_type, expectation_id) KEY (object_id)
+values ('3f36bf22-3416-4150-8005-cdc406a43310', 'CCVPN', 'expectationId3');
-- ----------------------------
-- Records of expectation_target
diff --git a/intentanalysis/src/test/resources/intentdb-test-init.sql b/intentanalysis/src/test/resources/intentdb-test-init.sql
index 05ea854..3b150d6 100644
--- a/intentanalysis/src/test/resources/intentdb-test-init.sql
+++ b/intentanalysis/src/test/resources/intentdb-test-init.sql
@@ -44,7 +44,6 @@ create table if not exists expectation_object
object_id varchar(255) DEFAULT random_uuid(),
primary key (object_id),
object_type varchar(255),
- object_instance varchar(255),
expectation_id varchar(255)
);