summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--adapter/acumos-deployment/values.yaml6
-rw-r--r--adapter/acumos/setup.py2
-rw-r--r--adapter/acumos/tests/conftest.py42
-rw-r--r--adapter/acumos/tests/fixtures/config.yaml10
-rw-r--r--adapter/acumos/tests/test_convert.py92
-rw-r--r--adapter/acumos/tests/test_docker.py12
-rw-r--r--adapter/acumos/tests/test_fed.py5
-rw-r--r--adapter/acumos/tox.ini2
-rw-r--r--mod/bpgenerator/README.md78
-rw-r--r--mod/bpgenerator/common/pom.xml4
-rw-r--r--mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/constants/Constants.java13
-rw-r--r--mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/base/Blueprint.java4
-rw-r--r--mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/GetInput.java3
-rw-r--r--mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/componentspec/base/Auxilary.java4
-rw-r--r--mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java32
-rw-r--r--mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintService.java75
-rw-r--r--mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/FixesService.java61
-rw-r--r--mod/bpgenerator/coverage/pom.xml80
-rw-r--r--mod/bpgenerator/lombok.config2
-rw-r--r--mod/bpgenerator/onap-executable/pom.xml6
-rw-r--r--mod/bpgenerator/onap/pom.xml6
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/InfoService.java9
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/AppConfigService.java6
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/DmaapService.java9
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ExternalCertificateParametersFactoryService.java10
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ExternalTlsInfoFactoryService.java12
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/InterfacesService.java6
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/NodeService.java29
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PgaasNodeService.java5
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PolicyNodeService.java5
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PropertiesService.java46
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/QuotationService.java6
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ResourceConfigService.java19
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StartInputsService.java7
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StartService.java6
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StreamService.java20
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/kafka/KafkaStreamService.java24
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/DmaapBlueprintCreatorService.java24
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/StreamsService.java5
-rw-r--r--mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/onap/OnapBlueprintCreatorService.java8
-rw-r--r--mod/bpgenerator/onap/src/main/resources/bpgen.properties7
-rw-r--r--mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/AppConfigServiceTest.java174
-rw-r--r--mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/PropertiesServiceTest.java8
-rw-r--r--mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/StreamServiceTest.java6
-rw-r--r--mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/kafka/KafkaStreamServiceTest.java17
-rw-r--r--mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/ExternalCertificateParametersFactoryServiceTest.java5
-rw-r--r--mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/OnapBlueprintCreatorServiceTest.java23
-rw-r--r--mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/OnapTestUtils.java3
-rw-r--r--mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/TlsInfoTest.java7
-rw-r--r--mod/bpgenerator/pom.xml345
-rw-r--r--mod/bpgenerator/version.properties4
-rwxr-xr-x[-rw-r--r--]mod/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json8
-rw-r--r--mod/onboardingapi/ChangeLog.md13
-rw-r--r--mod/onboardingapi/dcae_cli/_version.py2
-rw-r--r--mod/onboardingapi/pom.xml2
-rw-r--r--mod/runtimeapi/Changelog.md15
-rw-r--r--mod/runtimeapi/pom.xml13
-rw-r--r--mod/runtimeapi/runtime-core/pom.xml6
-rw-r--r--mod/runtimeapi/runtime-web/pom.xml12
-rw-r--r--mod/runtimeapi/runtime-web/src/main/java/org/onap/dcae/runtime/web/RuntimeapiApplication.java2
-rw-r--r--mod/runtimeapi/runtime-web/src/test/java/org/onap/dcae/runtime/web/controllers/TestFlowGraphController.java2
-rw-r--r--releases/1.0.4-acumos-adapter-container.yaml9
-rw-r--r--releases/1.2.1-runtimeapi-container.yaml9
-rw-r--r--releases/1.2.2-runtimeapi-container.yaml9
-rw-r--r--releases/1.2.3-runtimeapi-container.yaml9
-rw-r--r--releases/1.7.2-blueprint-generator.yaml4
-rw-r--r--releases/1.7.3-blueprint-generator.yaml5
-rw-r--r--releases/2.12.4-onboardingapi-container.yaml9
-rw-r--r--releases/2.12.5-onboardingapi-container.yaml9
69 files changed, 1042 insertions, 490 deletions
diff --git a/adapter/acumos-deployment/values.yaml b/adapter/acumos-deployment/values.yaml
index 78f4400..4b4a1b7 100644
--- a/adapter/acumos-deployment/values.yaml
+++ b/adapter/acumos-deployment/values.yaml
@@ -28,7 +28,8 @@ global:
ingress:
enabled: true
virtualhost:
- enabled: false
+ enabled: true
+ baseurl: "simpledemo.onap.org"
config:
distributorAPIURL: /distributor
@@ -50,9 +51,10 @@ service:
ingress:
enabled: true
service:
- - baseaddr: "acumos-adapter"
+ - baseaddr: "dcaemod"
name: "dcae-acumos-adapter"
port: 9000
+ path: "/acumos-adapter"
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
# Adapter can take a long time to respond, since
diff --git a/adapter/acumos/setup.py b/adapter/acumos/setup.py
index 35c7273..d667f0b 100644
--- a/adapter/acumos/setup.py
+++ b/adapter/acumos/setup.py
@@ -20,7 +20,7 @@ from setuptools import setup, find_packages
setup(
name="aoconversion",
- version="1.0.3",
+ version="1.0.4-SNAPSHOT",
packages=find_packages(exclude=["tests.*", "tests"]),
author="Tommy Carpenter, Andrew Gauld",
author_email="tommy@research.att.com, agauld@att.com",
diff --git a/adapter/acumos/tests/conftest.py b/adapter/acumos/tests/conftest.py
index 80351c8..4219f66 100644
--- a/adapter/acumos/tests/conftest.py
+++ b/adapter/acumos/tests/conftest.py
@@ -19,7 +19,9 @@
import os
import pytest
import requests
+
import aoconversion
+from tests import testing_helpers
@pytest.fixture
@@ -29,3 +31,43 @@ def mock_schemas(monkeypatch):
monkeypatch.setattr(aoconversion.utils.component_schema, 'path', schemadir + '/component-specification/dcae-cli-v2/component-spec-schema.json')
monkeypatch.setattr(aoconversion.utils.dataformat_schema, 'path', schemadir + '/data-format/dcae-cli-v1/data-format-schema.json')
monkeypatch.setattr(aoconversion.utils.schema_schema, 'ret', requests.get('https://json-schema.org/draft-04/schema#').json())
+
+
+def test_get_metadata():
+ model_repo_path = testing_helpers.get_fixture_path('models')
+ model_name = 'example-model'
+ assert (aoconversion.utils.get_metadata(model_repo_path, model_name) == {
+ "schema": "acumos.schema.model:0.4.0",
+ "runtime": {
+ "name": "python",
+ "encoding": "protobuf",
+ "version": "3.6.8",
+ "dependencies": {
+ "pip": {
+ "indexes": [],
+ "requirements": [
+ {
+ "name": "dill",
+ "version": "0.3.0"
+ },
+ {
+ "name": "acumos",
+ "version": "0.8.0"
+ }
+ ]
+ },
+ "conda": {
+ "channels": [],
+ "requirements": []
+ }
+ }
+ },
+ "name": "example-model",
+ "methods": {
+ "add": {
+ "input": "NumbersIn",
+ "output": "NumberOut",
+ "description": "Adds two integers"
+ }
+ }
+ })
diff --git a/adapter/acumos/tests/fixtures/config.yaml b/adapter/acumos/tests/fixtures/config.yaml
new file mode 100644
index 0000000..207fe0c
--- /dev/null
+++ b/adapter/acumos/tests/fixtures/config.yaml
@@ -0,0 +1,10 @@
+dcaeurl: https://git.onap.org/dcaegen2/platform/plain/mod
+dcaeuser: aoadapter
+onboardingurl: http://dcaemod-onboarding-api:8080/onboarding
+onboardinguser: ''
+onboardingpass: ''
+certfile: /run/certs/cert.pem
+dockerregistry: 'dockerregistry'
+dockeruser: 'dockeruser'
+dockerpass: 'dockerpass'
+port: '90' \ No newline at end of file
diff --git a/adapter/acumos/tests/test_convert.py b/adapter/acumos/tests/test_convert.py
new file mode 100644
index 0000000..780cc55
--- /dev/null
+++ b/adapter/acumos/tests/test_convert.py
@@ -0,0 +1,92 @@
+# ============LICENSE_START====================================================
+# org.onap.dcae
+# =============================================================================
+# Copyright (c) 2019-2020 AT&T Intellectual Property. All rights reserved.
+# =============================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END======================================================
+'''
+Unit tests for convert.py
+should return docker_uri, dataformat and spec
+'''
+
+import aoconversion
+from testing_helpers import get_fixture_path
+
+
+def test_gen_dcae_artifacts_for_model(monkeypatch):
+ model_repo_path = get_fixture_path('models')
+ model_name = 'example-model'
+ config = aoconversion.scanner.Config(dcaeurl='http://dcaeurl', dcaeuser='dcaeuser', onboardingurl='https://onboarding', onboardinguser='obuser', onboardingpass='obpass', acumosurl='https://acumos', certfile=None, dockerregistry='dockerregistry', dockeruser='registryuser', dockerpass='registrypassword', tmpdir=model_repo_path)
+ spec = {
+ "self": {
+ "version": "1.0.0",
+ "name": "example-model",
+ "description": "Automatically generated from Acumos model",
+ "component_type": "docker",
+ },
+ "services": {"calls": [], "provides": []},
+ "streams": {
+ "subscribes": [
+ {"config_key": "add_subscriber", "format": "NumbersIn", "version": "1.0.0", "type": "message_router"}
+ ],
+ "publishes": [
+ {"config_key": "add_publisher", "format": "NumberOut", "version": "1.0.0", "type": "message_router"}
+ ],
+ },
+ "parameters": [],
+ "auxilary": {"healthcheck": {"type": "http", "endpoint": "/healthcheck"}},
+ "artifacts": [{"type": "docker image", "uri": "nexus01.fake.com:18443/example-model:latest"}],
+ }
+ dataformat = [
+ {
+ "self": {"name": "NumbersIn", "version": "1.0.0"},
+ "dataformatversion": "1.0.1",
+ "jsonschema": {
+ "title": "NumbersIn",
+ "type": "object",
+ "properties": {
+ "x": {"type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991},
+ "y": {"type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991},
+ },
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "definitions": {},
+ },
+ },
+ {
+ "self": {"name": "NumberOut", "version": "1.0.0"},
+ "dataformatversion": "1.0.1",
+ "jsonschema": {
+ "title": "NumberOut",
+ "type": "object",
+ "properties": {"result": {"type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991}},
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "definitions": {},
+ },
+ },
+ ]
+ dockeruri = 'dockerregistry/example-model:latest'
+
+ def mockreturn_dockeruri(config, model_name, model_version='latest'):
+ return dockeruri
+
+ def mockreturn_dataformats(model_repo_path, model_name):
+ return dataformat
+
+ def mockreturn_spec(model_repo_path, model_name, dataformat, dockeruri):
+ return spec
+
+ monkeypatch.setattr(aoconversion.docker_gen, 'build_and_push_docker', mockreturn_dockeruri)
+ monkeypatch.setattr(aoconversion.dataformat_gen, 'generate_dcae_data_formats', mockreturn_dataformats)
+ monkeypatch.setattr(aoconversion.spec_gen, 'generate_spec', mockreturn_spec)
+ assert aoconversion.convert.gen_dcae_artifacts_for_model(config, model_name, 'latest') == (dockeruri, dataformat, spec)
diff --git a/adapter/acumos/tests/test_docker.py b/adapter/acumos/tests/test_docker.py
index 0d84038..2f618e6 100644
--- a/adapter/acumos/tests/test_docker.py
+++ b/adapter/acumos/tests/test_docker.py
@@ -16,8 +16,9 @@
# limitations under the License.
# ============LICENSE_END======================================================
-from testing_helpers import get_json_fixture
-from aoconversion import docker_gen
+from testing_helpers import get_json_fixture, get_fixture_path
+from aoconversion import docker_gen, scanner
+import test_fed
TEST_META = get_json_fixture("models/example-model/metadata.json")
@@ -45,3 +46,10 @@ def test_generate_dockerfile():
CMD ["/app/example-model"]
"""
)
+
+
+def test_build_and_push_docker(monkeypatch):
+ model_repo_path = get_fixture_path('models')
+ config = scanner.Config(dcaeurl='http://dcaeurl', dcaeuser='dcaeuser', onboardingurl='https://onboarding', onboardinguser='obuser', onboardingpass='obpass', acumosurl='https://acumos', certfile=None, dockerregistry='dockerregistry', dockeruser='registryuser', dockerpass='registrypassword', tmpdir=model_repo_path)
+ monkeypatch.setattr(docker_gen, 'APIClient', test_fed._mockdocker.APIClient)
+ assert(docker_gen.build_and_push_docker(config, 'example-model', model_version="latest") == 'dockerregistry/example-model:latest')
diff --git a/adapter/acumos/tests/test_fed.py b/adapter/acumos/tests/test_fed.py
index 6119976..c5400a3 100644
--- a/adapter/acumos/tests/test_fed.py
+++ b/adapter/acumos/tests/test_fed.py
@@ -172,3 +172,8 @@ def test_aoconversion(mock_schemas, tmpdir, monkeypatch):
monkeypatch.setattr(requests, 'patch', _mockwww(_mockpatchdata))
aoc_scanner.scan(config)
aoc_scanner.scan(config)
+
+
+def test__derefconfig():
+ config_path = get_test_file('config.yaml')
+ assert aoc_scanner._derefconfig('@' + config_path) == 'dcaeurl: https://git.onap.org/dcaegen2/platform/plain/mod'
diff --git a/adapter/acumos/tox.ini b/adapter/acumos/tox.ini
index bc94f22..deebf3b 100644
--- a/adapter/acumos/tox.ini
+++ b/adapter/acumos/tox.ini
@@ -32,7 +32,7 @@ setenv =
commands=
nodeenv -p
npm install --global protobuf-jsonschema
- pytest --verbose --junitxml xunit-results.xml --cov aoconversion --cov-report xml --cov-report html
+ pytest --verbose --junitxml xunit-results.xml --cov aoconversion --cov-report xml --cov-report html --cov-report term
[testenv:flake8]
basepython = python3.7
diff --git a/mod/bpgenerator/README.md b/mod/bpgenerator/README.md
index eb35aff..89e48c9 100644
--- a/mod/bpgenerator/README.md
+++ b/mod/bpgenerator/README.md
@@ -1,64 +1,74 @@
# Blueprint Generator
-This tool allows the user to create a blueprint from a component spec json file
+Blueprint Generator is a java-based project used to generate a cloudify blueprint yaml from a component spec json file.
+
+It can be used either:
+- as a standalone application by directly using *onap-executable/target/blueprint-generator-onap-executable-1.7.3-SNAPSHOT.jar*
+- as a Spring library
# Instructions for building the tool locally
- Change directory into the root directory of the project (where the pom is located)
- Run the command: `mvn clean install`
-- This will create a jar file and a tar file
-- To execute the application
+- This will create jar files
+# Instructions for running BlueprintGenerator standalone:
+Base command to run BlueprintGenerator:
```bash
-java -jar target/blueprint-generator-1.4.0-SNAPSHOT-executable.jar
+java -jar onap-executable/target/blueprint-generator-onap-executable-1.7.3-SNAPSHOT.jar app ONAP
```
-
-
-# Instructions for running BlueprintGenerator:
-
-## Instructions for running:
-
-
--Run the program on the command line with the following tags:
-OPTIONS:
-- -p: The path to where the final blueprint yaml file will be created (Required)
-- -i: The path to the JSON spec file (required)
-- -n: Name of the blueprint (optional)
-- -t: the path to the import yaml file (optional)
-- -d: Onvoke the dmaap plugin (optional)
-- -o: The service component name override (optional)
+## Instructions for component blueprints:
+Run the program on the command line with the following options:
+- -i OR --component-spec: The path of the ONAP Blueprint INPUT JSON SPEC FILE (Required)
+- -p OR --blueprint-path: The path of the ONAP Blueprint OUTPUT where it will be saved (Required)
+- -n OR --blueprint-name: The NAME of the ONAP Blueprint OUTPUT that will be created (Optional)
+- -t OR --imports: The path of the ONAP Blueprint IMPORT FILE (Optional)
+- -o OR --service-name-override: The Value used to OVERRIDE the SERVICE NAME of the ONAP Blueprint (Optional)
+- -d OR --dmaap-plugin: The option to create an ONAP Blueprint with DMAAP Plugin included (Optional)
it will look like this:
```bash
- java -jar target/<JAR Filename>.jar app ONAP -i componentspec -p OutputBlueprintPath -n Blueprintname -d
+java -jar onap-executable/target/<JAR Filename>.jar app ONAP -i componentspec -p OutputBlueprintPath -n Blueprintname -d
```
This command will create a blueprint from the component spec. The blueprint file name will be called Blueprintname.yaml and it will be in the directory OutputBlueprintPath. The blueprint will also contain the DMaaP plugin.
-
-
-
-
-## Extra information:
-- The component spec must be of the same format as stated in the onap [readthedocs](https://onap.readthedocs.io/en/latest/submodules/dcaegen2.git/docs/sections/components/component-specification/common-specification.html#working-with-component-specs) page
+### Extra information:
+- The component spec must be of the same format as stated in the onap [readthedocs](https://docs.onap.org/projects/onap-dcaegen2/en/latest/sections/design-components/component-specification/component-type-docker.html) page
- If the tag says required then the program will not run without those tags being there
- If the tag says optional then it is not necessary to run the program with those tags
- If you do not add a -n tag the blueprint name will default to what it is in the component spec
- If the directory you specified in the -p tag does not already exist the directory will be created for you
-- The -t flag will override the default imports set for the blueprints. To see an example of how the import yaml file should be structured see the testImports.yaml file under the folder TestCases.
-
-
-#Instructions for policy models
+- The -t flag will override the default imports set for the blueprints. Below you can see example content of the import file:
+```yaml
+imports:
+ - https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
+ - plugin:k8splugin?version=3.6.0
+ - plugin:dcaepolicyplugin?version=2.4.0
+```
--Run the program on the command line with the following tags:
-OPTIONS:
+## Instructions for policy models
+In order to use BlueprintGenerator for policy models option: *-type policycreate* needs to be provided to the base
+command. Other available options:
- -i: The path to the JSON spec file (required)
- -p: The output path for all of the models (required)
it will look like this:
```bash
- java -jar target/<JAR Filename>.jar app ONAP -type policycreate -i componentspec -p OutputPolicyPath
+java -jar onap-executable/target/<JAR Filename>.jar app ONAP -type policycreate -i componentspec -p OutputPolicyPath
```
-This command will create a directory called models and put the policy models created from the component spec given in that directory. (A component spec may generate multiple policy models) \ No newline at end of file
+This command will create a directory called models and put the policy models created from the component spec given in that directory. (A component spec may generate multiple policy models)
+
+# Instructions for using BlueprintGenerator as a library
+To use BlueprintGenerator you need to import the following artifact to your project:
+```xml
+<dependency>
+ <groupId>org.onap.dcaegen2.platform.mod</groupId>
+ <artifactId>blueprint-generator-onap</artifactId>
+ <version>1.7.3</version>
+</dependency>
+```
+In order to see how to use the library in detail please see file:
+*bpgenerator/onap-executable/src/main/java/org/onap/blueprintgenerator/BlueprintGeneratorMainApplication.java*
diff --git a/mod/bpgenerator/common/pom.xml b/mod/bpgenerator/common/pom.xml
index 09c9757..35d57ca 100644
--- a/mod/bpgenerator/common/pom.xml
+++ b/mod/bpgenerator/common/pom.xml
@@ -29,7 +29,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>blueprint-generator-common</artifactId>
- <version>1.7.2-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Common</name>
@@ -39,7 +39,7 @@
<parent>
<groupId>org.onap.dcaegen2.platform.mod</groupId>
<artifactId>blueprint-generator</artifactId>
- <version>1.7.2-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
</parent>
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/constants/Constants.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/constants/Constants.java
index fbd0527..87b5fc8 100644
--- a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/constants/Constants.java
+++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/constants/Constants.java
@@ -4,8 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
- * * ================================================================================
- * * Modifications Copyright (c) 2021 Nokia
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -35,8 +34,10 @@ package org.onap.blueprintgenerator.constants;
public class Constants {
- public static final String _TOPIC = "_topic";
- public static final String _FEED = "_feed";
+ private Constants(){}
+
+ public static final String A_TOPIC = "_topic";
+ public static final String A_FEED = "_feed";
public static final String DATAROUTER_VALUE = "data router";
public static final String DATA_ROUTER = "data_router";
public static final String MESSAGEROUTER_VALUE = "message router";
@@ -51,8 +52,6 @@ public class Constants {
public static final String EMPTY_VALUE = "";
public static final String DCAE_NODES_CONTAINERIZED_SERVICE_COMPONENT_USING_DMAAP =
"dcae.nodes.ContainerizedServiceComponentUsingDmaap";
- public static final String MEMORY_LIMIT_128Mi = "128Mi";
- public static final String CPU_LIMIT_250m = "250m";
public static final String CPU_LIMIT = "cpu_limit";
public static final String MEMORY_LIMIT = "memory_limit";
public static final String CPU_REQUEST = "cpu_request";
@@ -76,7 +75,7 @@ public class Constants {
public static final String ONAP_INPUT_CPU_LIMIT = "dcae-ves-collector_cpu_limit";
public static final String ONAP_NODETEMPLATES = "dcae-ves-collector";
public static final String ONAP_NODETEMPLATES_TYPE = "dcae.nodes.ContainerizedServiceComponent";
- public static final String ONAP_DEFAULT250m = "\"250m\"";
+ public static final String ONAP_DEFAULT250M = "\"250m\"";
public static final String ONAP_SERVICE_COMPONENTNAME_OVERRIDE_DEFAULT = "\"\"";
public static final String DMAAP_NODETEMPLATES_TYPE =
"dcae.nodes.ContainerizedServiceComponentUsingDmaap";
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/base/Blueprint.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/base/Blueprint.java
index 03215cf..deb8b21 100644
--- a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/base/Blueprint.java
+++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/base/Blueprint.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -27,7 +28,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -47,5 +47,5 @@ public class Blueprint {
private List<String> imports;
- private Map<String, LinkedHashMap<String, Object>> inputs;
+ private Map<String, Map<String, Object>> inputs;
}
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/GetInput.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/GetInput.java
index 57dab04..3133d2c 100644
--- a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/GetInput.java
+++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/common/GetInput.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -42,8 +43,6 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
public class GetInput {
- // private Object get_input;
-
@JsonProperty("get_input")
private Object bpInputName;
}
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/componentspec/base/Auxilary.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/componentspec/base/Auxilary.java
index 4bfc633..c9d06f3 100644
--- a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/componentspec/base/Auxilary.java
+++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/model/componentspec/base/Auxilary.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -61,9 +62,6 @@ public class Auxilary {
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Map<String, String> databases;
- /* @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
- private Affinity affinity;*/
-
@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
private Object hpa_config;
}
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java
index 0526f48..5009372 100644
--- a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java
+++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintHelperService.java
@@ -28,6 +28,7 @@ package org.onap.blueprintgenerator.service.base;
import org.onap.blueprintgenerator.constants.Constants;
import org.springframework.stereotype.Service;
+import java.util.Map;
import java.util.LinkedHashMap;
/**
@@ -46,7 +47,7 @@ public class BlueprintHelperService {
* @param defaultValue Default value of Type
* @return
*/
- public LinkedHashMap<String, Object> createInputValue(
+ public Map<String, Object> createInputValue(
String type, String description, Object defaultValue) {
LinkedHashMap<String, Object> inputMap = new LinkedHashMap<>();
inputMap.put("type", type);
@@ -62,7 +63,7 @@ public class BlueprintHelperService {
* @param description Description
* @return
*/
- public LinkedHashMap<String, Object> createInputValue(String type, String description) {
+ public Map<String, Object> createInputValue(String type, String description) {
LinkedHashMap<String, Object> inputMap = new LinkedHashMap<>();
inputMap.put("type", type);
inputMap.put("description", description);
@@ -76,7 +77,7 @@ public class BlueprintHelperService {
* @param defaultValue Default value of Type
* @return
*/
- public LinkedHashMap<String, Object> createInputValue(String type, Object defaultValue) {
+ public Map<String, Object> createInputValue(String type, Object defaultValue) {
LinkedHashMap<String, Object> inputMap = new LinkedHashMap<>();
inputMap.put("type", type);
inputMap.put("default", defaultValue);
@@ -90,7 +91,7 @@ public class BlueprintHelperService {
* @param defaultValue Default value of Type
* @return
*/
- public LinkedHashMap<String, Object> createIntegerInput(String description,
+ public Map<String, Object> createIntegerInput(String description,
Object defaultValue) {
return createInputValue(Constants.INTEGER_TYPE, description, defaultValue);
}
@@ -101,7 +102,7 @@ public class BlueprintHelperService {
* @param description Description
* @return
*/
- public LinkedHashMap<String, Object> createIntegerInput(String description) {
+ public Map<String, Object> createIntegerInput(String description) {
return createInputValue(Constants.INTEGER_TYPE, description);
}
@@ -111,7 +112,7 @@ public class BlueprintHelperService {
* @param defaultValue Default value of Type
* @return
*/
- public LinkedHashMap<String, Object> createIntegerInput(Object defaultValue) {
+ public Map<String, Object> createIntegerInput(Object defaultValue) {
return createInputValue(Constants.INTEGER_TYPE, defaultValue);
}
@@ -122,7 +123,7 @@ public class BlueprintHelperService {
* @param defaultValue Default value of Type
* @return
*/
- public LinkedHashMap<String, Object> createBooleanInput(String description,
+ public Map<String, Object> createBooleanInput(String description,
Object defaultValue) {
return createInputValue(Constants.BOOLEAN_TYPE, description, defaultValue);
}
@@ -133,7 +134,7 @@ public class BlueprintHelperService {
* @param description Description
* @return
*/
- public LinkedHashMap<String, Object> createBooleanInput(String description) {
+ public Map<String, Object> createBooleanInput(String description) {
return createInputValue(Constants.BOOLEAN_TYPE, description);
}
@@ -143,7 +144,7 @@ public class BlueprintHelperService {
* @param defaultValue Default value of Type
* @return
*/
- public LinkedHashMap<String, Object> createBooleanInput(Object defaultValue) {
+ public Map<String, Object> createBooleanInput(Object defaultValue) {
return createInputValue(Constants.BOOLEAN_TYPE, defaultValue);
}
@@ -154,22 +155,18 @@ public class BlueprintHelperService {
* @param defaultValue Default value of Type
* @return
*/
- public LinkedHashMap<String, Object> createStringInput(String description,
+ public Map<String, Object> createStringInput(String description,
Object defaultValue) {
return createInputValue(Constants.STRING_TYPE, description, defaultValue);
}
- /* public LinkedHashMap<String, Object> createStringInput(String description){
- return createInputValue(Constants.STRING_TYPE, description);
- }*/
-
/**
* creates String Input value for given Default value
*
* @param defaultValue Default value of Type
* @return
*/
- public LinkedHashMap<String, Object> createStringInput(Object defaultValue) {
+ public Map<String, Object> createStringInput(Object defaultValue) {
return createInputValue(Constants.STRING_TYPE, defaultValue);
}
@@ -178,15 +175,16 @@ public class BlueprintHelperService {
* <p>
* Default input type: "string".
*
- * @param inputType Input type, supported: "boolean", "integer"
+ * @param inputType Input type, supported: "boolean", "integer", "number"
* @param defaultValue Default value of Type
* @return
*/
- public LinkedHashMap<String, Object> createInputByType(String inputType, Object defaultValue) {
+ public Map<String, Object> createInputByType(String inputType, Object defaultValue) {
switch (inputType) {
case "boolean":
return createBooleanInput(defaultValue);
case "integer":
+ case "number":
return createIntegerInput(defaultValue);
default:
return createStringInput(defaultValue);
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintService.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintService.java
index c32e5b1..e98f057 100644
--- a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintService.java
+++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/BlueprintService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -23,8 +24,9 @@
package org.onap.blueprintgenerator.service.base;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.FileReader;
-import java.nio.file.Paths;
import org.onap.blueprintgenerator.model.base.Blueprint;
import org.onap.blueprintgenerator.model.common.Input;
import org.onap.blueprintgenerator.model.componentspec.base.ComponentSpec;
@@ -56,6 +58,10 @@ import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
@Service
public class BlueprintService {
+ private static final String TYPE_KEY = "type";
+ private static final String DEFAULT_KEY = "default";
+ private static final Logger logger = LoggerFactory.getLogger(BlueprintService.class);
+
@Autowired
protected FixesService fixesService;
@@ -81,32 +87,17 @@ public class BlueprintService {
String comment = "# " + input.getComment() + '\n';
try {
- File outputFile;
String name =
StringUtils.isEmpty(bluePrintName) ? cs.getSelf().getName() : bluePrintName;
if (name.contains(".")) {
name = name.replaceAll(Pattern.quote("."), "_");
}
if (name.contains(" ")) {
- name = name.replaceAll(" ", "");
- }
- String file = name + ".yaml";
- outputFile = new File(outputPath, file);
- outputFile.getParentFile().mkdirs();
- try {
- outputFile.createNewFile();
- } catch (IOException e) {
- throw new RuntimeException(e);
+ name = name.replace(" ", "");
}
- String appVersion = "";
- try {
- MavenXpp3Reader reader = new MavenXpp3Reader();
- Model model = reader.read(new FileReader("pom.xml"));
- appVersion = "#bpgen_application_version: " + model.getVersion() + '\n';
- } catch (Exception e) {
- e.printStackTrace();
- }
+ File outputFile = createFile(outputPath, name);
+ String appVersion = readAppVersion();
String version = "#blueprint_version: " + cs.getSelf().getVersion() + '\n';
String description = "#description: " + cs.getSelf().getDescription() + '\n';
@@ -134,9 +125,7 @@ public class BlueprintService {
fixesService.fixOnapSingleQuotes(outputFile);
}
- // new Yaml().load(new FileInputStream(outputFile));
-
- System.out.println("Blueprint is created with valid YAML Format");
+ logger.debug("Blueprint is created with valid YAML Format");
} catch (Exception ex) {
throw new RuntimeException(
"Unable to generate YAML file from Blueprint or the generated YAML is not valid",
@@ -155,12 +144,12 @@ public class BlueprintService {
inputs.forEach(
(key, value) -> {
- if (value.get("type") != null) {
- if (value.get("type").equals("string")
- && value.get("default") != null
+ if (value.get(TYPE_KEY) != null) {
+ if (value.get(TYPE_KEY).equals("string")
+ && value.get(DEFAULT_KEY) != null
&& !key.contains("policies")) {
- value.replace("default", "'" + value.get("default").toString() + "'");
- } else if (value.get("type").equals("map") || value.get("type")
+ value.replace(DEFAULT_KEY, "'" + value.get(DEFAULT_KEY).toString() + "'");
+ } else if (value.get(TYPE_KEY).equals("map") || value.get(TYPE_KEY)
.equals("list")) {
// Commented the Code as we need to read the object as is for Map and List. If the
// List object is to be converted to string uncomment the below code.
@@ -168,7 +157,7 @@ public class BlueprintService {
String temp = inputs.get(s).get("default").toString();
inputs.get(s).replace("default", temp);
}*/
- inputs.get(key).remove("type");
+ inputs.get(key).remove(TYPE_KEY);
}
}
});
@@ -215,4 +204,34 @@ public class BlueprintService {
|| input.getBpType().equals("m")
|| input.getBpType().equals("k");
}
+
+ private File createFile(String outputPath, String name) {
+ File outputFile;
+ String file = name + ".yaml";
+ outputFile = new File(outputPath, file);
+ outputFile.getParentFile().mkdirs();
+ try {
+ boolean isCreated = outputFile.createNewFile();
+ if (isCreated) {
+ logger.debug("The file " + file + " was successfully created.");
+ } else {
+ logger.debug("The file " + file + " already existed.");
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ return outputFile;
+ }
+
+ private String readAppVersion() {
+ String appVersion = "";
+ try {
+ MavenXpp3Reader reader = new MavenXpp3Reader();
+ Model model = reader.read(new FileReader("pom.xml"));
+ appVersion = "#bpgen_application_version: " + model.getVersion() + '\n';
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return appVersion;
+ }
}
diff --git a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/FixesService.java b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/FixesService.java
index 4c6debc..961528b 100644
--- a/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/FixesService.java
+++ b/mod/bpgenerator/common/src/main/java/org/onap/blueprintgenerator/service/base/FixesService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -55,15 +56,15 @@ public class FixesService {
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
for (String line = br.readLine(); line != null; line = br.readLine()) {
- if (line.contains("'")) {
- line = processLine(line);
+ String newLine = line;
+ if (newLine.contains("'")) {
+ newLine = processLine(newLine);
}
- if (line.contains("get_input") || line.contains("get_secret") || line
+ if (newLine.contains("get_input") || newLine.contains("get_secret") || newLine
.contains("envs")) {
- line = line.replaceAll("'", "");
+ newLine = newLine.replace("'", "");
}
-
- lines.add(line);
+ lines.add(newLine);
}
fr.close();
@@ -90,8 +91,8 @@ public class FixesService {
* @return
*/
public String fixStringQuotes(String string) {
- String sLines[] = string.split("\n");
- String ret = "";
+ String[] sLines = string.split("\n");
+ StringBuilder ret = new StringBuilder();
for (String line : sLines) {
if (line.contains("get_input")
|| line.contains("get_secret")
@@ -101,15 +102,16 @@ public class FixesService {
|| line.contains("dmaap")
|| line.contains(".\"'"))
&& line.contains("'"))) {
- line = line.replaceAll("'", "");
+ line = line.replace("'", "");
}
if (line.contains("'")) {
line = processLine(line);
}
- ret = ret + "\n" + line;
+ ret.append("\n");
+ ret.append(line);
}
- return ret;
+ return ret.toString();
}
/**
@@ -124,13 +126,14 @@ public class FixesService {
FileReader fr = new FileReader(file);
BufferedReader br = new BufferedReader(fr);
for (String line = br.readLine(); line != null; line = br.readLine()) {
- if (line.contains("'")) {
- line = line.replace("'", "");
+ String newLine = line;
+ if (newLine.contains("'")) {
+ newLine = newLine.replace("'", "");
}
- if (line.contains("\"\"") && (line.contains("m") || line.contains("M"))) {
- line = line.replaceAll("\"\"", "\"");
+ if (newLine.contains("\"\"") && (newLine.contains("m") || newLine.contains("M"))) {
+ newLine = newLine.replace("\"\"", "\"");
}
- lines.add(line);
+ lines.add(newLine);
}
fr.close();
br.close();
@@ -185,18 +188,18 @@ public class FixesService {
}
private String processLine(String line) {
- return line.replaceAll("'\\{", "{")
- .replaceAll("}'", "}")
- .replaceAll("'\\[", "[")
- .replaceAll("]'", "]")
- .replaceAll("'''''", "'")
- .replaceAll("'''", "'")
- .replaceAll("'''", "")
- .replaceAll("''\\{", "'{")
- .replaceAll("}''", "}'")
- .replaceAll("''\\[", "'[")
- .replaceAll("]''", "]'")
- .replaceAll("\"''", "'")
- .replaceAll("''\"", "'");
+ return line.replace("'\\{", "{")
+ .replace("}'", "}")
+ .replace("'\\[", "[")
+ .replace("]'", "]")
+ .replace("'''''", "'")
+ .replace("'''", "'")
+ .replace("'''", "")
+ .replace("''\\{", "'{")
+ .replace("}''", "}'")
+ .replace("''\\[", "'[")
+ .replace("]''", "]'")
+ .replace("\"''", "'")
+ .replace("''\"", "'");
}
}
diff --git a/mod/bpgenerator/coverage/pom.xml b/mod/bpgenerator/coverage/pom.xml
new file mode 100644
index 0000000..a989a61
--- /dev/null
+++ b/mod/bpgenerator/coverage/pom.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+============LICENSE_START=======================================================
+Copyright (c) 2021 Nokia. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+============LICENSE_END=========================================================
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <parent>
+ <artifactId>blueprint-generator</artifactId>
+ <groupId>org.onap.dcaegen2.platform.mod</groupId>
+ <version>1.8.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+
+ <artifactId>coverage</artifactId>
+
+ <name>Coverage</name>
+ <description>This module is used to generate aggregated coverage report</description>
+
+ <properties>
+ <maven.deploy.skip>true</maven.deploy.skip>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.dcaegen2.platform.mod</groupId>
+ <artifactId>blueprint-generator-common</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.dcaegen2.platform.mod</groupId>
+ <artifactId>blueprint-generator-onap</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.dcaegen2.platform.mod</groupId>
+ <artifactId>blueprint-generator-onap-executable</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>verify</phase>
+ <id>report</id>
+ <goals>
+ <goal>report-aggregate</goal>
+ </goals>
+ <configuration>
+ <dataFileIncludes>
+ <dataFileInclude>**/jacoco-ut.exec</dataFileInclude>
+ <dataFileInclude>**/jacoco-it.exec</dataFileInclude>
+ </dataFileIncludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/mod/bpgenerator/lombok.config b/mod/bpgenerator/lombok.config
new file mode 100644
index 0000000..df71bb6
--- /dev/null
+++ b/mod/bpgenerator/lombok.config
@@ -0,0 +1,2 @@
+config.stopBubbling = true
+lombok.addLombokGeneratedAnnotation = true
diff --git a/mod/bpgenerator/onap-executable/pom.xml b/mod/bpgenerator/onap-executable/pom.xml
index ae20547..7a4991c 100644
--- a/mod/bpgenerator/onap-executable/pom.xml
+++ b/mod/bpgenerator/onap-executable/pom.xml
@@ -22,12 +22,12 @@ limitations under the License.
<parent>
<artifactId>blueprint-generator</artifactId>
<groupId>org.onap.dcaegen2.platform.mod</groupId>
- <version>1.7.2-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>blueprint-generator-onap-executable</artifactId>
- <version>1.7.2-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>OnapExecutable</name>
@@ -37,7 +37,7 @@ limitations under the License.
<dependency>
<groupId>org.onap.dcaegen2.platform.mod</groupId>
<artifactId>blueprint-generator-onap</artifactId>
- <version>1.7.2-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
diff --git a/mod/bpgenerator/onap/pom.xml b/mod/bpgenerator/onap/pom.xml
index dc91f39..1847aed 100644
--- a/mod/bpgenerator/onap/pom.xml
+++ b/mod/bpgenerator/onap/pom.xml
@@ -29,7 +29,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>blueprint-generator-onap</artifactId>
- <version>1.7.2-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Onap</name>
@@ -40,14 +40,14 @@
<parent>
<groupId>org.onap.dcaegen2.platform.mod</groupId>
<artifactId>blueprint-generator</artifactId>
- <version>1.7.2-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>org.onap.dcaegen2.platform.mod</groupId>
<artifactId>blueprint-generator-common</artifactId>
- <version>1.7.2-SNAPSHOT</version>
+ <version>1.8.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/InfoService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/InfoService.java
index 66f71da..70ba504 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/InfoService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/InfoService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -53,12 +54,12 @@ public class InfoService {
* @return
*/
public Map<String, Object> createMessageRouterInfo(
- Map<String, LinkedHashMap<String, Object>> inputs, String config, char type) {
+ Map<String, Map<String, Object>> inputs, String config, char type) {
Map<String, Object> response = new HashMap<>();
Info info = new Info();
- LinkedHashMap<String, Object> stringType = new LinkedHashMap<>();
+ Map<String, Object> stringType = new LinkedHashMap<>();
stringType.put("type", "string");
config = config.replaceAll("-", "_");
@@ -87,12 +88,12 @@ public class InfoService {
* @return
*/
public Map<String, Object> createDataRouterInfo(
- Map<String, LinkedHashMap<String, Object>> inputs, String config) {
+ Map<String, Map<String, Object>> inputs, String config) {
Map<String, Object> response = new HashMap<>();
Info info = new Info();
- LinkedHashMap<String, Object> stringType = new LinkedHashMap<>();
+ Map<String, Object> stringType = new LinkedHashMap<>();
stringType.put("type", "string");
String userNameInputName = blueprintHelperService.joinUnderscore(config, "username");
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/AppConfigService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/AppConfigService.java
index b31fc49..a64c297 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/AppConfigService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/AppConfigService.java
@@ -68,7 +68,7 @@ public class AppConfigService {
* @return
*/
public Map<String, Object> createAppconfig(
- Map<String, LinkedHashMap<String, Object>> inputs,
+ Map<String, Map<String, Object>> inputs,
OnapComponentSpec onapComponentSpec,
boolean isDmaap) {
@@ -94,7 +94,7 @@ public class AppConfigService {
paramInput.setBpInputName(pName);
parameters.put(pName, paramInput);
if (!"".equals(p.getValue())) {
- LinkedHashMap<String, Object> pInputs = createInputFromParameter(p);
+ Map<String, Object> pInputs = createInputFromParameter(p);
inputs.put(pName, pInputs);
} else {
LinkedHashMap<String, Object> pInputs = new LinkedHashMap<>();
@@ -122,7 +122,7 @@ public class AppConfigService {
return response;
}
- private LinkedHashMap<String, Object> createInputFromParameter(Parameters parameter) {
+ private Map<String, Object> createInputFromParameter(Parameters parameter) {
String inputType = parameter.getType() == null ? "string" : parameter.getType();
return blueprintHelperService.createInputByType(inputType, parameter.getValue());
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/DmaapService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/DmaapService.java
index e21b852..09ed925 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/DmaapService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/DmaapService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -56,7 +57,7 @@ public class DmaapService {
* @return
*/
public Map<String, Object> createDmaapMessageRouter(
- Map<String, LinkedHashMap<String, Object>> inputs,
+ Map<String, Map<String, Object>> inputs,
String config,
char type,
String counter,
@@ -72,7 +73,7 @@ public class DmaapService {
if (!isDmaap) {
Map<String, Object> infoResponse = infoService
.createMessageRouterInfo(inputs, config, type);
- inputs = (Map<String, LinkedHashMap<String, Object>>) infoResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) infoResponse.get("inputs");
dmaap.setDmaap_info(infoResponse.get("info"));
} else {
String infoType = "<<" + counter + ">>";
@@ -103,7 +104,7 @@ public class DmaapService {
* @return
*/
public Map<String, Object> createDmaapDataRouter(
- Map<String, LinkedHashMap<String, Object>> inputs,
+ Map<String, Map<String, Object>> inputs,
String config,
String counter,
boolean isDmaap) {
@@ -113,7 +114,7 @@ public class DmaapService {
if (!isDmaap) {
Map<String, Object> infoResponse = infoService.createDataRouterInfo(inputs, config);
- inputs = (Map<String, LinkedHashMap<String, Object>>) infoResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) infoResponse.get("inputs");
dmaap.setDmaap_info(infoResponse.get("info"));
} else {
String infoType = "<<" + counter + ">>";
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ExternalCertificateParametersFactoryService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ExternalCertificateParametersFactoryService.java
index 226a319..1e3386c 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ExternalCertificateParametersFactoryService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ExternalCertificateParametersFactoryService.java
@@ -4,7 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
- * * Copyright (c) 2020 Nokia. All rights reserved.
+ * * Copyright (c) 2020-2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -64,16 +64,16 @@ public class ExternalCertificateParametersFactoryService
*
* @return
*/
- public Map<String, LinkedHashMap<String, Object>> createInputList() {
- Map<String, LinkedHashMap<String, Object>> retInputs = new LinkedHashMap<>();
+ public Map<String, Map<String, Object>> createInputList() {
+ Map<String, Map<String, Object>> retInputs = new LinkedHashMap<>();
- LinkedHashMap<String, Object> commonNameInputMap =
+ Map<String, Object> commonNameInputMap =
blueprintHelperService.createStringInput(
"Common name which should be present in certificate.",
Constants.DEFAULT_COMMON_NAME);
retInputs.put(addPrefix(Constants.COMMON_NAME_FIELD), commonNameInputMap);
- LinkedHashMap<String, Object> sansInputMap =
+ Map<String, Object> sansInputMap =
blueprintHelperService.createStringInput(
"\"List of Subject Alternative Names (SANs) which should be present in certificate. "
+ "Delimiter - , Should contain a common_name value and other FQDNs under which the given "
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ExternalTlsInfoFactoryService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ExternalTlsInfoFactoryService.java
index 0694821..f73a9e6 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ExternalTlsInfoFactoryService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ExternalTlsInfoFactoryService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -31,7 +32,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
-import java.util.LinkedHashMap;
import java.util.Map;
/**
@@ -76,25 +76,25 @@ public class ExternalTlsInfoFactoryService extends ExternalCertificateDataFactor
* @param cs ComponentSpec
* @return
*/
- public Map<String, LinkedHashMap<String, Object>> createInputListFromComponentSpec(
+ public Map<String, Map<String, Object>> createInputListFromComponentSpec(
OnapComponentSpec cs) {
- Map<String, LinkedHashMap<String, Object>> retInputs = new HashMap<>();
+ Map<String, Map<String, Object>> retInputs = new HashMap<>();
Map<String, Object> externalTlsInfoCs = cs.getAuxilary().getTls_info();
- LinkedHashMap<String, Object> useTlsFlagInput =
+ Map<String, Object> useTlsFlagInput =
blueprintHelperService.createBooleanInput(
"Flag to indicate external tls enable/disable.",
externalTlsInfoCs.get(Constants.USE_EXTERNAL_TLS_FIELD));
retInputs.put(addPrefix(Constants.USE_EXTERNAL_TLS_FIELD), useTlsFlagInput);
- LinkedHashMap<String, Object> caNameInputMap =
+ Map<String, Object> caNameInputMap =
blueprintHelperService.createStringInput(
"Name of Certificate Authority configured on CertService side.",
Constants.DEFAULT_CA);
retInputs.put(addPrefix(Constants.CA_NAME_FIELD), caNameInputMap);
- LinkedHashMap<String, Object> certTypeInputMap =
+ Map<String, Object> certTypeInputMap =
blueprintHelperService.createStringInput(
"Format of provided certificates", Constants.DEFAULT_CERT_TYPE);
retInputs.put(addPrefix(Constants.CERT_TYPE_FIELD), certTypeInputMap);
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/InterfacesService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/InterfacesService.java
index a14204f..c19ad09 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/InterfacesService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/InterfacesService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -30,7 +31,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
-import java.util.LinkedHashMap;
import java.util.Map;
/**
@@ -52,13 +52,13 @@ public class InterfacesService {
* @return
*/
public Map<String, Object> createInterface(
- Map<String, LinkedHashMap<String, Object>> inputs, OnapComponentSpec onapComponentSpec) {
+ Map<String, Map<String, Object>> inputs, OnapComponentSpec onapComponentSpec) {
Map<String, Object> response = new HashMap<>();
Interfaces interfaces = new Interfaces();
Map<String, Object> startResponse = startService.createStart(inputs, onapComponentSpec);
- inputs = (Map<String, LinkedHashMap<String, Object>>) startResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) startResponse.get("inputs");
interfaces.setStart((Start) startResponse.get("start"));
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/NodeService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/NodeService.java
index ab1b7f2..50451db 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/NodeService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/NodeService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -74,7 +75,7 @@ public class NodeService {
* @return
*/
public Map<String, Object> createOnapNode(
- Map<String, LinkedHashMap<String, Object>> inputs,
+ Map<String, Map<String, Object>> inputs,
OnapComponentSpec onapComponentSpec,
String override) {
@@ -83,7 +84,7 @@ public class NodeService {
Map<String, Object> onapResponse = interfacesService
.createInterface(inputs, onapComponentSpec);
- inputs = (Map<String, LinkedHashMap<String, Object>>) onapResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) onapResponse.get("inputs");
Map<String, Interfaces> interfaces = new TreeMap<>();
interfaces.put(
@@ -110,7 +111,7 @@ public class NodeService {
Map<String, Object> propertiesResponse =
propertiesService.createOnapProperties(inputs, onapComponentSpec, override);
- inputs = (Map<String, LinkedHashMap<String, Object>>) propertiesResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) propertiesResponse.get("inputs");
onapNode.setProperties(
(org.onap.blueprintgenerator.model.common.Properties) propertiesResponse
.get("properties"));
@@ -130,7 +131,7 @@ public class NodeService {
*/
public Map<String, Object> createDmaapNode(
OnapComponentSpec onapComponentSpec,
- Map<String, LinkedHashMap<String, Object>> inputs,
+ Map<String, Map<String, Object>> inputs,
String override) {
Map<String, Object> response = new HashMap<>();
@@ -140,7 +141,7 @@ public class NodeService {
Map<String, Object> dmaapResponse =
interfacesService.createInterface(inputs, onapComponentSpec);
- inputs = (Map<String, LinkedHashMap<String, Object>>) dmaapResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) dmaapResponse.get("inputs");
Map<String, Interfaces> interfaces = new TreeMap<>();
interfaces.put(
@@ -154,10 +155,10 @@ public class NodeService {
Map<String, String> pubRelations = new LinkedHashMap();
if (blueprintHelperService.isMessageRouterType(publishes.getType())) {
pubRelations.put("type", Constants.PUBLISH_EVENTS);
- pubRelations.put("target", publishes.getConfig_key() + Constants._TOPIC);
+ pubRelations.put("target", publishes.getConfig_key() + Constants.A_TOPIC);
} else if (blueprintHelperService.isDataRouterType(publishes.getType())) {
pubRelations.put("type", Constants.PUBLISH_FILES);
- pubRelations.put("target", publishes.getConfig_key() + Constants._FEED);
+ pubRelations.put("target", publishes.getConfig_key() + Constants.A_FEED);
}
relationships.add(pubRelations);
}
@@ -168,10 +169,10 @@ public class NodeService {
Map<String, String> subRelations = new LinkedHashMap();
if (blueprintHelperService.isMessageRouterType(subscribes.getType())) {
subRelations.put("type", Constants.SUBSCRIBE_TO_EVENTS);
- subRelations.put("target", subscribes.getConfig_key() + Constants._TOPIC);
+ subRelations.put("target", subscribes.getConfig_key() + Constants.A_TOPIC);
} else if (blueprintHelperService.isDataRouterType(subscribes.getType())) {
subRelations.put("type", Constants.SUBSCRIBE_TO_FILES);
- subRelations.put("target", subscribes.getConfig_key() + Constants._FEED);
+ subRelations.put("target", subscribes.getConfig_key() + Constants.A_FEED);
}
relationships.add(subRelations);
}
@@ -193,7 +194,7 @@ public class NodeService {
Map<String, Object> propertiesResponse =
propertiesService.createDmaapProperties(inputs, onapComponentSpec, override);
- inputs = (Map<String, LinkedHashMap<String, Object>>) propertiesResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) propertiesResponse.get("inputs");
dmaapNode.setProperties(
(org.onap.blueprintgenerator.model.common.Properties) propertiesResponse
.get("properties"));
@@ -211,11 +212,11 @@ public class NodeService {
* @return
*/
public Map<String, Object> createFeedNode(
- Map<String, LinkedHashMap<String, Object>> inputs, String name) {
+ Map<String, Map<String, Object>> inputs, String name) {
Map<String, Object> response = new HashMap<>();
Node feedNode = new Node();
- LinkedHashMap<String, Object> stringType = new LinkedHashMap();
+ Map<String, Object> stringType = new LinkedHashMap();
stringType.put("type", "string");
feedNode.setType(Constants.FEED);
@@ -242,11 +243,11 @@ public class NodeService {
* @return
*/
public Map<String, Object> createTopicNode(
- Map<String, LinkedHashMap<String, Object>> inputs, String name) {
+ Map<String, Map<String, Object>> inputs, String name) {
Map<String, Object> response = new HashMap<>();
Node topicNode = new Node();
- LinkedHashMap<String, Object> stringType = new LinkedHashMap();
+ Map<String, Object> stringType = new LinkedHashMap();
stringType.put("type", "string");
topicNode.setType(Constants.TOPIC);
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PgaasNodeService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PgaasNodeService.java
index d18ca92..e7dd0ab 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PgaasNodeService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PgaasNodeService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -63,7 +64,7 @@ public class PgaasNodeService {
public void addPgaasNodesAndInputs(
OnapComponentSpec onapComponentSpec,
Map<String, Node> nodeTemplate,
- Map<String, LinkedHashMap<String, Object>> inputs) {
+ Map<String, Map<String, Object>> inputs) {
Map<String, String> databases = onapComponentSpec.getAuxilary().getDatabases();
if (databases != null) {
for (Map.Entry<String, String> database : databases.entrySet()) {
@@ -74,7 +75,7 @@ public class PgaasNodeService {
}
private void addPgaasInputs(
- Map.Entry<String, String> database, Map<String, LinkedHashMap<String, Object>> inputs) {
+ Map.Entry<String, String> database, Map<String, Map<String, Object>> inputs) {
inputs.put(
database.getKey() + Constants.NAME_POSTFIX,
blueprintHelperService.createStringInput("db name", ""));
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PolicyNodeService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PolicyNodeService.java
index 43d819f..9fee7c6 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PolicyNodeService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PolicyNodeService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -60,7 +61,7 @@ public class PolicyNodeService {
public void addPolicyNodesAndInputs(
OnapComponentSpec onapComponentSpec,
Map<String, Node> nodeTemplate,
- Map<String, LinkedHashMap<String, Object>> inputs) {
+ Map<String, Map<String, Object>> inputs) {
List<TypePolicy> policyList = onapComponentSpec.getPolicyInfo().getTypePolicyList();
for (TypePolicy policy : policyList) {
addPolicyNodesToNodeTemplate(policy, nodeTemplate);
@@ -69,7 +70,7 @@ public class PolicyNodeService {
}
private void addPolicyInputs(
- TypePolicy policy, Map<String, LinkedHashMap<String, Object>> inputs) {
+ TypePolicy policy, Map<String, Map<String, Object>> inputs) {
String defaultValue = policy.getPolicy_id();
defaultValue = defaultValue != null ? defaultValue : "";
inputs.put(
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PropertiesService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PropertiesService.java
index 382cc2b..2758f8c 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PropertiesService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/PropertiesService.java
@@ -76,7 +76,7 @@ public class PropertiesService {
* @return
*/
public Map<String, Object> createOnapProperties(
- Map<String, LinkedHashMap<String, Object>> inputs,
+ Map<String, Map<String, Object>> inputs,
OnapComponentSpec onapComponentSpec,
String override) {
Map<String, Object> response = new HashMap<>();
@@ -103,7 +103,7 @@ public class PropertiesService {
replica.setBpInputName("replicas");
properties.setReplicas(replica);
- LinkedHashMap<String, Object> replicas =
+ Map<String, Object> replicas =
blueprintHelperService.createIntegerInput("number of instances", 1);
inputs.put("replicas", replicas);
@@ -113,7 +113,7 @@ public class PropertiesService {
Map<String, Object> appConfigResponse =
appConfigService.createAppconfig(inputs, onapComponentSpec, false);
- inputs = (Map<String, LinkedHashMap<String, Object>>) appConfigResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) appConfigResponse.get("inputs");
properties.setApplication_config((Appconfig) appConfigResponse.get("appconfig"));
GetInput always_pull_image = new GetInput();
@@ -121,7 +121,7 @@ public class PropertiesService {
properties.setAlways_pull_image(always_pull_image);
- LinkedHashMap<String, Object> inputAlwaysPullImage =
+ Map<String, Object> inputAlwaysPullImage =
blueprintHelperService.createBooleanInput(
"Set to true if the image should always be pulled", true);
inputs.put("always_pull_image", inputAlwaysPullImage);
@@ -144,7 +144,7 @@ public class PropertiesService {
Map<String, Object> resourceConfigResponse =
resourceConfigService
.createResourceConfig(inputs, onapComponentSpec.getSelf().getName());
- inputs = (Map<String, LinkedHashMap<String, Object>>) resourceConfigResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) resourceConfigResponse.get("inputs");
properties
.setResource_config((ResourceConfig) resourceConfigResponse.get("resourceConfig"));
@@ -162,7 +162,7 @@ public class PropertiesService {
* @return
*/
public Map<String, Object> createDmaapProperties(
- Map<String, LinkedHashMap<String, Object>> inputs,
+ Map<String, Map<String, Object>> inputs,
OnapComponentSpec onapComponentSpec,
String override) {
Map<String, Object> response = new HashMap<>();
@@ -173,7 +173,7 @@ public class PropertiesService {
image.setBpInputName("tag_version");
properties.setImage(image);
- LinkedHashMap<String, Object> img = new LinkedHashMap<>();
+ Map<String, Object> img = new LinkedHashMap<>();
inputs.put(
"tag_version",
blueprintHelperService.createStringInput(onapComponentSpec.getArtifacts()[0].getUri()));
@@ -182,7 +182,7 @@ public class PropertiesService {
location.setBpInputName("location_id");
properties.setLocation_id(location);
- LinkedHashMap<String, Object> locMap = new LinkedHashMap();
+ Map<String, Object> locMap = new LinkedHashMap();
inputs.put("location_id", blueprintHelperService.createStringInput(Constants.EMPTY_VALUE));
properties.setLog_info(onapComponentSpec.getAuxilary().getLog_info());
@@ -206,7 +206,7 @@ public class PropertiesService {
replica.setBpInputName("replicas");
properties.setReplicas(replica);
- LinkedHashMap<String, Object> rep =
+ Map<String, Object> rep =
blueprintHelperService.createIntegerInput("number of instances", 1);
inputs.put("replicas", rep);
@@ -216,7 +216,7 @@ public class PropertiesService {
Map<String, Object> appConfigResponse =
appConfigService.createAppconfig(inputs, onapComponentSpec, true);
- inputs = (Map<String, LinkedHashMap<String, Object>>) appConfigResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) appConfigResponse.get("inputs");
properties.setApplication_config((Appconfig) appConfigResponse.get("appconfig"));
List<Streams> pubStreams = new ArrayList();
@@ -224,7 +224,7 @@ public class PropertiesService {
if (onapComponentSpec.getStreams().getPublishes() != null) {
for (Publishes publishes : onapComponentSpec.getStreams().getPublishes()) {
if (blueprintHelperService.isMessageRouterType(publishes.getType())) {
- String topic = publishes.getConfig_key() + Constants._TOPIC;
+ String topic = publishes.getConfig_key() + Constants.A_TOPIC;
Map<String, Object> streamsMessageRouterResponse =
streamsService.createStreams(
inputs,
@@ -234,11 +234,11 @@ public class PropertiesService {
publishes.getRoute(),
'p');
inputs =
- (Map<String, LinkedHashMap<String, Object>>)
+ (Map<String, Map<String, Object>>)
streamsMessageRouterResponse.get("inputs");
pubStreams.add((Streams) streamsMessageRouterResponse.get("streams"));
} else if (blueprintHelperService.isDataRouterType(publishes.getType())) {
- String feed = publishes.getConfig_key() + Constants._FEED;
+ String feed = publishes.getConfig_key() + Constants.A_FEED;
Map<String, Object> streamsDataRouterResponse =
streamsService.createStreams(
inputs,
@@ -248,7 +248,7 @@ public class PropertiesService {
publishes.getRoute(),
'p');
inputs =
- (Map<String, LinkedHashMap<String, Object>>)
+ (Map<String, Map<String, Object>>)
streamsDataRouterResponse.get("inputs");
pubStreams.add((Streams) streamsDataRouterResponse.get("streams"));
}
@@ -261,7 +261,7 @@ public class PropertiesService {
if (onapComponentSpec.getStreams().getSubscribes() != null) {
for (Subscribes subscribes : onapComponentSpec.getStreams().getSubscribes()) {
if (blueprintHelperService.isMessageRouterType(subscribes.getType())) {
- String topic = subscribes.getConfig_key() + Constants._TOPIC;
+ String topic = subscribes.getConfig_key() + Constants.A_TOPIC;
Map<String, Object> streamsMessageRouterResponse =
streamsService.createStreams(
inputs,
@@ -271,11 +271,11 @@ public class PropertiesService {
subscribes.getRoute(),
's');
inputs =
- (Map<String, LinkedHashMap<String, Object>>)
+ (Map<String, Map<String, Object>>)
streamsMessageRouterResponse.get("inputs");
subStreams.add((Streams) streamsMessageRouterResponse.get("streams"));
} else if (blueprintHelperService.isDataRouterType(subscribes.getType())) {
- String feed = subscribes.getConfig_key() + Constants._FEED;
+ String feed = subscribes.getConfig_key() + Constants.A_FEED;
Map<String, Object> streamsDataRouterResponse =
streamsService.createStreams(
inputs,
@@ -285,7 +285,7 @@ public class PropertiesService {
subscribes.getRoute(),
's');
inputs =
- (Map<String, LinkedHashMap<String, Object>>)
+ (Map<String, Map<String, Object>>)
streamsDataRouterResponse.get("inputs");
subStreams.add((Streams) streamsDataRouterResponse.get("streams"));
}
@@ -304,7 +304,7 @@ public class PropertiesService {
Map<String, Object> resourceConfigResponse =
resourceConfigService
.createResourceConfig(inputs, onapComponentSpec.getSelf().getName());
- inputs = (Map<String, LinkedHashMap<String, Object>>) resourceConfigResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) resourceConfigResponse.get("inputs");
properties
.setResource_config((ResourceConfig) resourceConfigResponse.get("resourceConfig"));
@@ -313,7 +313,7 @@ public class PropertiesService {
return response;
}
- private LinkedHashMap<String, Object> addServiceComponentNameOverride(String override, Properties properties) {
+ private Map<String, Object> addServiceComponentNameOverride(String override, Properties properties) {
GetInput overrideGetInput = new GetInput();
overrideGetInput.setBpInputName(Constants.SERVICE_COMPONENT_NAME_OVERRIDE);
properties.setService_component_name_override(overrideGetInput);
@@ -322,7 +322,7 @@ public class PropertiesService {
private void addTlsInfo(
OnapComponentSpec onapComponentSpec,
- Map<String, LinkedHashMap<String, Object>> inputs,
+ Map<String, Map<String, Object>> inputs,
Properties properties) {
TlsInfo tlsInfo = new TlsInfo();
tlsInfo.setCertDirectory(
@@ -331,14 +331,14 @@ public class PropertiesService {
useTLSFlag.setBpInputName("use_tls");
tlsInfo.setUseTls(useTLSFlag);
properties.setTls_info(tlsInfo);
- LinkedHashMap<String, Object> useTlsFlagInput =
+ Map<String, Object> useTlsFlagInput =
blueprintHelperService.createBooleanInput(
"flag to indicate tls enable/disable",
onapComponentSpec.getAuxilary().getTls_info().get("use_tls"));
inputs.put("use_tls", useTlsFlagInput);
}
- private Map<String, LinkedHashMap<String, Object>> addExternalTlsInfo(
+ private Map<String, Map<String, Object>> addExternalTlsInfo(
OnapComponentSpec onapComponentSpec, Properties properties) {
properties.setExternal_cert(
externalTlsInfoFactoryService.createFromComponentSpec(onapComponentSpec));
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/QuotationService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/QuotationService.java
index 642a13e..fef4447 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/QuotationService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/QuotationService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -23,11 +24,10 @@
package org.onap.blueprintgenerator.service.common;
+import java.util.Map;
import org.onap.blueprintgenerator.model.common.OnapBlueprint;
import org.springframework.stereotype.Service;
-import java.util.LinkedHashMap;
-
/**
* @author : Ravi Mantena
* @date 10/16/2020 Application: ONAP - Blueprint Generator Common ONAP Service to set Quotations of
@@ -44,7 +44,7 @@ public class QuotationService {
*/
public OnapBlueprint setQuotations(OnapBlueprint bp) {
for (String s : bp.getInputs().keySet()) {
- LinkedHashMap<String, Object> temp = bp.getInputs().get(s);
+ Map<String, Object> temp = bp.getInputs().get(s);
if (temp.get("type") == "string") {
String def = (String) temp.get("default");
if (def != null) {
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ResourceConfigService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ResourceConfigService.java
index a3a9c97..d9bc7b5 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ResourceConfigService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ResourceConfigService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -28,10 +29,10 @@ import org.onap.blueprintgenerator.model.common.GetInput;
import org.onap.blueprintgenerator.model.common.ResourceConfig;
import org.onap.blueprintgenerator.service.base.BlueprintHelperService;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.HashMap;
-import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeMap;
@@ -46,6 +47,12 @@ public class ResourceConfigService {
@Autowired
private BlueprintHelperService blueprintHelperService;
+ @Value("${resources.cpuLimit}")
+ private String defaultCpuLimit;
+
+ @Value("${resources.memoryLimit}")
+ private String defaultMemoryLimit;
+
/**
* Creates Resouce Config for properties
*
@@ -54,15 +61,15 @@ public class ResourceConfigService {
* @return
*/
public Map<String, Object> createResourceConfig(
- Map<String, LinkedHashMap<String, Object>> inputs, String name) {
+ Map<String, Map<String, Object>> inputs, String name) {
Map<String, Object> response = new HashMap<>();
ResourceConfig resourceConfig = new ResourceConfig();
- LinkedHashMap<String, Object> memoryLimit =
- blueprintHelperService.createStringInput(Constants.MEMORY_LIMIT_128Mi);
+ Map<String, Object> memoryLimit =
+ blueprintHelperService.createStringInput(defaultMemoryLimit);
- LinkedHashMap<String, Object> cpuLimit =
- blueprintHelperService.createStringInput(Constants.CPU_LIMIT_250m);
+ Map<String, Object> cpuLimit =
+ blueprintHelperService.createStringInput(defaultCpuLimit);
name = blueprintHelperService.getNamePrefix(name);
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StartInputsService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StartInputsService.java
index 8ec0024..dc7a86e 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StartInputsService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StartInputsService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -55,7 +56,7 @@ public class StartInputsService {
* @return
*/
public Map<String, Object> createStartInputs(
- Map<String, LinkedHashMap<String, Object>> inputs, OnapComponentSpec onapComponentSpec) {
+ Map<String, Map<String, Object>> inputs, OnapComponentSpec onapComponentSpec) {
Map<String, Object> response = new HashMap<>();
StartInputs startInputs = new StartInputs();
@@ -71,7 +72,7 @@ public class StartInputsService {
String.format("concat: [\"%s:\", {get_input: external_port_%d}]", ports[0],
count));
- LinkedHashMap<String, Object> portType = new LinkedHashMap();
+ Map<String, Object> portType = new LinkedHashMap();
portType.put("type", "string");
portType.put("default", ports[1]);
inputs.put("external_port_" + count, portType);
@@ -81,7 +82,7 @@ public class StartInputsService {
startInputs.setPorts(portList);
- LinkedHashMap<String, Object> envMap = new LinkedHashMap();
+ Map<String, Object> envMap = new LinkedHashMap();
if (onapComponentSpec.getAuxilary().getDatabases() != null) {
Map<String, Object> envVars =
pgaasNodeService.getEnvVariables(onapComponentSpec.getAuxilary().getDatabases());
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StartService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StartService.java
index 6c92c6f..7f3602f 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StartService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StartService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -30,7 +31,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
-import java.util.LinkedHashMap;
import java.util.Map;
/**
@@ -51,13 +51,13 @@ public class StartService {
* @return
*/
public Map<String, Object> createStart(
- Map<String, LinkedHashMap<String, Object>> inputs, OnapComponentSpec onapComponentSpec) {
+ Map<String, Map<String, Object>> inputs, OnapComponentSpec onapComponentSpec) {
Map<String, Object> response = new HashMap<>();
Start start = new Start();
Map<String, Object> startInputsResponse =
startInputsService.createStartInputs(inputs, onapComponentSpec);
- inputs = (Map<String, LinkedHashMap<String, Object>>) startInputsResponse.get("inputs");
+ inputs = (Map<String,Map<String, Object>>) startInputsResponse.get("inputs");
start.setInputs((StartInputs) startInputsResponse.get("startInputs"));
response.put("start", start);
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StreamService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StreamService.java
index f27ea48..17699a8 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StreamService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/StreamService.java
@@ -64,7 +64,7 @@ public class StreamService {
OnapComponentSpec onapComponentSpec,
BlueprintHelperService blueprintHelperService,
DmaapService dmaapService,
- Map<String, LinkedHashMap<String, Object>> inputs,
+ Map<String, Map<String, Object>> inputs,
boolean isDmaap) {
Map<String, BaseStream> streamPublishes = new TreeMap<>();
@@ -75,23 +75,23 @@ public class StreamService {
for (Publishes publishes : onapComponentSpec.getStreams().getPublishes()) {
if (blueprintHelperService.isDataRouterType(publishes.getType())) {
String config = publishes.getConfig_key();
- String name = config + Constants._FEED;
+ String name = config + Constants.A_FEED;
Map<String, Object> dmaapDataRouterResponse =
dmaapService.createDmaapDataRouter(inputs, config, name, isDmaap);
inputs =
- (Map<String, LinkedHashMap<String, Object>>) dmaapDataRouterResponse
+ (Map<String, Map<String, Object>>) dmaapDataRouterResponse
.get("inputs");
Dmaap dmaap = (Dmaap) dmaapDataRouterResponse.get("dmaap");
dmaap.setType(publishes.getType());
streamPublishes.put(config, dmaap);
} else if (blueprintHelperService.isMessageRouterType(publishes.getType())) {
String config = publishes.getConfig_key();
- String name = config + Constants._TOPIC;
+ String name = config + Constants.A_TOPIC;
Map<String, Object> dmaapDataRouterResponse =
dmaapService
.createDmaapMessageRouter(inputs, config, 'p', name, name, isDmaap);
inputs =
- (Map<String, LinkedHashMap<String, Object>>) dmaapDataRouterResponse
+ (Map<String, Map<String, Object>>) dmaapDataRouterResponse
.get("inputs");
Dmaap dmaap = (Dmaap) dmaapDataRouterResponse.get("dmaap");
dmaap.setType(publishes.getType());
@@ -118,7 +118,7 @@ public class StreamService {
OnapComponentSpec onapComponentSpec,
BlueprintHelperService blueprintHelperService,
DmaapService dmaapService,
- Map<String, LinkedHashMap<String, Object>> inputs,
+ Map<String, Map<String, Object>> inputs,
boolean isDmaap) {
Map<String, BaseStream> streamSubscribes = new TreeMap<>();
@@ -129,23 +129,23 @@ public class StreamService {
for (Subscribes subscribes : onapComponentSpec.getStreams().getSubscribes()) {
if (blueprintHelperService.isDataRouterType(subscribes.getType())) {
String config = subscribes.getConfig_key();
- String name = config + Constants._FEED;
+ String name = config + Constants.A_FEED;
Map<String, Object> dmaapDataRouterResponse =
dmaapService.createDmaapDataRouter(inputs, config, name, isDmaap);
inputs =
- (Map<String, LinkedHashMap<String, Object>>) dmaapDataRouterResponse
+ (Map<String, Map<String, Object>>) dmaapDataRouterResponse
.get("inputs");
Dmaap dmaap = (Dmaap) dmaapDataRouterResponse.get("dmaap");
dmaap.setType(subscribes.getType());
streamSubscribes.put(config, dmaap);
} else if (blueprintHelperService.isMessageRouterType(subscribes.getType())) {
String config = subscribes.getConfig_key();
- String name = config + Constants._TOPIC;
+ String name = config + Constants.A_TOPIC;
Map<String, Object> dmaapDataRouterResponse =
dmaapService
.createDmaapMessageRouter(inputs, config, 's', name, name, isDmaap);
inputs =
- (Map<String, LinkedHashMap<String, Object>>) dmaapDataRouterResponse
+ (Map<String, Map<String, Object>>) dmaapDataRouterResponse
.get("inputs");
Dmaap dmaap = (Dmaap) dmaapDataRouterResponse.get("dmaap");
dmaap.setType(subscribes.getType());
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/kafka/KafkaStreamService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/kafka/KafkaStreamService.java
index 2090ef0..c36387c 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/kafka/KafkaStreamService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/kafka/KafkaStreamService.java
@@ -59,7 +59,7 @@ public class KafkaStreamService {
* @param streamName Stream name
* @return
*/
- public Map<String, LinkedHashMap<String, Object>> createStreamPublishInputs(String streamName) {
+ public Map<String, Map<String, Object>> createStreamPublishInputs(String streamName) {
return createStreamInputs(streamName + PUBLISH_URL_SUFFIX);
}
@@ -69,7 +69,7 @@ public class KafkaStreamService {
* @param streamName Stream name
* @return
*/
- public Map<String, LinkedHashMap<String, Object>> createStreamSubscribeInputs(String streamName) {
+ public Map<String, Map<String, Object>> createStreamSubscribeInputs(String streamName) {
return createStreamInputs(streamName + SUBSCRIBE_URL_SUFFIX);
}
@@ -81,7 +81,7 @@ public class KafkaStreamService {
*/
public Map<String, KafkaStream> createAppPropertiesPublish(String streamName) {
- LinkedHashMap<String, KafkaStream> kafkaStreamMap = new LinkedHashMap<>();
+ Map<String, KafkaStream> kafkaStreamMap = new LinkedHashMap<>();
KafkaStream kafkaStream = createAppProperties(streamName, PUBLISH_URL_SUFFIX);
kafkaStreamMap.put(streamName, kafkaStream);
@@ -97,7 +97,7 @@ public class KafkaStreamService {
*/
public Map<String, KafkaStream> createAppPropertiesSubscribe(String streamName) {
- LinkedHashMap<String, KafkaStream> kafkaStreamMap = new LinkedHashMap<>();
+ Map<String, KafkaStream> kafkaStreamMap = new LinkedHashMap<>();
KafkaStream kafkaStream = createAppProperties(streamName, SUBSCRIBE_URL_SUFFIX);
kafkaStreamMap.put(streamName, kafkaStream);
@@ -111,25 +111,25 @@ public class KafkaStreamService {
return new KafkaStream(topicName);
}
- private Map<String, LinkedHashMap<String, Object>> createStreamInputs(String streamName) {
- LinkedHashMap<String, LinkedHashMap<String, Object>> streamInputs = createBaseInputs();
- LinkedHashMap<String, Object> stream =
+ private Map<String, Map<String, Object>> createStreamInputs(String streamName) {
+ Map<String, Map<String, Object>> streamInputs = createBaseInputs();
+ Map<String, Object> stream =
blueprintHelperService.createStringInput(DEFAULT_STREAM_URL);
streamInputs.put(streamName, stream);
return streamInputs;
}
- private LinkedHashMap<String, LinkedHashMap<String, Object>> createBaseInputs() {
- LinkedHashMap<String, LinkedHashMap<String, Object>> baseInputs = new LinkedHashMap<>();
+ private Map<String, Map<String, Object>> createBaseInputs() {
+ Map<String, Map<String, Object>> baseInputs = new LinkedHashMap<>();
- LinkedHashMap<String, Object> kafka_message_router = blueprintHelperService
+ Map<String, Object> kafka_message_router = blueprintHelperService
.createStringInput(DEFAULT_BOOTSTRAP_SERVER);
baseInputs.put(KAFKA_INFO_BOOTSTRAP_SERVERS_INPUT_NAME, kafka_message_router);
- LinkedHashMap<String, Object> kafka_username = blueprintHelperService.createStringInput(DEFAULT_AAF_USER);
+ Map<String, Object> kafka_username = blueprintHelperService.createStringInput(DEFAULT_AAF_USER);
baseInputs.put(AFF_KAFKA_USER_INPUT_NAME, kafka_username);
- LinkedHashMap<String, Object> kafka_password = blueprintHelperService.createStringInput(DEFAULT_AAF_PASSWORD);
+ Map<String, Object> kafka_password = blueprintHelperService.createStringInput(DEFAULT_AAF_PASSWORD);
baseInputs.put(AAF_KAFKA_PASSWORD_INPUT_NAME, kafka_password);
return baseInputs;
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/DmaapBlueprintCreatorService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/DmaapBlueprintCreatorService.java
index bf68f81..4ab0c84 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/DmaapBlueprintCreatorService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/DmaapBlueprintCreatorService.java
@@ -4,7 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
- * * Copyright (c) 2020 Nokia. All rights reserved.
+ * * Copyright (c) 2020-2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -43,7 +43,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
-import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeMap;
@@ -85,9 +84,8 @@ public class DmaapBlueprintCreatorService {
blueprint.setTosca_definitions_version(Constants.TOSCA_DEF_VERSION);
blueprint.setDescription(onapComponentSpec.getSelf().getDescription());
- Map<String, LinkedHashMap<String, Object>> inputs = new TreeMap<>();
+ Map<String, Map<String, Object>> inputs = new TreeMap<>();
- // if (!"".equals(input.getImportPath()))
if (!StringUtils.isEmpty(input.getImportPath())) {
blueprint.setImports(importsService.createImportsFromFile(input.getImportPath()));
} else {
@@ -99,7 +97,7 @@ public class DmaapBlueprintCreatorService {
Map<String, Object> dmaapNodeResponse =
nodeService
.createDmaapNode(onapComponentSpec, inputs, input.getServiceNameOverride());
- inputs = (Map<String, LinkedHashMap<String, Object>>) dmaapNodeResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) dmaapNodeResponse.get("inputs");
nodeTemplate.put(
onapComponentSpec.getSelf().getName(), (Node) dmaapNodeResponse.get("dmaapNode"));
@@ -107,17 +105,17 @@ public class DmaapBlueprintCreatorService {
if (onapComponentSpec.getStreams().getPublishes() != null) {
for (Publishes publishes : onapComponentSpec.getStreams().getPublishes()) {
if (blueprintHelperService.isMessageRouterType(publishes.getType())) {
- String topic = publishes.getConfig_key() + Constants._TOPIC;
+ String topic = publishes.getConfig_key() + Constants.A_TOPIC;
Map<String, Object> topicNodeResponse = nodeService
.createTopicNode(inputs, topic);
- inputs = (Map<String, LinkedHashMap<String, Object>>) topicNodeResponse
+ inputs = (Map<String, Map<String, Object>>) topicNodeResponse
.get("inputs");
nodeTemplate.put(topic, (Node) topicNodeResponse.get("topicNode"));
} else if (blueprintHelperService.isDataRouterType(publishes.getType())) {
- String feed = publishes.getConfig_key() + Constants._FEED;
+ String feed = publishes.getConfig_key() + Constants.A_FEED;
Map<String, Object> feedNodeResponse = nodeService
.createFeedNode(inputs, feed);
- inputs = (Map<String, LinkedHashMap<String, Object>>) feedNodeResponse
+ inputs = (Map<String, Map<String, Object>>) feedNodeResponse
.get("inputs");
nodeTemplate.put(feed, (Node) feedNodeResponse.get("feedNode"));
}
@@ -126,17 +124,17 @@ public class DmaapBlueprintCreatorService {
if (onapComponentSpec.getStreams().getSubscribes() != null) {
for (Subscribes s : onapComponentSpec.getStreams().getSubscribes()) {
if (blueprintHelperService.isMessageRouterType(s.getType())) {
- String topic = s.getConfig_key() + Constants._TOPIC;
+ String topic = s.getConfig_key() + Constants.A_TOPIC;
Map<String, Object> topicNodeResponse = nodeService
.createTopicNode(inputs, topic);
- inputs = (Map<String, LinkedHashMap<String, Object>>) topicNodeResponse
+ inputs = (Map<String, Map<String, Object>>) topicNodeResponse
.get("inputs");
nodeTemplate.put(topic, (Node) topicNodeResponse.get("topicNode"));
} else if (blueprintHelperService.isDataRouterType(s.getType())) {
- String feed = s.getConfig_key() + Constants._FEED;
+ String feed = s.getConfig_key() + Constants.A_FEED;
Map<String, Object> feedNodeResponse = nodeService
.createFeedNode(inputs, feed);
- inputs = (Map<String, LinkedHashMap<String, Object>>) feedNodeResponse
+ inputs = (Map<String, Map<String, Object>>) feedNodeResponse
.get("inputs");
nodeTemplate.put(feed, (Node) feedNodeResponse.get("feedNode"));
}
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/StreamsService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/StreamsService.java
index 051b060..8437304 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/StreamsService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/dmaap/StreamsService.java
@@ -4,6 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -55,7 +56,7 @@ public class StreamsService {
* @return
*/
public Map<String, Object> createStreams(
- Map<String, LinkedHashMap<String, Object>> inputs,
+ Map<String, Map<String, Object>> inputs,
String name,
String type,
String key,
@@ -64,7 +65,7 @@ public class StreamsService {
Map<String, Object> response = new HashMap<>();
Streams streams = new Streams();
- LinkedHashMap<String, Object> stringType = new LinkedHashMap();
+ Map<String, Object> stringType = new LinkedHashMap();
stringType.put("type", "string");
streams.setName(name);
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/onap/OnapBlueprintCreatorService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/onap/OnapBlueprintCreatorService.java
index afc02f3..8ff235c 100644
--- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/onap/OnapBlueprintCreatorService.java
+++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/onap/OnapBlueprintCreatorService.java
@@ -4,7 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
- * * Copyright (c) 2020 Nokia. All rights reserved.
+ * * Copyright (c) 2020-2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -40,7 +40,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
-import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeMap;
@@ -78,7 +77,6 @@ public class OnapBlueprintCreatorService {
OnapBlueprint blueprint = new OnapBlueprint();
blueprint.setTosca_definitions_version(Constants.TOSCA_DEF_VERSION);
- // if (!"".equals(input.getImportPath()))
if (!StringUtils.isEmpty(input.getImportPath())) {
blueprint.setImports(importsService.createImportsFromFile(input.getImportPath()));
} else {
@@ -87,12 +85,12 @@ public class OnapBlueprintCreatorService {
Map<String, Node> nodeTemplate = new TreeMap<>();
String nodeName = onapComponentSpec.getSelf().getName();
- Map<String, LinkedHashMap<String, Object>> inputs = new TreeMap<>();
+ Map<String, Map<String, Object>> inputs = new TreeMap<>();
Map<String, Object> onapNodeResponse =
nodeService
.createOnapNode(inputs, onapComponentSpec, input.getServiceNameOverride());
- inputs = (Map<String, LinkedHashMap<String, Object>>) onapNodeResponse.get("inputs");
+ inputs = (Map<String, Map<String, Object>>) onapNodeResponse.get("inputs");
nodeTemplate.put(nodeName, (Node) onapNodeResponse.get("onapNode"));
blueprint.setNode_templates(nodeTemplate);
diff --git a/mod/bpgenerator/onap/src/main/resources/bpgen.properties b/mod/bpgenerator/onap/src/main/resources/bpgen.properties
index 69a3ad6..5bc0ab0 100644
--- a/mod/bpgenerator/onap/src/main/resources/bpgen.properties
+++ b/mod/bpgenerator/onap/src/main/resources/bpgen.properties
@@ -4,7 +4,7 @@
# * org.onap.dcae
# * ================================================================================
# * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
-# * Copyright (c) 2020 Nokia. All rights reserved.
+# * Copyright (c) 2020-2021 Nokia. All rights reserved.
# * ================================================================================
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
@@ -23,10 +23,11 @@
#
imports.onap.types=https://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml
-imports.onap.K8s.plugintypes=plugin:k8splugin?version=3.4.2
+imports.onap.K8s.plugintypes=plugin:k8splugin?version=>=3.5.1,<4.0.0
imports.onap.K8s.dcaepolicyplugin=plugin:dcaepolicyplugin?version=2.4.0
imports.dmaap.dmaapplugin=plugin:dmaap?version=1.5.0
import.Postgres=plugin:pgaas?version=1.3.0
import.Clamp=plugin:clamppolicyplugin?version=1.1.0
-
+resources.cpuLimit=${BP_RESOURCES_CPU_LIMIT:250m}
+resources.memoryLimit=${BP_RESOURCES_MEMORY_LIMIT:128Mi}
diff --git a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/AppConfigServiceTest.java b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/AppConfigServiceTest.java
new file mode 100644
index 0000000..86e304e
--- /dev/null
+++ b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/AppConfigServiceTest.java
@@ -0,0 +1,174 @@
+/*
+ *
+ * * ============LICENSE_START=======================================================
+ * * org.onap.dcae
+ * * ================================================================================
+ * * Copyright (c) 2021 Nokia Intellectual Property. All rights reserved.
+ * * ================================================================================
+ * * Licensed under the Apache License, Version 2.0 (the "License");
+ * * you may not use this file except in compliance with the License.
+ * * You may obtain a copy of the License at
+ * *
+ * * http://www.apache.org/licenses/LICENSE-2.0
+ * *
+ * * Unless required by applicable law or agreed to in writing, software
+ * * distributed under the License is distributed on an "AS IS" BASIS,
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * * See the License for the specific language governing permissions and
+ * * limitations under the License.
+ * * ============LICENSE_END=========================================================
+ *
+ *
+ */
+
+package org.onap.blueprintgenerator.service.common;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.when;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.onap.blueprintgenerator.model.common.Appconfig;
+import org.onap.blueprintgenerator.model.common.GetInput;
+import org.onap.blueprintgenerator.model.componentspec.OnapComponentSpec;
+import org.onap.blueprintgenerator.model.componentspec.common.Parameters;
+import org.onap.blueprintgenerator.service.InfoService;
+import org.onap.blueprintgenerator.service.base.BlueprintHelperService;
+import org.onap.blueprintgenerator.service.common.kafka.KafkaStreamService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+@RunWith(SpringJUnit4ClassRunner.class)
+@ContextConfiguration(classes = {AppConfigService.class, BlueprintHelperService.class, DmaapService.class,
+ InfoService.class, StreamService.class, KafkaStreamService.class},
+ initializers = ConfigFileApplicationContextInitializer.class)
+public class AppConfigServiceTest {
+
+ private static final String TEST_PARAMETER_NAME = "testParameter";
+ private static final String INPUTS = "inputs";
+ private static final String TYPE = "type";
+ private static final String DEFAULT = "default";
+
+ private static final String PARAMETERS_TYPE_STRING = "string";
+ private static final String PARAMETERS_TYPE_INTEGER = "integer";
+ private static final String PARAMETERS_TYPE_BOOLEAN = "boolean";
+ private static final String PARAMETERS_TYPE_NUMBER = "number";
+
+ private static final String STRING_INPUT_TYPE = "string";
+ private static final String INTEGER_INPUT_TYPE = "integer";
+ private static final String BOOLEAN_INPUT_TYPE = "boolean";
+ private static final String UNKNOWN_TYPE = "test_unknown_type";
+
+ private static final boolean BOOLEAN_TEST_VALUE = true;
+ private static final String TEST_STRING_VALUE = "testValue";
+ private static final String APP_CONFIG = "appconfig";
+
+ @Autowired
+ private AppConfigService appConfigService;
+
+ private OnapComponentSpec componentSpec;
+
+ @Before
+ public void setUp() {
+ componentSpec = Mockito.mock(OnapComponentSpec.class);
+ }
+
+ @Test
+ public void shouldCreateStringInputForStringParameter() {
+
+ mockParameters(PARAMETERS_TYPE_STRING, TEST_STRING_VALUE);
+ Map<String, Map<String, Object>> inputs = new HashMap<>();
+
+ Map<String, Object> appConfig = appConfigService.createAppconfig(inputs, componentSpec, false);
+ Map<String, Object> createdInputs = (Map<String, Object>) appConfig.get(INPUTS);
+ Map<String, Object> createdParameters = (Map<String, Object>) createdInputs.get(TEST_PARAMETER_NAME);
+
+ assertAppConfigContainsParameterWithCorrectInputName(appConfig);
+ assertEquals(STRING_INPUT_TYPE, createdParameters.get(TYPE));
+ assertEquals(TEST_STRING_VALUE, createdParameters.get(DEFAULT));
+ }
+
+ @Test
+ public void shouldCreateStringInputForUnknownParameter() {
+
+ mockParameters(UNKNOWN_TYPE, TEST_STRING_VALUE);
+ Map<String, Map<String, Object>> inputs = new HashMap<>();
+
+ Map<String, Object> appConfig = appConfigService.createAppconfig(inputs, componentSpec, false);
+ Map<String, Object> createdInputs = (Map<String, Object>) appConfig.get(INPUTS);
+ Map<String, Object> createdParameters = (Map<String, Object>) createdInputs.get(TEST_PARAMETER_NAME);
+
+ assertAppConfigContainsParameterWithCorrectInputName(appConfig);
+ assertEquals(STRING_INPUT_TYPE, createdParameters.get(TYPE));
+ assertEquals(TEST_STRING_VALUE, createdParameters.get(DEFAULT));
+ }
+
+ @Test
+ public void shouldCreateBooleanInputForBooleanParameter() {
+
+ mockParameters(PARAMETERS_TYPE_BOOLEAN, BOOLEAN_TEST_VALUE);
+ Map<String, Map<String, Object>> inputs = new HashMap<>();
+
+ Map<String, Object> appConfig = appConfigService.createAppconfig(inputs, componentSpec, false);
+ Map<String, Object> createdInputs = (Map<String, Object>) appConfig.get(INPUTS);
+ Map<String, Object> createdParameters = (Map<String, Object>) createdInputs.get(TEST_PARAMETER_NAME);
+
+ assertAppConfigContainsParameterWithCorrectInputName(appConfig);
+ assertEquals(BOOLEAN_INPUT_TYPE, createdParameters.get(TYPE));
+ assertEquals(BOOLEAN_TEST_VALUE, createdParameters.get(DEFAULT));
+ }
+
+ @Test
+ public void shouldCreateIntegerInputForIntegerParameter() {
+
+ mockParameters(PARAMETERS_TYPE_INTEGER, 123);
+ Map<String, Map<String, Object>> inputs = new HashMap<>();
+
+ Map<String, Object> appConfig = appConfigService.createAppconfig(inputs, componentSpec, false);
+ Map<String, Object> createdInputs = (Map<String, Object>) appConfig.get(INPUTS);
+ Map<String, Object> createdParameters = (Map<String, Object>) createdInputs.get(TEST_PARAMETER_NAME);
+
+ assertAppConfigContainsParameterWithCorrectInputName(appConfig);
+ assertEquals(INTEGER_INPUT_TYPE, createdParameters.get(TYPE));
+ assertEquals(123, createdParameters.get(DEFAULT));
+ }
+
+ @Test
+ public void shouldCreateIntegerInputForNumberParameter() {
+
+ mockParameters(PARAMETERS_TYPE_NUMBER, 123);
+ Map<String, Map<String, Object>> inputs = new HashMap<>();
+
+ Map<String, Object> appConfig = appConfigService.createAppconfig(inputs, componentSpec, false);
+ Map<String, Object> createdInputs = (Map<String, Object>) appConfig.get(INPUTS);
+ Map<String, Object> createdParameters = (Map<String, Object>) createdInputs.get(TEST_PARAMETER_NAME);
+
+
+ assertAppConfigContainsParameterWithCorrectInputName(appConfig);
+ assertEquals(INTEGER_INPUT_TYPE, createdParameters.get(TYPE));
+ assertEquals(123, createdParameters.get(DEFAULT));
+ }
+
+ private void assertAppConfigContainsParameterWithCorrectInputName(Map<String, Object> appConfig) {
+ Appconfig appConfigModel = (Appconfig) appConfig.get(APP_CONFIG);
+ Object bpInputName = ((GetInput) appConfigModel.getParams().get(TEST_PARAMETER_NAME)).getBpInputName();
+ assertEquals(bpInputName, TEST_PARAMETER_NAME);
+ }
+
+ private void mockParameters(String type, Object value) {
+ Parameters testParameter = new Parameters();
+ testParameter.setName(TEST_PARAMETER_NAME);
+ testParameter.setType(type);
+ testParameter.setSourced_at_deployment(true);
+ testParameter.setValue(value);
+ Parameters[] parametersArray = new Parameters[1];
+ parametersArray[0] = testParameter;
+ when(componentSpec.getParameters()).thenReturn(parametersArray);
+ }
+}
diff --git a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/PropertiesServiceTest.java b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/PropertiesServiceTest.java
index a598315..468a402 100644
--- a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/PropertiesServiceTest.java
+++ b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/PropertiesServiceTest.java
@@ -128,7 +128,7 @@ public class PropertiesServiceTest {
OnapComponentSpec onapComponentSpec = getOnapComponentSpecWithStreamsPublishes();
Publishes publishes = onapComponentSpec.getStreams().getPublishes()[0];
when(blueprintHelperService.isMessageRouterType(eq(publishes.getType()))).thenReturn(true);
- when(streamsService.createStreams(any(), eq(publishes.getConfig_key() + Constants._TOPIC),
+ when(streamsService.createStreams(any(), eq(publishes.getConfig_key() + Constants.A_TOPIC),
eq(publishes.getType()),
eq(publishes.getConfig_key()),
eq(publishes.getRoute()),
@@ -153,7 +153,7 @@ public class PropertiesServiceTest {
OnapComponentSpec onapComponentSpec = getOnapComponentSpecWithStreamsPublishes();
Publishes publishes = onapComponentSpec.getStreams().getPublishes()[0];
when(blueprintHelperService.isDataRouterType(eq(publishes.getType()))).thenReturn(true);
- when(streamsService.createStreams(any(), eq(publishes.getConfig_key() + Constants._FEED),
+ when(streamsService.createStreams(any(), eq(publishes.getConfig_key() + Constants.A_FEED),
eq(publishes.getType()),
eq(publishes.getConfig_key()),
eq(publishes.getRoute()),
@@ -178,7 +178,7 @@ public class PropertiesServiceTest {
OnapComponentSpec onapComponentSpec = getOnapComponentSpecWithStreamsSubscribes();
Subscribes subscribes = onapComponentSpec.getStreams().getSubscribes()[0];
when(blueprintHelperService.isMessageRouterType(eq(subscribes.getType()))).thenReturn(true);
- when(streamsService.createStreams(any(), eq(subscribes.getConfig_key() + Constants._TOPIC),
+ when(streamsService.createStreams(any(), eq(subscribes.getConfig_key() + Constants.A_TOPIC),
eq(subscribes.getType()),
eq(subscribes.getConfig_key()),
eq(subscribes.getRoute()),
@@ -203,7 +203,7 @@ public class PropertiesServiceTest {
OnapComponentSpec onapComponentSpec = getOnapComponentSpecWithStreamsSubscribes();
Subscribes subscribes = onapComponentSpec.getStreams().getSubscribes()[0];
when(blueprintHelperService.isDataRouterType(eq(subscribes.getType()))).thenReturn(true);
- when(streamsService.createStreams(any(), eq(subscribes.getConfig_key() + Constants._FEED),
+ when(streamsService.createStreams(any(), eq(subscribes.getConfig_key() + Constants.A_FEED),
eq(subscribes.getType()),
eq(subscribes.getConfig_key()),
eq(subscribes.getRoute()),
diff --git a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/StreamServiceTest.java b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/StreamServiceTest.java
index fe93f5f..d2936da 100644
--- a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/StreamServiceTest.java
+++ b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/StreamServiceTest.java
@@ -279,11 +279,11 @@ class StreamServiceTest {
return subscribes;
}
- private Map<String, LinkedHashMap<String, Object>> createInputs() {
- LinkedHashMap<String, Object> map = new LinkedHashMap<>();
+ private Map<String, Map<String, Object>> createInputs() {
+ Map<String, Object> map = new LinkedHashMap<>();
map.put("key-1", "obj-1");
- Map<String, LinkedHashMap<String, Object>> mapsMap = new HashMap<>();
+ Map<String, Map<String, Object>> mapsMap = new HashMap<>();
mapsMap.put("inputs", map);
return mapsMap;
}
diff --git a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/kafka/KafkaStreamServiceTest.java b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/kafka/KafkaStreamServiceTest.java
index cad3b71..54beabb 100644
--- a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/kafka/KafkaStreamServiceTest.java
+++ b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/service/common/kafka/KafkaStreamServiceTest.java
@@ -27,7 +27,6 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import java.util.LinkedHashMap;
import java.util.Map;
import org.junit.Test;
@@ -55,12 +54,12 @@ public class KafkaStreamServiceTest {
@Test
public void createCorrectStreamCommonInputs() {
- Map<String, LinkedHashMap<String, Object>> publishInputs = kafkaStreamService
+ Map<String, Map<String, Object>> publishInputs = kafkaStreamService
.createStreamPublishInputs("test_stream_name");
- LinkedHashMap<String, Object> kafka_bootstrap_servers = publishInputs.get("kafka_bootstrap_servers");
- LinkedHashMap<String, Object> kafka_username = publishInputs.get("kafka_username");
- LinkedHashMap<String, Object> kafka_password = publishInputs.get("kafka_password");
+ Map<String, Object> kafka_bootstrap_servers = publishInputs.get("kafka_bootstrap_servers");
+ Map<String, Object> kafka_username = publishInputs.get("kafka_username");
+ Map<String, Object> kafka_password = publishInputs.get("kafka_password");
assertNotNull(kafka_bootstrap_servers);
assertNotNull(kafka_username);
@@ -73,10 +72,10 @@ public class KafkaStreamServiceTest {
@Test
public void createCorrectStreamPublishInput() {
- Map<String, LinkedHashMap<String, Object>> publishInputs = kafkaStreamService
+ Map<String, Map<String, Object>> publishInputs = kafkaStreamService
.createStreamPublishInputs(TEST_STREAM_NAME);
- LinkedHashMap<String, Object> kafka_stream_name = publishInputs.get(TEST_STREAM_NAME + PUBLISH_URL_SUFFIX);
+ Map<String, Object> kafka_stream_name = publishInputs.get(TEST_STREAM_NAME + PUBLISH_URL_SUFFIX);
assertNotNull(kafka_stream_name);
@@ -85,10 +84,10 @@ public class KafkaStreamServiceTest {
@Test
public void createCorrectStreamSubscribeInput() {
- Map<String, LinkedHashMap<String, Object>> publishInputs = kafkaStreamService
+ Map<String, Map<String, Object>> publishInputs = kafkaStreamService
.createStreamSubscribeInputs(TEST_STREAM_NAME);
- LinkedHashMap<String, Object> kafka_stream_name = publishInputs.get(TEST_STREAM_NAME + SUBSCRIBE_URL_SUFFIX);
+ Map<String, Object> kafka_stream_name = publishInputs.get(TEST_STREAM_NAME + SUBSCRIBE_URL_SUFFIX);
assertNotNull(kafka_stream_name);
diff --git a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/ExternalCertificateParametersFactoryServiceTest.java b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/ExternalCertificateParametersFactoryServiceTest.java
index 718ea4a..85563d8 100644
--- a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/ExternalCertificateParametersFactoryServiceTest.java
+++ b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/ExternalCertificateParametersFactoryServiceTest.java
@@ -1,7 +1,7 @@
/*============LICENSE_START=======================================================
org.onap.dcae
================================================================================
-Copyright (c) 2020 Nokia Intellectual Property. All rights reserved.
+Copyright (c) 2020-2021 Nokia Intellectual Property. All rights reserved.
Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,7 +26,6 @@ import org.onap.blueprintgenerator.service.common.ExternalCertificateParametersF
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
-import java.util.LinkedHashMap;
import java.util.Map;
import static org.junit.Assert.assertEquals;
@@ -65,7 +64,7 @@ public class ExternalCertificateParametersFactoryServiceTest extends BlueprintGe
@Test
public void shouldCreateCorrectInputListWithDefaultValuesTakenFromComponentSpec() {
- Map<String, LinkedHashMap<String, Object>> result =
+ Map<String, Map<String, Object>> result =
externalCertificateParametersFactoryService.createInputList();
assertEquals(
Constants.DEFAULT_COMMON_NAME, result.get(PREFIXED_COMMON_NAME_FIELD).get(DEFAULT));
diff --git a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/OnapBlueprintCreatorServiceTest.java b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/OnapBlueprintCreatorServiceTest.java
index 866a324..0862191 100644
--- a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/OnapBlueprintCreatorServiceTest.java
+++ b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/OnapBlueprintCreatorServiceTest.java
@@ -4,7 +4,7 @@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
- * * Copyright (c) 2020 Nokia. All rights reserved.
+ * * Copyright (c) 2020-2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@ -30,7 +30,6 @@ import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.nio.file.Paths;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
@@ -82,7 +81,7 @@ public class OnapBlueprintCreatorServiceTest extends BlueprintGeneratorTests {
"Service Name Override K8s", onapBlueprint, Constants.TOSCA_DEF_VERSION);
onapTestUtils.verifyBpImports("Service Name Override K8s", onapBlueprint, false);
- Map<String, LinkedHashMap<String, Object>> k8sBpInputs = onapBlueprint.getInputs();
+ Map<String, Map<String, Object>> k8sBpInputs = onapBlueprint.getInputs();
assertNotNull("Service Name Override K8s Blueprint Inputs Section is NULL", k8sBpInputs);
assertTrue(
"Service Name Override K8s Blueprint Inputs Section is Empty", k8sBpInputs.size() > 0);
@@ -92,7 +91,7 @@ public class OnapBlueprintCreatorServiceTest extends BlueprintGeneratorTests {
+ Constants.ONAP_INPUT_CPU_LIMIT
+ " Default is not matching",
k8sBpInputs.get(Constants.ONAP_INPUT_CPU_LIMIT).get("default"),
- Constants.ONAP_DEFAULT250m);
+ Constants.ONAP_DEFAULT250M);
assertEquals(
"Service Name Override K8s Blueprint:Inputs "
+ Constants.SERVICE_COMPONENT_NAME_OVERRIDE
@@ -119,7 +118,7 @@ public class OnapBlueprintCreatorServiceTest extends BlueprintGeneratorTests {
"Service Name Override K8s Blueprint Node Templates:Properties Section is NULL",
k8sBpNodeTemplateProperties);
- Map<String, LinkedHashMap<String, Object>> bpInputs = onapBlueprint.getInputs();
+ Map<String, Map<String, Object>> bpInputs = onapBlueprint.getInputs();
onapTestUtils
.verifyArtifacts("Service Name Override K8s", onapComponentSpec, bpInputs, "o");
@@ -173,7 +172,7 @@ public class OnapBlueprintCreatorServiceTest extends BlueprintGeneratorTests {
onapTestUtils.verifyBpImportsFromFile(
"Service Name Override with Import File K8s", onapBlueprint, input.getImportPath());
- Map<String, LinkedHashMap<String, Object>> k8sBpInputs = onapBlueprint.getInputs();
+ Map<String, Map<String, Object>> k8sBpInputs = onapBlueprint.getInputs();
assertNotNull(
"Service Name Override with Import File K8s Blueprint Inputs Section is NULL",
k8sBpInputs);
@@ -186,7 +185,7 @@ public class OnapBlueprintCreatorServiceTest extends BlueprintGeneratorTests {
+ Constants.ONAP_INPUT_CPU_LIMIT
+ " Default is not matching",
k8sBpInputs.get(Constants.ONAP_INPUT_CPU_LIMIT).get("default"),
- Constants.ONAP_DEFAULT250m);
+ Constants.ONAP_DEFAULT250M);
assertEquals(
"Service Name Override with Import File K8s Blueprint:Inputs "
+ Constants.SERVICE_COMPONENT_NAME_OVERRIDE
@@ -213,7 +212,7 @@ public class OnapBlueprintCreatorServiceTest extends BlueprintGeneratorTests {
"Service Name Override with Import File K8s Blueprint Node Templates:Properties Section is NULL",
k8sBpNodeTemplateProperties);
- Map<String, LinkedHashMap<String, Object>> bpInputs = onapBlueprint.getInputs();
+ Map<String, Map<String, Object>> bpInputs = onapBlueprint.getInputs();
onapTestUtils.verifyArtifacts(
"Service Name Override with Import File K8s", onapComponentSpec, bpInputs, "o");
@@ -300,7 +299,7 @@ public class OnapBlueprintCreatorServiceTest extends BlueprintGeneratorTests {
onapTestUtils
.verifyToscaDefVersion("DMAAP K8s", onapBlueprint, Constants.TOSCA_DEF_VERSION);
- Map<String, LinkedHashMap<String, Object>> k8sBpInputs = onapBlueprint.getInputs();
+ Map<String, Map<String, Object>> k8sBpInputs = onapBlueprint.getInputs();
assertNotNull("DMAAP K8s Blueprint Inputs Section is NULL", k8sBpInputs);
assertTrue("DMAAP K8s Blueprint Inputs Section is Empty", k8sBpInputs.size() > 0);
@@ -308,7 +307,7 @@ public class OnapBlueprintCreatorServiceTest extends BlueprintGeneratorTests {
"DMAAP K8s Blueprint:Inputs " + Constants.ONAP_INPUT_CPU_LIMIT
+ " Default is not matching",
k8sBpInputs.get(Constants.ONAP_INPUT_CPU_LIMIT).get("default"),
- Constants.ONAP_DEFAULT250m);
+ Constants.ONAP_DEFAULT250M);
assertEquals(
"DMAAP K8s Blueprint:Inputs "
+ Constants.SERVICE_COMPONENT_NAME_OVERRIDE
@@ -385,7 +384,7 @@ public class OnapBlueprintCreatorServiceTest extends BlueprintGeneratorTests {
onapTestUtils.verifyBpImportsFromFile(
"DMAAP with Import File K8s", onapBlueprint, input.getImportPath());
- Map<String, LinkedHashMap<String, Object>> k8sBpInputs = onapBlueprint.getInputs();
+ Map<String, Map<String, Object>> k8sBpInputs = onapBlueprint.getInputs();
assertNotNull("DMAAP with Import File K8s Blueprint Inputs Section is NULL", k8sBpInputs);
assertTrue(
"DMAAP with Import File K8s Blueprint Inputs Section is Empty", k8sBpInputs.size() > 0);
@@ -395,7 +394,7 @@ public class OnapBlueprintCreatorServiceTest extends BlueprintGeneratorTests {
+ Constants.ONAP_INPUT_CPU_LIMIT
+ " Default is not matching",
k8sBpInputs.get(Constants.ONAP_INPUT_CPU_LIMIT).get("default"),
- Constants.ONAP_DEFAULT250m);
+ Constants.ONAP_DEFAULT250M);
assertEquals(
"DMAAP with Import File K8s Blueprint:Inputs "
+ Constants.SERVICE_COMPONENT_NAME_OVERRIDE
diff --git a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/OnapTestUtils.java b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/OnapTestUtils.java
index 4b37ed8..e4abeaa 100644
--- a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/OnapTestUtils.java
+++ b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/OnapTestUtils.java
@@ -46,7 +46,6 @@ import org.springframework.stereotype.Component;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
-import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -384,7 +383,7 @@ public class OnapTestUtils extends BlueprintGeneratorTests {
public void verifyArtifacts(
String type,
OnapComponentSpec onapComponentSpec,
- Map<String, LinkedHashMap<String, Object>> inputs,
+ Map<String, Map<String, Object>> inputs,
String bptype) {
Artifacts[] csArtifacts = onapComponentSpec.getArtifacts();
assertNotNull(type + " ComponentSpec Artifacts Section is NULL", csArtifacts);
diff --git a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/TlsInfoTest.java b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/TlsInfoTest.java
index 433240f..4d23aa5 100644
--- a/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/TlsInfoTest.java
+++ b/mod/bpgenerator/onap/src/test/java/org/onap/blueprintgenerator/test/TlsInfoTest.java
@@ -1,7 +1,7 @@
/*============LICENSE_START=======================================================
org.onap.dcae
================================================================================
-Copyright (c) 2020 Nokia. All rights reserved.
+Copyright (c) 2020-2021 Nokia. All rights reserved.
Copyright (c) 2020 AT&T. All rights reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,6 +20,7 @@ limitations under the License.
package org.onap.blueprintgenerator.test;
+import java.util.Map;
import org.junit.Test;
import org.junit.runners.Parameterized;
import org.onap.blueprintgenerator.model.common.Input;
@@ -31,7 +32,6 @@ import org.onap.blueprintgenerator.model.dmaap.TlsInfo;
import java.nio.file.Paths;
import java.util.Arrays;
-import java.util.LinkedHashMap;
import java.util.List;
import static org.junit.Assert.assertEquals;
@@ -43,7 +43,6 @@ import static org.junit.Assert.assertNull;
* Test Case for Tls Info
*
*/
-// @RunWith(Parameterized.class)
public class TlsInfoTest extends BlueprintGeneratorTests {
@Parameterized.Parameter
@@ -201,7 +200,7 @@ public class TlsInfoTest extends BlueprintGeneratorTests {
private void assertContainsInputWithDefault(
OnapBlueprint bp, String inputName, Object defaultValue) {
- LinkedHashMap<String, Object> input = bp.getInputs().get(inputName);
+ Map<String, Object> input = bp.getInputs().get(inputName);
assertNotNull(input);
assertEquals(defaultValue, input.get("default"));
}
diff --git a/mod/bpgenerator/pom.xml b/mod/bpgenerator/pom.xml
index 540d3e2..fb831d2 100644
--- a/mod/bpgenerator/pom.xml
+++ b/mod/bpgenerator/pom.xml
@@ -5,7 +5,7 @@
~ * org.onap.dcae
~ * ================================================================================
~ * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
- ~ * Copyright (c) 2020 Nokia. All rights reserved.
+ ~ * Copyright (c) 2020-2021 Nokia. All rights reserved.
~ * ================================================================================
~ * Licensed under the Apache License, Version 2.0 (the "License");
~ * you may not use this file except in compliance with the License.
@@ -24,183 +24,186 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <groupId>org.onap.dcaegen2.platform.mod</groupId>
- <artifactId>blueprint-generator</artifactId>
- <version>1.7.2-SNAPSHOT</version>
- <packaging>pom</packaging>
+ <groupId>org.onap.dcaegen2.platform.mod</groupId>
+ <artifactId>blueprint-generator</artifactId>
+ <version>1.8.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <modules>
- <module>common</module>
- <module>onap</module>
- <module>onap-executable</module>
- </modules>
+ <modules>
+ <module>common</module>
+ <module>onap</module>
+ <module>onap-executable</module>
+ <module>coverage</module>
+ </modules>
- <name>BlueprintGenerator</name>
- <description>This is Parent Module used by DCAE and ONAP to generate Blueprints</description>
+ <name>BlueprintGenerator</name>
+ <description>This is Parent Module used by DCAE and ONAP to generate Blueprints</description>
- <parent>
- <groupId>org.onap.oparent</groupId>
- <artifactId>oparent</artifactId>
- <version>2.0.0</version>
- <relativePath/>
- </parent>
+ <parent>
+ <groupId>org.onap.oparent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>2.0.0</version>
+ <relativePath/>
+ </parent>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <java.version>11</java.version>
- <maven.compiler.source>${java.version}</maven.compiler.source>
- <maven.compiler.target>${java.version}</maven.compiler.target>
- <spring-boot.version>2.2.9.RELEASE</spring-boot.version>
- <jackson.version>2.9.7</jackson.version>
- <lombok.version>1.18.10</lombok.version>
- <gson.version>2.8.6</gson.version>
- <commons.io.version>2.6</commons.io.version>
- <commons.cli.version>1.4</commons.cli.version>
- <maven.surefireplugin.version>2.22.2</maven.surefireplugin.version>
- <maven.compilerplugin.version>3.8.1</maven.compilerplugin.version>
- <dockerfile-maven-plugin.version>1.4.10</dockerfile-maven-plugin.version>
- <docker.image.name>onap/${project.groupId}.${project.artifactId}</docker.image.name>
- <sonar.maven.plugin>3.0.2</sonar.maven.plugin>
- <sonar.junit.reportsPath>${project.basedir}/target/surefire-reports
- </sonar.junit.reportsPath>
- <sonar.surefire.reportsPath>${project.basedir}/target/surefire-reports
- </sonar.surefire.reportsPath>
- <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/target/site/jacoco-ut/jacoco.xml
- </sonar.coverage.jacoco.xmlReportPaths>
- </properties>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <java.version>11</java.version>
+ <maven.compiler.source>${java.version}</maven.compiler.source>
+ <maven.compiler.target>${java.version}</maven.compiler.target>
+ <spring-boot.version>2.2.9.RELEASE</spring-boot.version>
+ <jackson.version>2.9.7</jackson.version>
+ <lombok.version>1.18.10</lombok.version>
+ <gson.version>2.8.6</gson.version>
+ <commons.io.version>2.6</commons.io.version>
+ <commons.cli.version>1.4</commons.cli.version>
+ <maven.surefireplugin.version>2.22.2</maven.surefireplugin.version>
+ <maven.compilerplugin.version>3.8.1</maven.compilerplugin.version>
+ <dockerfile-maven-plugin.version>1.4.10</dockerfile-maven-plugin.version>
+ <docker.image.name>onap/${project.groupId}.${project.artifactId}</docker.image.name>
+ <sonar.maven.plugin>3.0.2</sonar.maven.plugin>
+ <sonar.junit.reportsPath>${project.basedir}/target/surefire-reports
+ </sonar.junit.reportsPath>
+ <sonar.surefire.reportsPath>${project.basedir}/target/surefire-reports
+ </sonar.surefire.reportsPath>
+ <sonar.coverage.exclusions>coverage/**</sonar.coverage.exclusions>
+ <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../coverage/target/site/jacoco-aggregate/jacoco.xml
+ </sonar.coverage.jacoco.xmlReportPaths>
+ <org.slf4j.version>1.7.30</org.slf4j.version>
+ </properties>
- <dependencies>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-context</artifactId>
- <version>5.2.0.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-core</artifactId>
- <version>5.2.0.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter</artifactId>
- <version>2.2.5.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-test</artifactId>
- <version>2.2.5.RELEASE</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-validation</artifactId>
- <version>2.2.5.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.projectlombok</groupId>
- <artifactId>lombok</artifactId>
- <version>${lombok.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>${gson.version}</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.dataformat</groupId>
- <artifactId>jackson-dataformat-yaml</artifactId>
- <version>${jackson.version}</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.12</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>3.1.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>info.picocli</groupId>
- <artifactId>picocli</artifactId>
- <version>3.9.6</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>${jackson.version}</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- <version>${jackson.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>${commons.io.version}</version>
- </dependency>
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>${commons.cli.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-model</artifactId>
- <version>3.3.9</version>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>5.2.0.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>5.2.0.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>2.2.5.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <version>2.2.5.RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-validation</artifactId>
+ <version>2.2.5.RELEASE</version>
+ </dependency>
+ <dependency>
+ <groupId>org.projectlombok</groupId>
+ <artifactId>lombok</artifactId>
+ <version>${lombok.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.gson</groupId>
+ <artifactId>gson</artifactId>
+ <version>${gson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-yaml</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.12</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>3.1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>info.picocli</groupId>
+ <artifactId>picocli</artifactId>
+ <version>3.9.6</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ <version>${jackson.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>${commons.io.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ <version>${commons.cli.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-model</artifactId>
+ <version>3.3.9</version>
+ </dependency>
+ </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.10.2</version>
- <configuration>
- <additionalparam>-Xdoclint:all</additionalparam>
- <additionalparam>-Xlint:all</additionalparam>
- </configuration>
- </plugin>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.10.2</version>
+ <configuration>
+ <additionalparam>-Xdoclint:all</additionalparam>
+ <additionalparam>-Xlint:all</additionalparam>
+ </configuration>
+ </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <phase>test</phase>
- <goals>
- <goal>report</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${maven.compilerplugin.version}</version>
- <configuration>
- <source>${maven.compiler.source}</source>
- <target>${maven.compiler.target}</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.sonarsource.scanner.maven</groupId>
- <artifactId>sonar-maven-plugin</artifactId>
- <version>${sonar.maven.plugin}</version>
- </plugin>
- </plugins>
- </build>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <phase>test</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven.compilerplugin.version}</version>
+ <configuration>
+ <source>${maven.compiler.source}</source>
+ <target>${maven.compiler.target}</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.sonarsource.scanner.maven</groupId>
+ <artifactId>sonar-maven-plugin</artifactId>
+ <version>${sonar.maven.plugin}</version>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/mod/bpgenerator/version.properties b/mod/bpgenerator/version.properties
index 75acd49..6db90f2 100644
--- a/mod/bpgenerator/version.properties
+++ b/mod/bpgenerator/version.properties
@@ -1,6 +1,6 @@
major=1
-minor=7
-patch=2
+minor=8
+patch=0
base_version=${major}.${minor}.${patch}
release_version=${base_version}
snapshot_version=${base_version}-SNAPSHOT
diff --git a/mod/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json b/mod/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json
index 56dbf3a..4a3597a 100644..100755
--- a/mod/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json
+++ b/mod/component-json-schemas/component-specification/dcae-cli-v2/component-spec-schema.json
@@ -904,7 +904,8 @@
"type": "string"
}
}
- }
+ },
+ "required": ["host", "container"]
},
"config_map_volume": {
"type": "object",
@@ -924,7 +925,8 @@
"type": "string"
}
}
- }
+ },
+ "required": ["config_volume", "container"]
},
"docker_healthcheck_http": {
"properties": {
@@ -987,4 +989,4 @@
]
}
}
-}
+} \ No newline at end of file
diff --git a/mod/onboardingapi/ChangeLog.md b/mod/onboardingapi/ChangeLog.md
index 28578d2..ede9878 100644
--- a/mod/onboardingapi/ChangeLog.md
+++ b/mod/onboardingapi/ChangeLog.md
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
+## [2.12.5]
+
+* Fix component-spec-schema bug: Failed validating 'oneOf' in schema['properties']['volumes']['items']
+
+
+## [2.12.4]
+
+* Update component-spec-schema to support: kafka stream subscribes and publishes, config maps as volumes
+
+## [2.12.3]
+
+* Add Python 3.8 support
+* Use Integration base image
## [2.12.1]
diff --git a/mod/onboardingapi/dcae_cli/_version.py b/mod/onboardingapi/dcae_cli/_version.py
index 7081b3b..21fd154 100644
--- a/mod/onboardingapi/dcae_cli/_version.py
+++ b/mod/onboardingapi/dcae_cli/_version.py
@@ -19,4 +19,4 @@
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
# -*- coding: utf-8 -*-
-__version__ = "2.12.4"
+__version__ = "2.12.5"
diff --git a/mod/onboardingapi/pom.xml b/mod/onboardingapi/pom.xml
index 796816f..c9da793 100644
--- a/mod/onboardingapi/pom.xml
+++ b/mod/onboardingapi/pom.xml
@@ -24,7 +24,7 @@ limitations under the License.
<groupId>org.onap.dcaegen2.platform.mod</groupId>
<artifactId>dcaegen2-platform-mod-onboardingapi</artifactId>
<name>dcaegen2-platform-mod-onboardingapi</name>
- <version>2.12.4-SNAPSHOT</version>
+ <version>2.12.5-SNAPSHOT</version>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
diff --git a/mod/runtimeapi/Changelog.md b/mod/runtimeapi/Changelog.md
new file mode 100644
index 0000000..3dd643c
--- /dev/null
+++ b/mod/runtimeapi/Changelog.md
@@ -0,0 +1,15 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](http://keepachangelog.com/)
+and this project adheres to [Semantic Versioning](http://semver.org/).
+
+## [1.2.3]
+- Update BPGenerator 1.7.3
+ - Update default k8splugin import
+ - Externalize resource limits defaults for generated blueprints
+
+## [1.2.2]
+- Update SpringFox dependencies to version 3.0.0
+ - Swagger documentation URL changed from: /swagger-ui.html to: /swagger-ui/index.html
diff --git a/mod/runtimeapi/pom.xml b/mod/runtimeapi/pom.xml
index 61f6558..11e5580 100644
--- a/mod/runtimeapi/pom.xml
+++ b/mod/runtimeapi/pom.xml
@@ -34,7 +34,7 @@ limitations under the License.
</parent>
<groupId>org.onap.dcaegen2.platform.mod</groupId>
<artifactId>runtimeapi</artifactId>
- <version>1.2.0</version>
+ <version>1.2.3</version>
<name>dcaegen2-platform-mod-runtimeapi</name>
<description>MOD Runtime API</description>
<properties>
@@ -108,6 +108,17 @@ limitations under the License.
<version>2.1.7.RELEASE</version>
<type>pom</type>
<scope>import</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework.plugin</groupId>
+ <artifactId>spring-plugin-core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.plugin</groupId>
+ <artifactId>spring-plugin-core</artifactId>
+ <version>2.0.0.RELEASE</version>
</dependency>
</dependencies>
</dependencyManagement>
diff --git a/mod/runtimeapi/runtime-core/pom.xml b/mod/runtimeapi/runtime-core/pom.xml
index 7031714..5514cc9 100644
--- a/mod/runtimeapi/runtime-core/pom.xml
+++ b/mod/runtimeapi/runtime-core/pom.xml
@@ -25,12 +25,12 @@ limitations under the License.
<parent>
<artifactId>runtimeapi</artifactId>
<groupId>org.onap.dcaegen2.platform.mod</groupId>
- <version>1.2.0</version>
+ <version>1.2.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>runtime-core</artifactId>
- <version>1.2.0</version>
+ <version>1.2.3</version>
<dependencies>
<dependency>
@@ -46,7 +46,7 @@ limitations under the License.
<dependency>
<groupId>org.onap.dcaegen2.platform.mod</groupId>
<artifactId>blueprint-generator-onap</artifactId>
- <version>1.7.1</version>
+ <version>1.7.3</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
diff --git a/mod/runtimeapi/runtime-web/pom.xml b/mod/runtimeapi/runtime-web/pom.xml
index 4c1a7c4..8b70ea4 100644
--- a/mod/runtimeapi/runtime-web/pom.xml
+++ b/mod/runtimeapi/runtime-web/pom.xml
@@ -24,10 +24,10 @@ limitations under the License.
<parent>
<groupId>org.onap.dcaegen2.platform.mod</groupId>
<artifactId>runtimeapi</artifactId>
- <version>1.2.0</version>
+ <version>1.2.3</version>
</parent>
<artifactId>runtime-web</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.2.3-SNAPSHOT</version>
<packaging>jar</packaging>
<name>runtime-web</name>
<description>MOD Runtime Web Module</description>
@@ -35,7 +35,7 @@ limitations under the License.
<dependency>
<groupId>org.onap.dcaegen2.platform.mod</groupId>
<artifactId>runtime-core</artifactId>
- <version>1.2.0</version>
+ <version>1.2.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@@ -65,13 +65,13 @@ limitations under the License.
</dependency>
<dependency>
<groupId>io.springfox</groupId>
- <artifactId>springfox-swagger2</artifactId>
- <version>2.10.5</version>
+ <artifactId>springfox-boot-starter</artifactId>
+ <version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
- <version>2.10.5</version>
+ <version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
diff --git a/mod/runtimeapi/runtime-web/src/main/java/org/onap/dcae/runtime/web/RuntimeapiApplication.java b/mod/runtimeapi/runtime-web/src/main/java/org/onap/dcae/runtime/web/RuntimeapiApplication.java
index 611b332..df79251 100644
--- a/mod/runtimeapi/runtime-web/src/main/java/org/onap/dcae/runtime/web/RuntimeapiApplication.java
+++ b/mod/runtimeapi/runtime-web/src/main/java/org/onap/dcae/runtime/web/RuntimeapiApplication.java
@@ -19,10 +19,8 @@ package org.onap.dcae.runtime.web;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
-import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
@SpringBootApplication
-@EnableSwagger2WebMvc
public class RuntimeapiApplication {
public static void main(String[] args) {
diff --git a/mod/runtimeapi/runtime-web/src/test/java/org/onap/dcae/runtime/web/controllers/TestFlowGraphController.java b/mod/runtimeapi/runtime-web/src/test/java/org/onap/dcae/runtime/web/controllers/TestFlowGraphController.java
index 60ff810..942d2fd 100644
--- a/mod/runtimeapi/runtime-web/src/test/java/org/onap/dcae/runtime/web/controllers/TestFlowGraphController.java
+++ b/mod/runtimeapi/runtime-web/src/test/java/org/onap/dcae/runtime/web/controllers/TestFlowGraphController.java
@@ -81,7 +81,7 @@ public class TestFlowGraphController {
@Test
public void testSwaggerUi() throws Exception {
- mockMvc.perform(get("/swagger-ui.html"))
+ mockMvc.perform(get("/swagger-ui/index.html"))
.andExpect(status().isOk());
}
diff --git a/releases/1.0.4-acumos-adapter-container.yaml b/releases/1.0.4-acumos-adapter-container.yaml
new file mode 100644
index 0000000..1b7678c
--- /dev/null
+++ b/releases/1.0.4-acumos-adapter-container.yaml
@@ -0,0 +1,9 @@
+distribution_type: 'container'
+container_release_tag: '1.0.4'
+project: 'dcaegen2-platform'
+log_dir: 'dcaegen2-platform-adapter-acumos-docker-merge-master/54'
+ref: 93da1351f5a8e870735f507a74147560c827b179
+containers:
+ - name: 'org.onap.dcaegen2.platform.adapter.acumos'
+ version: '1.0.4-SNAPSHOT-20210222T165053Z'
+git_tag: '1.0.4-adapter-acumos'
diff --git a/releases/1.2.1-runtimeapi-container.yaml b/releases/1.2.1-runtimeapi-container.yaml
new file mode 100644
index 0000000..c6e04fc
--- /dev/null
+++ b/releases/1.2.1-runtimeapi-container.yaml
@@ -0,0 +1,9 @@
+distribution_type: 'container'
+container_release_tag: '1.2.1'
+project: 'dcaegen2-platform'
+log_dir: 'dcaegen2-platform-mod-master-runtimeapi-merge-java/26'
+ref: 898cf07d59c3586180b43bc4b1289d5c20d019fd
+containers:
+ - name: 'org.onap.dcaegen2.platform.mod.runtime-web'
+ version: '1.2.1-SNAPSHOT-20210129T134650Z'
+git_tag: '1.2.1-mod-runtimeapi'
diff --git a/releases/1.2.2-runtimeapi-container.yaml b/releases/1.2.2-runtimeapi-container.yaml
new file mode 100644
index 0000000..587b1d2
--- /dev/null
+++ b/releases/1.2.2-runtimeapi-container.yaml
@@ -0,0 +1,9 @@
+distribution_type: 'container'
+container_release_tag: '1.2.2'
+project: 'dcaegen2-platform'
+log_dir: 'dcaegen2-platform-mod-master-runtimeapi-merge-java/27'
+ref: 9bb10e0147e582b6272b40473abbb44fc361d29f
+containers:
+ - name: 'org.onap.dcaegen2.platform.mod.runtime-web'
+ version: '1.2.2-SNAPSHOT-20210210T222108Z'
+git_tag: '1.2.2-mod-runtimeapi'
diff --git a/releases/1.2.3-runtimeapi-container.yaml b/releases/1.2.3-runtimeapi-container.yaml
new file mode 100644
index 0000000..9af2f10
--- /dev/null
+++ b/releases/1.2.3-runtimeapi-container.yaml
@@ -0,0 +1,9 @@
+distribution_type: 'container'
+container_release_tag: '1.2.3'
+project: 'dcaegen2-platform'
+log_dir: 'dcaegen2-platform-mod-master-runtimeapi-merge-java/28'
+ref: fede209351277913be6b8fca3f031d14964cfacc
+containers:
+ - name: 'org.onap.dcaegen2.platform.mod.runtime-web'
+ version: '1.2.3-SNAPSHOT-20210225T170632Z'
+git_tag: '1.2.3-mod-runtimeapi'
diff --git a/releases/1.7.2-blueprint-generator.yaml b/releases/1.7.2-blueprint-generator.yaml
new file mode 100644
index 0000000..7d979a9
--- /dev/null
+++ b/releases/1.7.2-blueprint-generator.yaml
@@ -0,0 +1,4 @@
+distribution_type: 'maven'
+version: '1.7.2'
+project: 'dcaegen2/platform'
+log_dir: 'dcaegen2-platform-mod-bpgenerator-maven-stage-master/362'
diff --git a/releases/1.7.3-blueprint-generator.yaml b/releases/1.7.3-blueprint-generator.yaml
new file mode 100644
index 0000000..4f0f441
--- /dev/null
+++ b/releases/1.7.3-blueprint-generator.yaml
@@ -0,0 +1,5 @@
+distribution_type: 'maven'
+version: '1.7.3'
+project: 'dcaegen2/platform'
+log_dir: 'dcaegen2-platform-mod-bpgenerator-maven-stage-master/388'
+git_tag: '1.7.3-bpgenerator'
diff --git a/releases/2.12.4-onboardingapi-container.yaml b/releases/2.12.4-onboardingapi-container.yaml
new file mode 100644
index 0000000..67e33d8
--- /dev/null
+++ b/releases/2.12.4-onboardingapi-container.yaml
@@ -0,0 +1,9 @@
+distribution_type: 'container'
+container_release_tag: '2.12.4'
+project: 'dcaegen2-platform'
+log_dir: 'dcaegen2-platform-mod-onboardingapi-docker-merge-master/53'
+ref: 59a85d1e280b011d05416ac3dbe6d823f60834f6
+containers:
+ - name: 'org.onap.dcaegen2.platform.mod.onboardingapi'
+ version: '2.12.4-SNAPSHOT-20210128T161153Z'
+git_tag: '2.12.4-mod-onboardingapi'
diff --git a/releases/2.12.5-onboardingapi-container.yaml b/releases/2.12.5-onboardingapi-container.yaml
new file mode 100644
index 0000000..a485636
--- /dev/null
+++ b/releases/2.12.5-onboardingapi-container.yaml
@@ -0,0 +1,9 @@
+distribution_type: 'container'
+container_release_tag: '2.12.5'
+project: 'dcaegen2-platform'
+log_dir: 'dcaegen2-platform-mod-onboardingapi-docker-merge-master/57'
+ref: ed1d04cf7ac4371ead557a0d564f948174ca5597
+containers:
+ - name: 'org.onap.dcaegen2.platform.mod.onboardingapi'
+ version: '2.12.5-SNAPSHOT-20210216T095425Z'
+git_tag: '2.12.5-mod-onboardingapi'