diff options
author | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-04-11 20:25:29 +0200 |
---|---|---|
committer | Fiete Ostkamp <Fiete.Ostkamp@telekom.de> | 2024-04-17 12:09:41 +0200 |
commit | df2ad94ee9b641a4c2c19969816a6275f6d056e3 (patch) | |
tree | a6e54a66e9973ace00c0c88377dd3ef3a24aa747 /src/test/resources | |
parent | e820afb80b830453f667280d94f6e86279ad4f2c (diff) |
Add model-loader integration tests1.13.6
- add integration tests that assert the external communication towards other services using Wiremock
- remove tests that are asserting getters and setters of objects
Issue-ID: AAI-3826
Change-Id: I1f627801869f40cb0eaa61b10148b41bd3b1bdb8
Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de>
Diffstat (limited to 'src/test/resources')
-rw-r--r-- | src/test/resources/__files/artifactTypes.json | 63 | ||||
-rw-r--r-- | src/test/resources/__files/kafkaBootstrap.json | 5 | ||||
-rw-r--r-- | src/test/resources/__files/modelResponse.xml | 7 | ||||
-rw-r--r-- | src/test/resources/__files/service-TestSvc-csar-babel-response.json | 1 | ||||
-rw-r--r-- | src/test/resources/__files/service-TestSvc-csar.csar | bin | 0 -> 55342 bytes | |||
-rw-r--r-- | src/test/resources/application.properties | 9 | ||||
-rw-r--r-- | src/test/resources/logback-test.xml | 2 | ||||
-rw-r--r-- | src/test/resources/model-loader.properties | 8 |
8 files changed, 88 insertions, 7 deletions
diff --git a/src/test/resources/__files/artifactTypes.json b/src/test/resources/__files/artifactTypes.json new file mode 100644 index 0000000..de3cfce --- /dev/null +++ b/src/test/resources/__files/artifactTypes.json @@ -0,0 +1,63 @@ +[ + "AAI_SERVICE_MODEL", + "AAI_VF_INSTANCE_MODEL", + "AAI_VF_MODEL", + "AAI_VF_MODULE_MODEL", + "ANSIBLE_PLAYBOOK", + "APPC_CONFIG", + "BPEL", + "CHEF", + "CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT", + "CONTROLLER_BLUEPRINT_ARCHIVE", + "DCAE_DOC", + "DCAE_EVENT", + "DCAE_INVENTORY_BLUEPRINT", + "DCAE_INVENTORY_DOC", + "DCAE_INVENTORY_EVENT", + "DCAE_INVENTORY_JSON", + "DCAE_INVENTORY_POLICY", + "DCAE_INVENTORY_TOSCA", + "DCAE_JSON", + "DCAE_POLICY", + "DCAE_TOSCA", + "DG_XML", + "ETSI_PACKAGE", + "ASD_PACKAGE", + "GUIDE", + "HEAT_ARTIFACT", + "HEAT_ENV", + "HEAT", + "HEAT_NESTED", + "HEAT_NET", + "HEAT_VOL", + "HELM", + "ICON", + "LIFECYCLE_OPERATIONS", + "MODEL_INVENTORY_PROFILE", + "MODEL_QUERY_SPEC", + "MURANO_PKG", + "NETWORK_CALL_FLOW", + "ONBOARDED_PACKAGE", + "OTHER", + "PERFORMANCE_COUNTER", + "PLAN", + "PM_DICTIONARY", + "PNF_SW_INFORMATION", + "PUPPET", + "SHELL_SCRIPT", + "SHELL", + "SNMP_POLL", + "SNMP_TRAP", + "TOSCA_CSAR", + "TOSCA_TEMPLATE", + "UCPE_LAYER_2_CONFIGURATION", + "VENDOR_LICENSE", + "VES_EVENTS", + "VF_LICENSE", + "VF_MODULES_METADATA", + "VNF_CATALOG", + "WORKFLOW", + "YANG_MODULE", + "YANG_XML", + "YANG" +]
\ No newline at end of file diff --git a/src/test/resources/__files/kafkaBootstrap.json b/src/test/resources/__files/kafkaBootstrap.json new file mode 100644 index 0000000..1820ade --- /dev/null +++ b/src/test/resources/__files/kafkaBootstrap.json @@ -0,0 +1,5 @@ +{ + "kafkaBootStrapServer": "localhost:9092", + "distrNotificationTopicName": "SDC-DISTR-NOTIF-TOPIC-AUTO", + "distrStatusTopicName": "SDC-DISTR-STATUS-TOPIC-AUTO" +}
\ No newline at end of file diff --git a/src/test/resources/__files/modelResponse.xml b/src/test/resources/__files/modelResponse.xml new file mode 100644 index 0000000..36d07d8 --- /dev/null +++ b/src/test/resources/__files/modelResponse.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<model xmlns="http://org.onap.aai.inventory/v28"> + <model-invariant-id>3a40ab73-6694-4e75-bb6d-9a4a86ce35b3</model-invariant-id> + <model-type>service</model-type> + <model-role>Network Service</model-role> + <resource-version>1710523260974</resource-version> +</model>
\ No newline at end of file diff --git a/src/test/resources/__files/service-TestSvc-csar-babel-response.json b/src/test/resources/__files/service-TestSvc-csar-babel-response.json new file mode 100644 index 0000000..7103156 --- /dev/null +++ b/src/test/resources/__files/service-TestSvc-csar-babel-response.json @@ -0,0 +1 @@ +[{"name":"AAI-test-svc-service-2.0.xml","type":"MODEL","payload":"<model xmlns=\"http://org.onap.aai.inventory/v28\">\n <model-invariant-id>3c8bc8e7-e387-46ed-8616-70e99e2206dc</model-invariant-id>\n <model-type>service</model-type>\n <model-role>Network L1-3</model-role>\n <model-vers>\n <model-ver>\n <model-version-id>71f47717-b100-4eac-940b-7d4e86a4cbb7</model-version-id>\n <model-name>test-svc</model-name>\n <model-version>2.0</model-version>\n <model-description>test-svc</model-description>\n <model-elements>\n <model-element>\n <new-data-del-flag>T</new-data-del-flag>\n <cardinality>unbounded</cardinality>\n <model-elements/>\n <relationship-list>\n <relationship>\n <related-to>model-ver</related-to>\n <relationship-data>\n <relationship-key>model-ver.model-version-id</relationship-key>\n <relationship-value>46b92144-923a-4d20-b85a-3cbd847668a9</relationship-value>\n </relationship-data>\n <relationship-data>\n <relationship-key>model.model-invariant-id</relationship-key>\n <relationship-value>82194af1-3c2c-485a-8f44-420e22a9eaa4</relationship-value>\n </relationship-data>\n </relationship>\n </relationship-list>\n </model-element>\n </model-elements>\n </model-ver>\n </model-vers>\n</model>"}]
\ No newline at end of file diff --git a/src/test/resources/__files/service-TestSvc-csar.csar b/src/test/resources/__files/service-TestSvc-csar.csar Binary files differnew file mode 100644 index 0000000..711f068 --- /dev/null +++ b/src/test/resources/__files/service-TestSvc-csar.csar diff --git a/src/test/resources/application.properties b/src/test/resources/application.properties index 96816ce..69f4ff7 100644 --- a/src/test/resources/application.properties +++ b/src/test/resources/application.properties @@ -1,10 +1,11 @@ CONFIG_HOME=src/test/resources spring.kafka.consumer.auto-offset-reset=earliest spring.kafka.consumer.group-id=aai -spring.kafka.consumer.client-id=aai-model-loader - -test.topic=SDC-DISTR-NOTIF-TOPIC +spring.kafka.consumer.client-id=aai-model-loader +topics.distribution.notification=SDC-DISTR-NOTIF-TOPIC-AUTO spring.sleuth.enabled=false -ml.distribution.connection.enabled=false # avoid having the distribution client running in the background (requires active kafka)
\ No newline at end of file +ml.distribution.connection.enabled=false # avoid having the distribution client running in the background (requires active kafka) + +spring.main.allow-bean-definition-overriding=true
\ No newline at end of file diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index aef38e6..4bf73da 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -11,7 +11,7 @@ <appender-ref ref="STDOUT" /> </logger> - <root level="debug"> + <root level="INFO"> <appender-ref ref="STDOUT" /> </root> </configuration> diff --git a/src/test/resources/model-loader.properties b/src/test/resources/model-loader.properties index 4c24679..2db7c09 100644 --- a/src/test/resources/model-loader.properties +++ b/src/test/resources/model-loader.properties @@ -1,16 +1,20 @@ # Model Loader Distribution Client Configuration ml.distribution.ACTIVE_SERVER_TLS_AUTH=false ml.distribution.ASDC_ADDRESS=localhost:8443 +ml.distribution.ASDC_USE_HTTPS=false ml.distribution.CONSUMER_GROUP=aai-ml-group-test ml.distribution.CONSUMER_ID=aai-ml-id-test -ml.distribution.ENVIRONMENT_NAME=env +ml.distribution.ENVIRONMENT_NAME=AUTO ml.distribution.KEYSTORE_PASSWORD= ml.distribution.KEYSTORE_FILE= ml.distribution.PASSWORD=Aa123456 -ml.distribution.POLLING_INTERVAL=5 +ml.distribution.POLLING_INTERVAL=15 ml.distribution.POLLING_TIMEOUT=3 ml.distribution.USER=ci ml.distribution.ARTIFACT_TYPES=MODEL_QUERY_SPEC,TOSCA_CSAR +ml.distribution.SASL_JAAS_CONFIG=org.apache.kafka.common.security.scram.ScramLoginModule required username="aai-modelloader-ku" password="somePassword"; +ml.distribution.SECURITY_PROTOCOL=PLAINTEXT +ml.distribution.SASL_MECHANISM=PLAIN # Disable ASDC polling & enable REST interface ml.distribution.ASDC_CONNECTION_DISABLE=true |