diff options
author | 2022-09-26 16:57:55 +0800 | |
---|---|---|
committer | 2022-09-26 16:58:32 +0800 | |
commit | ead03c73657e3c46f87d82a34939b84ae35e8417 (patch) | |
tree | 98d434ad3be8930234e2c7e01928e3d76063318a /intentanalysis/src | |
parent | 1d3d6092e9db1daaac382eb0e859da65dc98a712 (diff) |
Add ImfRegInfo code .
Issue-ID: USECASEUI-696
Change-Id: I143d9c9aada3d9c0dfdbf5dae8cd04be0a2a3c5a
Signed-off-by: hekeguang <hekeguang@chinamobile.com>
Diffstat (limited to 'intentanalysis/src')
21 files changed, 100 insertions, 52 deletions
diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/ObjectType.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/ObjectType.java index afd1a04..d636856 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/ObjectType.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/enums/ObjectType.java @@ -20,8 +20,8 @@ import lombok.Setter; @Getter public enum ObjectType { - OBJECT1(0, "objectType1"), - OBJECT2(1, "objectType2"); + SLICING(0, "objectType1"), + CCVPN(1, "objectType2"); private int index; diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfo.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfo.java index 7b3ff5a..d6ab5b8 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfo.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfo.java @@ -26,9 +26,9 @@ import java.util.List; public class IntentManagementFunctionRegInfo { private String id; private String description; - private List<SupportArea> supportArea; + private String supportArea;//Separate multiple values with commas private String supportModel; - private List<SupportInterface> supportInterfaces; + private String supportInterfaces;//Separate multiple values with commas private String handleName; //distinguish internal or external function private IntentFunctionType intentFunctionType; diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceKnowledgeModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceKnowledgeModule.java index c1300f0..dd560ff 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceKnowledgeModule.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/cllassuranceIntentmgt/cllassurancemodule/CLLAssuranceKnowledgeModule.java @@ -15,13 +15,41 @@ */ package org.onap.usecaseui.intentanalysis.cllassuranceIntentmgt.cllassurancemodule; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.log4j.Log4j2; +import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang.StringUtils; +import org.onap.usecaseui.intentanalysis.adapters.aai.apicall.AAIAPICall; +import org.onap.usecaseui.intentanalysis.adapters.aai.apicall.AAIAuthConfig; import org.onap.usecaseui.intentanalysis.bean.models.Intent; import org.onap.usecaseui.intentanalysis.bean.models.IntentGoalBean; import org.onap.usecaseui.intentanalysis.intentBaseService.intentModule.KnowledgeModule; +import org.onap.usecaseui.intentanalysis.util.RestfulServices; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import retrofit2.Response; +import java.io.IOException; + +@Log4j2 @Component public class CLLAssuranceKnowledgeModule extends KnowledgeModule { + private AAIAPICall aaiapiCall; + @Autowired + AAIAuthConfig aaiAuthConfig; + + public AAIAPICall getAaiApiCall() { + if (null == aaiapiCall) { + this.aaiapiCall = RestfulServices.create(AAIAPICall.class, + aaiAuthConfig.getUserName(), aaiAuthConfig.getPassword()); + } + return this.aaiapiCall; + } + + public void setAAIApiCall(AAIAPICall aaiApiCall) { + this.aaiapiCall = aaiApiCall; + } + @Override public IntentGoalBean intentCognition(Intent intent) { return null; @@ -41,4 +69,29 @@ public class CLLAssuranceKnowledgeModule extends KnowledgeModule { public boolean recieveDeleteIntent() { return false; } + + /** + * healthy check + */ + int getSystemStatus(Intent intent) { + try { + if (CollectionUtils.isEmpty(intent.getIntentExpectations())) { + return -1; + } + String objectInstance = intent.getIntentExpectations().get(0).getExpectationObject().getObjectInstance(); + if (StringUtils.isEmpty(objectInstance)){ + return -1; + } + Response<JSONObject> response = getAaiApiCall().getInstanceInfo(objectInstance).execute(); + log.debug(response.toString()); + if (response.isSuccessful()) { + // TODO: 2022/9/20 judge by the return result + } + log.error("getIntentInstance Create Statue Error:" + response.toString()); + return -1; + } catch (Exception ex) { + log.error("Details:" + ex.getMessage()); + return 0; + } + } } diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModule.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModule.java index 968add2..507ada8 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModule.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModule.java @@ -40,7 +40,7 @@ public class FormatIntentInputDecisionModule extends DecisionModule { public IntentManagementFunction exploreIntentHandlers(IntentGoalBean intentGoalBean) { // if intentName contain cll return if (intentGoalBean.getIntent().getIntentName().toLowerCase(Locale.ROOT).contains("cll")) { - return (IntentManagementFunction) applicationContext.getBean(CLLBusinessIntentManagementFunction.class.getSimpleName()); + return (IntentManagementFunction) applicationContext.getBean(CLLBusinessIntentManagementFunction.class.getSimpleName()); } return null; } @@ -63,7 +63,7 @@ public class FormatIntentInputDecisionModule extends DecisionModule { boolean needDecompostion = needDecompostion(intentGoalBean); if (needDecompostion) { intentDecomposition(intentGoalBean); - }else{ + } else { intentMap.put(intentGoalBean, exploreIntentHandlers(intentGoalBean)); } return intentMap; diff --git a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ImfRegInfoServiceImpl.java b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ImfRegInfoServiceImpl.java index 595acad..ad636d8 100644 --- a/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ImfRegInfoServiceImpl.java +++ b/intentanalysis/src/main/java/org/onap/usecaseui/intentanalysis/service/impl/ImfRegInfoServiceImpl.java @@ -16,6 +16,7 @@ package org.onap.usecaseui.intentanalysis.service.impl; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import org.onap.usecaseui.intentanalysis.bean.enums.IntentGoalType; import org.onap.usecaseui.intentanalysis.bean.enums.SupportArea; @@ -58,14 +59,15 @@ public class ImfRegInfoServiceImpl implements ImfRegInfoService { for (IntentManagementFunctionRegInfo imfr : imfRegInfoList) { boolean containsArea = false; boolean containsInterface = false; - for (SupportArea area : imfr.getSupportArea()) { - if (StringUtils.containsIgnoreCase(intentName, area.name())) { + for (String area : imfr.getSupportArea().split(",")) { + if (StringUtils.containsIgnoreCase(intentName, area)) { containsArea = true; break; } } - for (SupportInterface supInterface : imfr.getSupportInterfaces()) { - if (StringUtils.containsIgnoreCase(supInterface.name(), intentGoalType.name())) { + if (!containsArea) break; + for (String supInterface : imfr.getSupportInterfaces().split(",")) { + if (StringUtils.containsIgnoreCase(supInterface, intentGoalType.name())) { containsInterface = true; break; } @@ -74,7 +76,7 @@ public class ImfRegInfoServiceImpl implements ImfRegInfoService { imfList.add(imfr); } } - if (!Optional.ofNullable(imfList).isPresent()) { + if (CollectionUtils.isEmpty(imfList)) { log.info("The intent name is %s not find the corresponding IntentManagementFunction", intentName); } //TODO call probe interface if fail intentFulfilmentInfo throw exception diff --git a/intentanalysis/src/main/resources/intent-analysis-init.sql b/intentanalysis/src/main/resources/intent-analysis-init.sql index e5af890..88773f6 100644 --- a/intentanalysis/src/main/resources/intent-analysis-init.sql +++ b/intentanalysis/src/main/resources/intent-analysis-init.sql @@ -64,9 +64,9 @@ create table if not exists condition( create table if not exists intent_management_function_reg_info( imfr_info_id varchar(255) primary key, imfr_info_description varchar(255), - support_area text ARRAY, + support_area varchar(255), support_model varchar(255), - support_interfaces text ARRAY, + support_interfaces varchar(255), handle_name varchar(255), intent_function_type varchar(255) );
\ No newline at end of file diff --git a/intentanalysis/src/main/resources/mybatis/sql/ConditionMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/ConditionMapper.xml index 012dfca..ccce147 100644 --- a/intentanalysis/src/main/resources/mybatis/sql/ConditionMapper.xml +++ b/intentanalysis/src/main/resources/mybatis/sql/ConditionMapper.xml @@ -27,13 +27,13 @@ </insert> <!-- 这里的查询有问题--> <select id="selectConditionList" resultType="org.onap.usecaseui.intentanalysis.bean.models.Condition"> - select condition_id conditionId, condition_name conditionName, operator_type operator, condition_value conditionValue + select condition_id conditionId, condition_name conditionName, operator_type "operator", condition_value conditionValue from condition where parent_id = #{parentId} </select> <select id="selectCondition" resultType="org.onap.usecaseui.intentanalysis.bean.models.Condition"> - select condition_id conditionId, condition_name conditionName, operator_type operator, condition_value conditionValue + select condition_id conditionId, condition_name conditionName, operator_type "operator", condition_value conditionValue from condition where condition_id = #{conditionId} </select> diff --git a/intentanalysis/src/main/resources/mybatis/sql/IMFRegInfoMapper.xml b/intentanalysis/src/main/resources/mybatis/sql/IMFRegInfoMapper.xml index fd632b3..504c244 100644 --- a/intentanalysis/src/main/resources/mybatis/sql/IMFRegInfoMapper.xml +++ b/intentanalysis/src/main/resources/mybatis/sql/IMFRegInfoMapper.xml @@ -5,19 +5,16 @@ <mapper namespace="org.onap.usecaseui.intentanalysis.mapper.IMFRegInfoMapper"> - <resultMap id="mapIMFRInfo" type="org.onap.usecaseui.intentanalysis.bean.models.IntentManagementFunctionRegInfo"> - <result column="support_area" property="supportArea" typeHandler="org.onap.usecaseui.intentanalysis.util.ListArrayTypeHandler" jdbcType="ARRAY" javaType="java.util.List"/> - <result column="support_interfaces" property="supportInterfaces" typeHandler="org.onap.usecaseui.intentanalysis.util.ListArrayTypeHandler" jdbcType="ARRAY" javaType="java.util.List"/> - </resultMap> - <insert id="insertIMFRegInfoRegInfo"> insert into intent_management_function_reg_info(imfr_info_id,imfr_info_description,support_area,support_model,support_interfaces,handle_name,intent_function_type) values (#{imfregInfo.id}, #{imfregInfo.description},#{imfregInfo.supportArea} , #{imfregInfo.supportModel},#{imfregInfo.supportInterfaces},#{imfregInfo.handleName},#{imfregInfo.intentFunctionType}) </insert> - <select id="getImfRegInfoList" resultMap="mapIMFRInfo"> - select * from intent_management_function_reg_info + <select id="getImfRegInfoList" resultType="org.onap.usecaseui.intentanalysis.bean.models.IntentManagementFunctionRegInfo"> + select imfr_info_id id,imfr_info_description description,support_area supportArea, support_model supportModel, + support_interfaces supportInterfaces,handle_name handleName,intent_function_type intentFunctionType + from intent_management_function_reg_info </select> </mapper> 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 52d8fbc..7f9ca6d 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 @@ -42,7 +42,7 @@ public class ExpectationObjectTest { @Test public void testSetExpectationObjectTest() { ExpectationObject test = new ExpectationObject(); - test.setObjectType(ObjectType.OBJECT1); + test.setObjectType(ObjectType.SLICING); test.setObjectInstance(""); test.setObjectContexts(new ArrayList<>()); } diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfoTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfoTest.java index 2368077..3cc406d 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfoTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/bean/models/IntentManagementFunctionRegInfoTest.java @@ -50,9 +50,9 @@ public class IntentManagementFunctionRegInfoTest { IntentManagementFunctionRegInfo test = new IntentManagementFunctionRegInfo(); test.setId(""); test.setDescription(""); - test.setSupportArea(new ArrayList<SupportArea>()); + test.setSupportArea(""); test.setSupportModel(""); - test.setSupportInterfaces(new ArrayList<>()); + test.setSupportInterfaces(""); test.setHandleName(""); test.setIntentFunctionType(IntentFunctionType.INTERNALFUNCTION); } diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModuleTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModuleTest.java index ea1717f..9050a6f 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModuleTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputDecisionModuleTest.java @@ -58,7 +58,7 @@ public class FormatIntentInputDecisionModuleTest { delivery.setExpectationName("deliveryExpectation"); delivery.setExpectationType(ExpectationType.DELIVERY); ExpectationObject expectationObject = new ExpectationObject(); - expectationObject.setObjectType(ObjectType.OBJECT1); + expectationObject.setObjectType(ObjectType.SLICING); //expetationTarget Context FulfilmentInfo is empty delivery.setExpectationObject(expectationObject); expectationList.add(delivery); @@ -68,7 +68,7 @@ public class FormatIntentInputDecisionModuleTest { assurance.setExpectationName("assuranceExpectation"); assurance.setExpectationType(ExpectationType.ASSURANCE); ExpectationObject expectationObject1 = new ExpectationObject(); - expectationObject1.setObjectType(ObjectType.OBJECT2); + expectationObject1.setObjectType(ObjectType.CCVPN); //expetationTarget Context FulfilmentInfo is empty assurance.setExpectationObject(expectationObject1); expectationList.add(assurance); diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputKnowledgeModuleTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputKnowledgeModuleTest.java index eae144e..9b2a6c4 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputKnowledgeModuleTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/formatintentinputMgt/formatintentinputModule/FormatIntentInputKnowledgeModuleTest.java @@ -61,7 +61,7 @@ public class FormatIntentInputKnowledgeModuleTest { delivery.setExpectationName("deliveryExpectation"); delivery.setExpectationType(ExpectationType.DELIVERY); ExpectationObject expectationObject = new ExpectationObject(); - expectationObject.setObjectType(ObjectType.OBJECT1); + expectationObject.setObjectType(ObjectType.SLICING); //expetationTarget Context FulfilmentInfo is empty delivery.setExpectationObject(expectationObject); List<ExpectationTarget> expectationTargets = new ArrayList<>(); @@ -76,7 +76,7 @@ public class FormatIntentInputKnowledgeModuleTest { assurance.setExpectationName("assuranceExpectation"); assurance.setExpectationType(ExpectationType.ASSURANCE); ExpectationObject expectationObject1 = new ExpectationObject(); - expectationObject1.setObjectType(ObjectType.OBJECT2); + expectationObject1.setObjectType(ObjectType.CCVPN); //expetationTarget Context FulfilmentInfo is empty assurance.setExpectationObject(expectationObject1); diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDefinitionServiceTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDefinitionServiceTest.java index 1394f50..6aaeb02 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDefinitionServiceTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDefinitionServiceTest.java @@ -65,7 +65,7 @@ public class IntentDefinitionServiceTest { delivery.setExpectationName("deliveryExpectation"); delivery.setExpectationType(ExpectationType.DELIVERY); ExpectationObject expectationObject = new ExpectationObject(); - expectationObject.setObjectType(ObjectType.OBJECT1); + expectationObject.setObjectType(ObjectType.SLICING); //expetationTarget Context FulfilmentInfo is empty delivery.setExpectationObject(expectationObject); expectationList.add(delivery); @@ -75,7 +75,7 @@ public class IntentDefinitionServiceTest { assurance.setExpectationName("assuranceExpectation"); assurance.setExpectationType(ExpectationType.ASSURANCE); ExpectationObject expectationObject1 = new ExpectationObject(); - expectationObject1.setObjectType(ObjectType.OBJECT2); + expectationObject1.setObjectType(ObjectType.CCVPN); //expetationTarget Context FulfilmentInfo is empty assurance.setExpectationObject(expectationObject1); expectationList.add(assurance); diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDetectionServiceTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDetectionServiceTest.java index fa67cf2..1957c63 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDetectionServiceTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDetectionServiceTest.java @@ -60,7 +60,7 @@ public class IntentDetectionServiceTest { delivery.setExpectationName("deliveryExpectation"); delivery.setExpectationType(ExpectationType.DELIVERY); ExpectationObject expectationObject = new ExpectationObject(); - expectationObject.setObjectType(ObjectType.OBJECT1); + expectationObject.setObjectType(ObjectType.SLICING); //expetationTarget Context FulfilmentInfo is empty delivery.setExpectationObject(expectationObject); expectationList.add(delivery); @@ -70,7 +70,7 @@ public class IntentDetectionServiceTest { assurance.setExpectationName("assuranceExpectation"); assurance.setExpectationType(ExpectationType.ASSURANCE); ExpectationObject expectationObject1 = new ExpectationObject(); - expectationObject1.setObjectType(ObjectType.OBJECT2); + expectationObject1.setObjectType(ObjectType.CCVPN); //expetationTarget Context FulfilmentInfo is empty assurance.setExpectationObject(expectationObject1); expectationList.add(assurance); diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDistributionServiceTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDistributionServiceTest.java index 882770c..6453048 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDistributionServiceTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentDistributionServiceTest.java @@ -63,7 +63,7 @@ public class IntentDistributionServiceTest { delivery.setExpectationName("deliveryExpectation"); delivery.setExpectationType(ExpectationType.DELIVERY); ExpectationObject expectationObject = new ExpectationObject(); - expectationObject.setObjectType(ObjectType.OBJECT1); + expectationObject.setObjectType(ObjectType.SLICING); //expetationTarget Context FulfilmentInfo is empty delivery.setExpectationObject(expectationObject); expectationList.add(delivery); @@ -73,7 +73,7 @@ public class IntentDistributionServiceTest { assurance.setExpectationName("assuranceExpectation"); assurance.setExpectationType(ExpectationType.ASSURANCE); ExpectationObject expectationObject1 = new ExpectationObject(); - expectationObject1.setObjectType(ObjectType.OBJECT2); + expectationObject1.setObjectType(ObjectType.CCVPN); //expetationTarget Context FulfilmentInfo is empty assurance.setExpectationObject(expectationObject1); expectationList.add(assurance); diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentInvestigationServiceTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentInvestigationServiceTest.java index ea0bf7a..774325e 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentInvestigationServiceTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentInvestigationServiceTest.java @@ -64,7 +64,7 @@ public class IntentInvestigationServiceTest { delivery.setExpectationName("deliveryExpectation"); delivery.setExpectationType(ExpectationType.DELIVERY); ExpectationObject expectationObject = new ExpectationObject(); - expectationObject.setObjectType(ObjectType.OBJECT1); + expectationObject.setObjectType(ObjectType.SLICING); //expetationTarget Context FulfilmentInfo is empty delivery.setExpectationObject(expectationObject); expectationList.add(delivery); @@ -74,7 +74,7 @@ public class IntentInvestigationServiceTest { assurance.setExpectationName("assuranceExpectation"); assurance.setExpectationType(ExpectationType.ASSURANCE); ExpectationObject expectationObject1 = new ExpectationObject(); - expectationObject1.setObjectType(ObjectType.OBJECT2); + expectationObject1.setObjectType(ObjectType.CCVPN); //expetationTarget Context FulfilmentInfo is empty assurance.setExpectationObject(expectationObject1); expectationList.add(assurance); diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentOperationServiceTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentOperationServiceTest.java index a806fb3..f52cfa3 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentOperationServiceTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentOperationServiceTest.java @@ -61,7 +61,7 @@ public class IntentOperationServiceTest { delivery.setExpectationName("deliveryExpectation"); delivery.setExpectationType(ExpectationType.DELIVERY); ExpectationObject expectationObject = new ExpectationObject(); - expectationObject.setObjectType(ObjectType.OBJECT1); + expectationObject.setObjectType(ObjectType.SLICING); //expetationTarget Context FulfilmentInfo is empty delivery.setExpectationObject(expectationObject); expectationList.add(delivery); @@ -71,7 +71,7 @@ public class IntentOperationServiceTest { assurance.setExpectationName("assuranceExpectation"); assurance.setExpectationType(ExpectationType.ASSURANCE); ExpectationObject expectationObject1 = new ExpectationObject(); - expectationObject1.setObjectType(ObjectType.OBJECT2); + expectationObject1.setObjectType(ObjectType.CCVPN); //expetationTarget Context FulfilmentInfo is empty assurance.setExpectationObject(expectationObject1); expectationList.add(assurance); diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentProcessServiceTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentProcessServiceTest.java index d58652c..c9a42d7 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentProcessServiceTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/intentBaseService/intentProcessService/IntentProcessServiceTest.java @@ -79,7 +79,7 @@ public class IntentProcessServiceTest { delivery.setExpectationName("deliveryExpectation"); delivery.setExpectationType(ExpectationType.DELIVERY); ExpectationObject expectationObject = new ExpectationObject(); - expectationObject.setObjectType(ObjectType.OBJECT1); + expectationObject.setObjectType(ObjectType.SLICING); //expetationTarget Context FulfilmentInfo is empty delivery.setExpectationObject(expectationObject); expectationList.add(delivery); @@ -89,7 +89,7 @@ public class IntentProcessServiceTest { assurance.setExpectationName("assuranceExpectation"); assurance.setExpectationType(ExpectationType.ASSURANCE); ExpectationObject expectationObject1 = new ExpectationObject(); - expectationObject1.setObjectType(ObjectType.OBJECT2); + expectationObject1.setObjectType(ObjectType.CCVPN); //expetationTarget Context FulfilmentInfo is empty assurance.setExpectationObject(expectationObject1); expectationList.add(assurance); 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 c7dcee1..41f96cb 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 @@ -32,7 +32,7 @@ class ExpectationObjectServiceTest extends AbstractJUnit4SpringContextTests { public ExpectationObject createTestObject(String testName) { ExpectationObject expectationObject = new ExpectationObject(); - expectationObject.setObjectType(ObjectType.OBJECT1); + expectationObject.setObjectType(ObjectType.SLICING); expectationObject.setObjectInstance("true"); List<Context> contextList = new ArrayList<>(); @@ -99,7 +99,7 @@ class ExpectationObjectServiceTest extends AbstractJUnit4SpringContextTests { @Test void testUpdateExpectationObjectToNullSuccess() { ExpectationObject expectationObject = new ExpectationObject(); - expectationObject.setObjectType(ObjectType.OBJECT2); + expectationObject.setObjectType(ObjectType.CCVPN); try { expectationObjectService.updateExpectationObject(expectationObject, TEST_EXPECTATION_ID_2); diff --git a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/impl/ImfRegInfoServiceImplTest.java b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/impl/ImfRegInfoServiceImplTest.java index 3606eea..4067b4f 100644 --- a/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/impl/ImfRegInfoServiceImplTest.java +++ b/intentanalysis/src/test/java/org/onap/usecaseui/intentanalysis/service/impl/ImfRegInfoServiceImplTest.java @@ -73,13 +73,9 @@ public class ImfRegInfoServiceImplTest { public void itCanGetImfRegInfoListWithIntentGoalBean() { List<IntentManagementFunctionRegInfo> list = new ArrayList<>(); IntentManagementFunctionRegInfo info = new IntentManagementFunctionRegInfo(); - List<SupportArea> areas = new ArrayList<>(); - areas.add(SupportArea.CLLBUSINESS); - info.setSupportArea(areas); + info.setSupportArea("CLLBUSINESS"); - List<SupportInterface> interList = new ArrayList<>(); - interList.add(SupportInterface.CREATE); - info.setSupportInterfaces(interList); + info.setSupportInterfaces("CREATE"); list.add(info); diff --git a/intentanalysis/src/test/resources/intentdb-test-data.sql b/intentanalysis/src/test/resources/intentdb-test-data.sql index ec183fe..a20f814 100644 --- a/intentanalysis/src/test/resources/intentdb-test-data.sql +++ b/intentanalysis/src/test/resources/intentdb-test-data.sql @@ -106,10 +106,10 @@ values ('intentId2', 'NOT_FULFILLED', 'COMPLIANT', 'NotFulfilledReason'); -- Records of intent_management_function_reg_info -- ---------------------------- INSERT INTO intent_management_function_reg_info(imfr_info_id,imfr_info_description,support_area,support_model,support_interfaces,handle_name,intent_function_type) -VALUES ('CLLBusinessId','CLLBusiness','{"CLLBUSINESS"}',null,'{"CREATE","DELETE","UPDATE","SEARCH"}','CLLBusinessIntentManagementFunction','INTERNALFUNCTION'); +VALUES ('CLLBusinessId','CLLBusiness','CLLBUSINESS',null,'CREATE,DELETE,UPDATE,SEARCH}','CLLBusinessIntentManagementFunction','INTERNALFUNCTION'); INSERT INTO intent_management_function_reg_info(imfr_info_id,imfr_info_description,support_area,support_model,support_interfaces,handle_name,intent_function_type) -VALUES ('CLLDeliveryId','CLLDelivery','{"CLLBUSINESS","DELIVERY"}',null,'{"CREATE","DELETE","UPDATE","SEARCH"}','CLLDeliveryIntentManagementFunction','INTERNALFUNCTION'); +VALUES ('CLLDeliveryId','CLLDelivery','CLLBUSINESS,DELIVERY',null,'CREATE,DELETE,UPDATE,SEARCH}','CLLDeliveryIntentManagementFunction','INTERNALFUNCTION'); INSERT INTO intent_management_function_reg_info(imfr_info_id,imfr_info_description,support_area,support_model,support_interfaces,handle_name,intent_function_type) -VALUES ('CLLAssuranceId','CLLAssurance','{"CLLBUSINESS","ASSURANCE"}',null,'{"CREATE","DELETE","UPDATE","SEARCH"}','CLLAssuranceIntentManagementFunction','INTERNALFUNCTION');
\ No newline at end of file +VALUES ('CLLAssuranceId','CLLAssurance','CLLBUSINESS,ASSURANCE',null,'CREATE,DELETE,UPDATE,SEARCH','CLLAssuranceIntentManagementFunction','INTERNALFUNCTION');
\ No newline at end of file |