summaryrefslogtreecommitdiffstats
path: root/components/slice-analysis-ms/src/test
diff options
context:
space:
mode:
authordecheng zhang <decheng.zhang@huawei.com>2022-03-23 20:46:04 -0400
committerdecheng zhang <decheng.zhang@huawei.com>2022-04-15 23:21:29 -0400
commitad5981f8e4969c41724885c830dda2cef304adf9 (patch)
tree486c291810101b2a325dab77c0c87b85a52e6f0c /components/slice-analysis-ms/src/test
parentb5ffdfa0e652e7d7b6c320d28fc78eded8a0763a (diff)
[SLICEANALYSIS] Bugfix1.1.1-slice-analysis-ms
- Add two attributes in policy payload: modelInvariantUuid and modelUuid - Fix MrTopicParams builder bug - Fix aai-subscriber server configuration and AAI-EVENT topic name - Add safeguard for processing network-policy-list - Fix AAI-EVENT entity format changes - Add debug log lines - Turn on scan in logback setting Issue-ID: DCAEGEN2-3141 Signed-off-by: decheng zhang <decheng.zhang@huawei.com> Change-Id: I0885035d85c55a6bff985b13f534c9db99e8fd09 Signed-off-by: decheng zhang <decheng.zhang@huawei.com>
Diffstat (limited to 'components/slice-analysis-ms/src/test')
-rw-r--r--components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluatorTest.java2
-rw-r--r--components/slice-analysis-ms/src/test/resources/aaiEventDmaapMsg.json60
-rw-r--r--components/slice-analysis-ms/src/test/resources/config_all.json4
-rw-r--r--components/slice-analysis-ms/src/test/resources/onsetMessage2.json2
4 files changed, 45 insertions, 23 deletions
diff --git a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluatorTest.java b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluatorTest.java
index c80a1495..f0ce5509 100644
--- a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluatorTest.java
+++ b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluatorTest.java
@@ -60,7 +60,7 @@ public class BandwidthEvaluatorTest {
@Test
public void postTest() {
- Event evt = mock(SimpleEvent.class);
+ Event evt = new SimpleEvent(null, "{}");
bandwidthEvaluator.post(evt);
Mockito.verify(bandwidthEvaluator, Mockito.atLeastOnce()).post(Mockito.any(Event.class));
}
diff --git a/components/slice-analysis-ms/src/test/resources/aaiEventDmaapMsg.json b/components/slice-analysis-ms/src/test/resources/aaiEventDmaapMsg.json
index 82faeeb4..d8cb65cd 100644
--- a/components/slice-analysis-ms/src/test/resources/aaiEventDmaapMsg.json
+++ b/components/slice-analysis-ms/src/test/resources/aaiEventDmaapMsg.json
@@ -1,25 +1,45 @@
{
- "cambria.partition":"AAI",
- "event-header":{
- "severity":"NORMAL",
- "entity-type":"service-instance",
- "top-entity-type":"service-instance",
- "entity-link":"/aai/v24/business/customers/customer/IBNCustomer/service-subscriptions/service-subscription/IBN/service-instances/service-instance/cll-01",
- "event-type":"AAI-EVENT","domain":"dev","action":"UPDATE",
- "sequence-number":"0","id":"51a99267-83ec-4f4f-a676-690ba527bf78",
- "source-name":"UUI","version":"v23","timestamp":"20210705-15:18:37:452"
+ "cambria.partition": "AAI",
+ "event-header": {
+ "severity": "NORMAL",
+ "entity-type": "service-instance",
+ "top-entity-type": "customer",
+ "entity-link": "/aai/v24/business/customers/customer/IBNCustomer/service-subscriptions/service-subscription/IBN/service-instances/service-instance/test",
+ "event-type": "AAI-EVENT",
+ "domain": "dev",
+ "action": "UPDATE",
+ "sequence-number": "0",
+ "id": "48c2016e-12cb-4f9f-ab25-5eaaf8da9fe8",
+ "source-name": "UUI",
+ "version": "v24",
+ "timestamp": "20220406-19:53:41:550"
},
"entity":{
- "service-instance-id":"0835fd19-6726-4081-befb-cc8932c47767",
- "service-instance-name":"sa1",
- "service-instance-location-id" : "cll-01",
- "service-type":"embb",
- "service-role":"service-profile",
- "environment-context":"01-06E442",
- "model-invariant-id":"8b94b147-2233-4e9f-b939-55c1b0e618ac",
- "model-version-id":"961ec436-7b16-4d71-9d62-9c4ca5dd94bf",
- "resource-version":"1645003055191",
- "orchestration-status":"deactivated",
- "bandwidth-total" : 8000
+ "global-customer-id": "IBNCustomer",
+ "subscriber-name": "IBNCustomer",
+ "service-subscriptions": {
+ "service-subscription": [
+ {
+ "service-type": "IBN",
+ "service-instances": {
+ "service-instance": [
+ {
+ "model-version-id": "6790ab0e-034f-11eb-adc1-0242ac120002",
+ "service-instance-id": "test",
+ "resource-version": "1649274821478",
+ "service-type": "IBN",
+ "service-instance-location-id": "460-00",
+ "service-role": "TN",
+ "environment-context": "001-100001",
+ "bandwidth-total": "4000",
+ "model-invariant-id": "6790ab0e-034f-11eb-adc1-0242ac120002",
+ "service-instance-name": "decheng-test-001",
+ "orchestration-status": "allocated"
+ }
+ ]
+ }
+ }
+ ]
+ }
}
}
diff --git a/components/slice-analysis-ms/src/test/resources/config_all.json b/components/slice-analysis-ms/src/test/resources/config_all.json
index b2998703..b48ca753 100644
--- a/components/slice-analysis-ms/src/test/resources/config_all.json
+++ b/components/slice-analysis-ms/src/test/resources/config_all.json
@@ -40,13 +40,13 @@
"aaf_password": null,
"api_key" : null,
"api_secret" : null,
- "servers" : ["message-router"],
+ "servers" : ["message-router:3904"],
"consumer_group" : "dcae_ccvpn_cl",
"consumer_instance" : "dcae_ccvpn_cl_aaievent",
"fetch_timeout" : 15000,
"fetch_limit" : 100,
"dmaap_info":{
- "topic_url":"https://message-router:3905/events/AAI_EVENT",
+ "topic_url":"http://message-router:3904/events/AAI-EVENT",
"client_role":"org.onap.dcae.aaiSub",
"location":"onap",
"client_id":"sdnr-sliceanalysis-1"
diff --git a/components/slice-analysis-ms/src/test/resources/onsetMessage2.json b/components/slice-analysis-ms/src/test/resources/onsetMessage2.json
index 530c831f..dbcbda4c 100644
--- a/components/slice-analysis-ms/src/test/resources/onsetMessage2.json
+++ b/components/slice-analysis-ms/src/test/resources/onsetMessage2.json
@@ -1,6 +1,8 @@
{
"closedLoopControlName": "ControlLoop-CCVPN-CLL-227e8b00-dbeb-4d03-8719-d0a658fb846c",
"closedLoopAlarmStart": 1605691996370,
+ "modelInvariantUuid": "6790ab0e-034f-11eb-adc1-0242ac120002",
+ "modelUuid": "6790ab0e-034f-11eb-adc1-0242ac120002",
"closedLoopEventClient": "microservice.sliceAnalysisMS",
"closedLoopEventStatus": "ONSET",
"requestID": "1e946480-1232-46d4-a39b-614ac534400f",