diff options
author | 2020-01-30 11:23:57 -0500 | |
---|---|---|
committer | 2020-01-30 16:38:18 +0000 | |
commit | 032ce4ec7c3d7ac138555dfe980ca53ebbf39f01 (patch) | |
tree | 97ead4fa03fbc4e31900fcc39adf5c1fd4594d39 /blueprints-processor/plugin/assignment-provider/src/test | |
parent | 4903545aae48b6b8169b8716ba5bce7f0cd8d7ba (diff) |
Removing blueprints-processor
Blueprints-Processor is deprecated, use CCSDK/CDS instead
Change-Id: I0abc96061c3c5edc6c5d02bcd6f35e18e31882a7
Issue-ID: CCSDK-2051
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Diffstat (limited to 'blueprints-processor/plugin/assignment-provider/src/test')
56 files changed, 0 insertions, 4891 deletions
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/processor/DBResourceProcessorTest.java b/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/processor/DBResourceProcessorTest.java deleted file mode 100644 index a93e6de2e..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/processor/DBResourceProcessorTest.java +++ /dev/null @@ -1,231 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.assignment.processor;
-
-import static org.mockito.Matchers.any;
-import java.io.File;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.commons.io.FileUtils;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Matchers;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.mockito.stubbing.Answer;
-import org.onap.ccsdk.features.assignment.service.ConfigResourceAssignmentTestUtils;
-import org.onap.ccsdk.features.data.adaptor.domain.TransactionLog;
-import org.onap.ccsdk.features.data.adaptor.service.ConfigResourceService;
-import org.onap.ccsdk.features.model.ConfigModelConstant;
-import org.onap.ccsdk.features.model.data.ResourceAssignment;
-import org.onap.ccsdk.features.model.data.dict.ResourceDefinition;
-import org.onap.ccsdk.features.model.utils.TransformationUtils;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-@RunWith(MockitoJUnitRunner.class)
-public class DBResourceProcessorTest {
-
- private static EELFLogger logger = EELFManager.getInstance().getLogger(DBResourceProcessorTest.class);
-
- @Mock
- private ConfigResourceService configResourceService;
-
- @SuppressWarnings("unchecked")
- @Before
- public void before() {
- MockitoAnnotations.initMocks(this);
-
- try {
- Mockito.doAnswer(new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- if (args != null) {
- logger.trace("Transaction info " + Arrays.asList(args));
- }
- return null;
- }
- }).when(configResourceService).save(any(TransactionLog.class));
-
- } catch (SvcLogicException e) {
- e.printStackTrace();
- }
- }
-
- @Test
- public void testDbSimpleProcess() throws Exception {
- logger.info(" ******************************* testDbSimpleProcess ***************************");
-
- Mockito.doAnswer(new Answer<List<Map<String, Object>>>() {
- @Override
- public List<Map<String, Object>> answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- List<Map<String, Object>> results = new ArrayList<>();
- if (args != null) {
- logger.info("Query " + Arrays.asList(args));
- Map<String, Object> record = new HashMap<>();
- record.put("country", "US");
- results.add(record);
- }
- return results;
- }
- }).when(configResourceService).query(Matchers.anyString(), Matchers.<Map<String, Object>>any());
-
- String recipeName = "sample-recipe";
-
- String resourceassignmentContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/db/resource-assignments-simple.json"), Charset.defaultCharset());
- List<ResourceAssignment> batchResourceAssignment =
- TransformationUtils.getListfromJson(resourceassignmentContent, ResourceAssignment.class);
-
- String dictionaryContent = FileUtils.readFileToString(new File("src/test/resources/mapping/db/db-simple.json"),
- Charset.defaultCharset());
- Map<String, ResourceDefinition> dictionaries =
- ConfigResourceAssignmentTestUtils.getMapfromJson(dictionaryContent);
- DBResourceProcessor dbResourceProcessor = new DBResourceProcessor(configResourceService);
- Map<String, Object> componentContext = new HashMap<>();
- componentContext.put(ConfigModelConstant.PROPERTY_RESOURCE_ASSIGNMENTS, batchResourceAssignment);
- componentContext.put(ConfigModelConstant.PROPERTY_ACTION_NAME, recipeName);
- componentContext.put(ConfigModelConstant.PROPERTY_TEMPLATE_NAME, "sample-template");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARIES, dictionaries);
-
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".profile_name", "sample");
-
- Map<String, String> inParams = new HashMap<>();
- SvcLogicContext ctx = new SvcLogicContext();
- dbResourceProcessor.process(inParams, ctx, componentContext);
-
- logger.info(" Context " + componentContext);
-
- }
-
- @Test
- public void testDbComplexProcess() throws Exception {
- logger.info(" ******************************* testDbComplexProcess ***************************");
-
- Mockito.doAnswer(new Answer<List<Map<String, Object>>>() {
- @Override
- public List<Map<String, Object>> answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- List<Map<String, Object>> results = new ArrayList<>();
- if (args != null) {
- logger.info("Query " + Arrays.asList(args));
- Map<String, Object> record = new HashMap<>();
- record.put("db-country", "US");
- record.put("db-state", "NJ");
- results.add(record);
- }
- return results;
- }
- }).when(configResourceService).query(Matchers.anyString(), Matchers.<Map<String, Object>>any());
-
- String recipeName = "sample-recipe";
-
- String resourceassignmentContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/db/resource-assignments-complex.json"), Charset.defaultCharset());
- List<ResourceAssignment> batchResourceAssignment =
- TransformationUtils.getListfromJson(resourceassignmentContent, ResourceAssignment.class);
-
- String dictionaryContent = FileUtils.readFileToString(new File("src/test/resources/mapping/db/db-complex.json"),
- Charset.defaultCharset());
- Map<String, ResourceDefinition> dictionaries =
- ConfigResourceAssignmentTestUtils.getMapfromJson(dictionaryContent);
- DBResourceProcessor dbResourceProcessor = new DBResourceProcessor(configResourceService);
- Map<String, Object> componentContext = new HashMap<>();
- componentContext.put(ConfigModelConstant.PROPERTY_RESOURCE_ASSIGNMENTS, batchResourceAssignment);
- componentContext.put(ConfigModelConstant.PROPERTY_ACTION_NAME, recipeName);
- componentContext.put(ConfigModelConstant.PROPERTY_TEMPLATE_NAME, "sample-template");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARIES, dictionaries);
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".profile_name", "sample");
-
- Map<String, String> inParams = new HashMap<>();
- SvcLogicContext ctx = new SvcLogicContext();
- String datatypeContent = FileUtils.readFileToString(new File("src/test/resources/mapping/db/dt-location.json"),
- Charset.defaultCharset());
- ctx.setAttribute("data_types.dt-location", datatypeContent);
- dbResourceProcessor.process(inParams, ctx, componentContext);
-
- }
-
- @Test
- public void testDbArrayComplexProcess() throws Exception {
- logger.info(" ******************************* testDbArrayComplexProcess ***************************");
- Mockito.doAnswer(new Answer<List<Map<String, Object>>>() {
- @Override
- public List<Map<String, Object>> answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- List<Map<String, Object>> results = new ArrayList<>();
- if (args != null) {
- logger.info("Query " + Arrays.asList(args));
- Map<String, Object> record = new HashMap<>();
- record.put("db-country", "US");
- record.put("db-state", "NJ");
- results.add(record);
-
- Map<String, Object> record2 = new HashMap<>();
- record2.put("db-country", "INDIA");
- record2.put("db-state", "TN");
- results.add(record2);
- }
- return results;
- }
- }).when(configResourceService).query(Matchers.anyString(), Matchers.<Map<String, Object>>any());
-
- String recipeName = "sample-recipe";
-
- String resourceassignmentContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/db/resource-assignments-array.json"), Charset.defaultCharset());
- List<ResourceAssignment> batchResourceAssignment =
- TransformationUtils.getListfromJson(resourceassignmentContent, ResourceAssignment.class);
-
- String dictionaryContent = FileUtils.readFileToString(new File("src/test/resources/mapping/db/db-array.json"),
- Charset.defaultCharset());
- Map<String, ResourceDefinition> dictionaries =
- ConfigResourceAssignmentTestUtils.getMapfromJson(dictionaryContent);
- DBResourceProcessor dbResourceProcessor = new DBResourceProcessor(configResourceService);
- Map<String, Object> componentContext = new HashMap<>();
- componentContext.put(ConfigModelConstant.PROPERTY_RESOURCE_ASSIGNMENTS, batchResourceAssignment);
- componentContext.put(ConfigModelConstant.PROPERTY_ACTION_NAME, recipeName);
- componentContext.put(ConfigModelConstant.PROPERTY_TEMPLATE_NAME, "sample-template");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARIES, dictionaries);
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".profile_name", "sample");
-
- Map<String, String> inParams = new HashMap<>();
- SvcLogicContext ctx = new SvcLogicContext();
- String datatypeContent = FileUtils.readFileToString(new File("src/test/resources/mapping/db/dt-location.json"),
- Charset.defaultCharset());
- ctx.setAttribute("data_types.dt-location", datatypeContent);
- dbResourceProcessor.process(inParams, ctx, componentContext);
- logger.info("Component Context = ({})", componentContext);
- Assert.assertNotNull("faile dto populate Array Complex response ", componentContext);
-
- }
-
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/processor/DefaultResourceProcessorTest.java b/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/processor/DefaultResourceProcessorTest.java deleted file mode 100644 index 16fd6c0bd..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/processor/DefaultResourceProcessorTest.java +++ /dev/null @@ -1,127 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.assignment.processor;
-
-import static org.mockito.Matchers.any;
-import java.io.File;
-import java.nio.charset.Charset;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.commons.io.FileUtils;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.mockito.stubbing.Answer;
-import org.onap.ccsdk.features.assignment.service.ConfigResourceAssignmentTestUtils;
-import org.onap.ccsdk.features.data.adaptor.domain.TransactionLog;
-import org.onap.ccsdk.features.data.adaptor.service.ConfigResourceService;
-import org.onap.ccsdk.features.model.ConfigModelConstant;
-import org.onap.ccsdk.features.model.data.ResourceAssignment;
-import org.onap.ccsdk.features.model.data.dict.ResourceDefinition;
-import org.onap.ccsdk.features.model.utils.TransformationUtils;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-@RunWith(MockitoJUnitRunner.class)
-public class DefaultResourceProcessorTest {
-
- private static EELFLogger logger = EELFManager.getInstance().getLogger(DefaultResourceProcessorTest.class);
-
- @Mock
- private ConfigResourceService configResourceService;
-
- @SuppressWarnings("unchecked")
- @Before
- public void before() {
- MockitoAnnotations.initMocks(this);
-
- try {
- Mockito.doAnswer(new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- if (args != null) {
- logger.trace("Transaction info " + Arrays.asList(args));
- }
- return null;
- }
- }).when(configResourceService).save(any(TransactionLog.class));
-
- } catch (SvcLogicException e) {
- e.printStackTrace();
- }
- }
-
- @Test
- public void testDefaultSimpleProcess() throws Exception {
- logger.info(" ******************************* testDefaultSimpleProcess ***************************");
-
- String recipeName = "sample-recipe";
-
- String resourceassignmentContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/default/resource-assignments-simple.json"),
- Charset.defaultCharset());
- List<ResourceAssignment> batchResourceAssignment =
- TransformationUtils.getListfromJson(resourceassignmentContent, ResourceAssignment.class);
-
- String dictionaryContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/default/default-simple.json"), Charset.defaultCharset());
- Map<String, ResourceDefinition> dictionaries =
- ConfigResourceAssignmentTestUtils.getMapfromJson(dictionaryContent);
-
- DefaultResourceProcessor defaultResourceProcessor = new DefaultResourceProcessor(configResourceService);
- Map<String, Object> componentContext = new HashMap<>();
- componentContext.put(ConfigModelConstant.PROPERTY_RESOURCE_ASSIGNMENTS, batchResourceAssignment);
- componentContext.put(ConfigModelConstant.PROPERTY_ACTION_NAME, recipeName);
- componentContext.put(ConfigModelConstant.PROPERTY_TEMPLATE_NAME, "sample-template");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARIES, dictionaries);
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".profile_name", "sample");
-
- Map<String, String> inParams = new HashMap<>();
- SvcLogicContext ctx = new SvcLogicContext();
- defaultResourceProcessor.process(inParams, ctx, componentContext);
- logger.trace(" componentContext " + componentContext);
-
- Assert.assertEquals("Failed to populate default country value ", "US",
- componentContext.get(ConfigModelConstant.PROPERTY_RECIPE_KEY_DOT + "sample-recipe.country"));
- Assert.assertEquals("Failed to populate default country value ", "US",
- componentContext.get(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + "sample-recipe.country"));
-
- Assert.assertEquals("Failed to populate default port value ", 830,
- componentContext.get(ConfigModelConstant.PROPERTY_RECIPE_KEY_DOT + "sample-recipe.port"));
- Assert.assertEquals("Failed to populate default port value ", 830,
- componentContext.get(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + "sample-recipe.port"));
-
- Assert.assertEquals("Failed to populate default voip-enabled value ", true,
- componentContext.get(ConfigModelConstant.PROPERTY_RECIPE_KEY_DOT + "sample-recipe.voip-enabled"));
- Assert.assertEquals("Failed to populate default voip-enabled value ", true,
- componentContext.get(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + "sample-recipe.voip-enabled"));
-
- }
-
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/processor/InputResourceProcessorTest.java b/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/processor/InputResourceProcessorTest.java deleted file mode 100644 index add00d3a9..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/processor/InputResourceProcessorTest.java +++ /dev/null @@ -1,178 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.assignment.processor;
-
-import static org.mockito.Matchers.any;
-import java.io.File;
-import java.nio.charset.Charset;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.commons.io.FileUtils;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.mockito.stubbing.Answer;
-import org.onap.ccsdk.features.assignment.service.ConfigResourceAssignmentTestUtils;
-import org.onap.ccsdk.features.data.adaptor.domain.TransactionLog;
-import org.onap.ccsdk.features.data.adaptor.service.ConfigResourceService;
-import org.onap.ccsdk.features.model.ConfigModelConstant;
-import org.onap.ccsdk.features.model.data.ResourceAssignment;
-import org.onap.ccsdk.features.model.data.dict.ResourceDefinition;
-import org.onap.ccsdk.features.model.utils.TransformationUtils;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.onap.ccsdk.sli.core.sli.SvcLogicException;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-@RunWith(MockitoJUnitRunner.class)
-public class InputResourceProcessorTest {
-
- private static EELFLogger logger = EELFManager.getInstance().getLogger(InputResourceProcessorTest.class);
-
- @Mock
- private ConfigResourceService configResourceService;
-
- @SuppressWarnings("unchecked")
- @Before
- public void before() {
- MockitoAnnotations.initMocks(this);
-
- try {
- Mockito.doAnswer(new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- if (args != null) {
- logger.trace("Transaction info " + Arrays.asList(args));
- }
- return null;
- }
- }).when(configResourceService).save(any(TransactionLog.class));
-
- } catch (SvcLogicException e) {
- e.printStackTrace();
- }
- }
-
- @Test
- public void testInputSimpleProcess() throws Exception {
- logger.info(" ******************************* testInputSimpleProcess ***************************");
-
- String recipeName = "sample-recipe";
-
- String resourceassignmentContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/input/resource-assignments-simple.json"),
- Charset.defaultCharset());
- List<ResourceAssignment> batchResourceAssignment =
- TransformationUtils.getListfromJson(resourceassignmentContent, ResourceAssignment.class);
-
- String dictionaryContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/default/default-simple.json"), Charset.defaultCharset());
- Map<String, ResourceDefinition> dictionaries =
- ConfigResourceAssignmentTestUtils.getMapfromJson(dictionaryContent);
-
- InputResourceProcessor inputResourceProcessor = new InputResourceProcessor(configResourceService);
- Map<String, Object> componentContext = new HashMap<>();
- componentContext.put(ConfigModelConstant.PROPERTY_RESOURCE_ASSIGNMENTS, batchResourceAssignment);
- componentContext.put(ConfigModelConstant.PROPERTY_ACTION_NAME, recipeName);
- componentContext.put(ConfigModelConstant.PROPERTY_TEMPLATE_NAME, "sample-template");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARIES, dictionaries);
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".profile_name", "sample");
-
- Map<String, String> inParams = new HashMap<>();
- SvcLogicContext ctx = new SvcLogicContext();
- ctx.setAttribute("country", "US");
- ctx.setAttribute("port", "830");
- ctx.setAttribute("voip-enabled", "true");
-
- inputResourceProcessor.process(inParams, ctx, componentContext);
- logger.trace(" componentContext " + componentContext);
-
- Assert.assertEquals("Failed to populate default recipe country value ", "US",
- componentContext.get(ConfigModelConstant.PROPERTY_RECIPE_KEY_DOT + "sample-recipe.country"));
- Assert.assertEquals("Failed to populate default dictionary country value ", "US",
- componentContext.get(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + "sample-recipe.country"));
-
- Assert.assertEquals("Failed to populate default recipe port value ", 830,
- componentContext.get(ConfigModelConstant.PROPERTY_RECIPE_KEY_DOT + "sample-recipe.port"));
- Assert.assertEquals("Failed to populate default dictionary port value ", 830,
- componentContext.get(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + "sample-recipe.port"));
-
- Assert.assertEquals("Failed to populate default recipe voip-enabled value ", true,
- componentContext.get(ConfigModelConstant.PROPERTY_RECIPE_KEY_DOT + "sample-recipe.voip-enabled"));
- Assert.assertEquals("Failed to populate default dictionary voip-enabled value ", true,
- componentContext.get(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + "sample-recipe.voip-enabled"));
-
- }
-
- @Test
- public void testInputComplexProcess() throws Exception {
- logger.info(" ******************************* testInputComplexProcess ***************************");
-
- String recipeName = "sample-recipe";
-
- String resourceassignmentContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/input/resource-assignments-complex.json"),
- Charset.defaultCharset());
- List<ResourceAssignment> batchResourceAssignment =
- TransformationUtils.getListfromJson(resourceassignmentContent, ResourceAssignment.class);
-
- String dictionaryContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/input/input-complex.json"), Charset.defaultCharset());
- Map<String, ResourceDefinition> dictionaries =
- ConfigResourceAssignmentTestUtils.getMapfromJson(dictionaryContent);
-
- InputResourceProcessor inputResourceProcessor = new InputResourceProcessor(configResourceService);
- Map<String, Object> componentContext = new HashMap<>();
- componentContext.put(ConfigModelConstant.PROPERTY_RESOURCE_ASSIGNMENTS, batchResourceAssignment);
- componentContext.put(ConfigModelConstant.PROPERTY_ACTION_NAME, recipeName);
- componentContext.put(ConfigModelConstant.PROPERTY_TEMPLATE_NAME, "sample-template");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARIES, dictionaries);
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".profile_name", "sample");
-
- Map<String, String> inParams = new HashMap<>();
- SvcLogicContext ctx = new SvcLogicContext();
- String datatypeContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/input/dt-location.json"), Charset.defaultCharset());
- ctx.setAttribute("data_types.dt-location", datatypeContent);
-
- String samplelocation = FileUtils.readFileToString(
- new File("src/test/resources/mapping/input/sample-location.json"), Charset.defaultCharset());
- ctx.setAttribute("location", samplelocation);
-
- inputResourceProcessor.process(inParams, ctx, componentContext);
-
- logger.trace(" componentContext " + componentContext);
- logger.trace(" Resource Mapping " + TransformationUtils.getJson(batchResourceAssignment, true));
-
- Assert.assertNotNull("Failed to populate input recipe location value ",
- componentContext.get(ConfigModelConstant.PROPERTY_RECIPE_KEY_DOT + "sample-recipe.location"));
- Assert.assertNotNull("Failed to populate input dictionary location value ",
- componentContext.get(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + "sample-recipe.location"));
-
- }
-
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/processor/MdsalResourceProcessorTest.java b/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/processor/MdsalResourceProcessorTest.java deleted file mode 100644 index 10a43538c..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/processor/MdsalResourceProcessorTest.java +++ /dev/null @@ -1,268 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.assignment.processor;
-
-import java.io.File;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.commons.io.FileUtils;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Matchers;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.mockito.stubbing.Answer;
-import org.onap.ccsdk.features.assignment.service.ConfigResourceAssignmentTestUtils;
-import org.onap.ccsdk.features.model.ConfigModelConstant;
-import org.onap.ccsdk.features.model.data.ResourceAssignment;
-import org.onap.ccsdk.features.model.data.dict.ResourceDefinition;
-import org.onap.ccsdk.features.model.utils.TransformationUtils;
-import org.onap.ccsdk.features.rest.adaptor.service.ConfigRestAdaptorService;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-@RunWith(MockitoJUnitRunner.class)
-public class MdsalResourceProcessorTest {
-
- private static EELFLogger logger = EELFManager.getInstance().getLogger(MdsalResourceProcessorTest.class);
-
- @Mock
- private ConfigRestAdaptorService configRestAdaptorService;
-
- @SuppressWarnings("unchecked")
- @Before
- public void before() {
-
- }
-
- @Test
- @SuppressWarnings("unchecked")
- public void testMdsalSimpleProcess() throws Exception {
- logger.info(" ******************************* testMdsalSimpleProcess ***************************");
-
- Mockito.doAnswer(new Answer<String>() {
- @Override
- public String answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- String response = null;
- if (args != null) {
- response = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/simple-response.json"),
- Charset.defaultCharset());
- logger.info(" Returning response :" + response);
- }
- return response;
- }
- }).when(configRestAdaptorService).getResource(Matchers.anyString(), Matchers.anyString(),
- Matchers.any(Class.class));
-
- String recipeName = "sample-recipe";
-
- String resourceassignmentContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/resource-assignments-simple.json"),
- Charset.defaultCharset());
- List<ResourceAssignment> batchResourceAssignment =
- TransformationUtils.getListfromJson(resourceassignmentContent, ResourceAssignment.class);
-
- String dictionaryContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/mdsal-simple.json"), Charset.defaultCharset());
- Map<String, ResourceDefinition> dictionaries =
- ConfigResourceAssignmentTestUtils.getMapfromJson(dictionaryContent);
- MdsalResourceProcessor mdsalResourceProcessor = new MdsalResourceProcessor(configRestAdaptorService);
- Map<String, Object> componentContext = new HashMap<>();
- componentContext.put(ConfigModelConstant.PROPERTY_RESOURCE_ASSIGNMENTS, batchResourceAssignment);
- componentContext.put(ConfigModelConstant.PROPERTY_ACTION_NAME, recipeName);
- componentContext.put(ConfigModelConstant.PROPERTY_TEMPLATE_NAME, "sample-template");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARIES, dictionaries);
-
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".profile_name", "sample");
-
- Map<String, String> inParams = new HashMap<>();
- SvcLogicContext ctx = new SvcLogicContext();
- mdsalResourceProcessor.process(inParams, ctx, componentContext);
-
- }
-
- @SuppressWarnings("unchecked")
- @Test
- public void testMDSALComplexProcess() throws Exception {
- logger.info(" ******************************* testMDSALComplexProcess ***************************");
-
- Mockito.doAnswer(new Answer<String>() {
- @Override
- public String answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- String response = null;
- if (args != null) {
- response = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/complex-response.json"),
- Charset.defaultCharset());
- }
- return response;
- }
- }).when(configRestAdaptorService).getResource(Matchers.anyString(), Matchers.anyString(),
- Matchers.any(Class.class));
-
- String recipeName = "sample-recipe";
-
- String resourceassignmentContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/resource-assignments-complex.json"),
- Charset.defaultCharset());
- List<ResourceAssignment> batchResourceAssignment =
- TransformationUtils.getListfromJson(resourceassignmentContent, ResourceAssignment.class);
-
- String dictionaryContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/mdsal-complex.json"), Charset.defaultCharset());
- Map<String, ResourceDefinition> dictionaries =
- ConfigResourceAssignmentTestUtils.getMapfromJson(dictionaryContent);
- MdsalResourceProcessor dbResourceProcessor = new MdsalResourceProcessor(configRestAdaptorService);
- Map<String, Object> componentContext = new HashMap<>();
- componentContext.put(ConfigModelConstant.PROPERTY_RESOURCE_ASSIGNMENTS, batchResourceAssignment);
- componentContext.put(ConfigModelConstant.PROPERTY_ACTION_NAME, recipeName);
- componentContext.put(ConfigModelConstant.PROPERTY_TEMPLATE_NAME, "sample-template");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARIES, dictionaries);
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".profile_name", "sample");
-
- Map<String, String> inParams = new HashMap<>();
- SvcLogicContext ctx = new SvcLogicContext();
- String datatypeContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/dt-location.json"), Charset.defaultCharset());
- ctx.setAttribute("data_types.dt-location", datatypeContent);
- dbResourceProcessor.process(inParams, ctx, componentContext);
-
- }
-
- @Test
- @SuppressWarnings("unchecked")
- public void testMDSALArrayComplexProcess() throws Exception {
- logger.info(" ******************************* testMDSALArrayComplexProcess ***************************");
-
- Mockito.doAnswer(new Answer<String>() {
- @Override
- public String answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- String response = null;
- if (args != null) {
- response = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/array-complex-response.json"),
- Charset.defaultCharset());
- }
- return response;
- }
- }).when(configRestAdaptorService).getResource(Matchers.anyString(), Matchers.anyString(),
- Matchers.any(Class.class));
-
- String recipeName = "sample-recipe";
-
- String resourceassignmentContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/resource-assignments-array.json"), Charset.defaultCharset());
- List<ResourceAssignment> batchResourceAssignment =
- TransformationUtils.getListfromJson(resourceassignmentContent, ResourceAssignment.class);
-
- String dictionaryContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/mdsal-array.json"), Charset.defaultCharset());
-
- Map<String, ResourceDefinition> dictionaries =
- ConfigResourceAssignmentTestUtils.getMapfromJson(dictionaryContent);
- MdsalResourceProcessor dbResourceProcessor = new MdsalResourceProcessor(configRestAdaptorService);
- Map<String, Object> componentContext = new HashMap<>();
- componentContext.put(ConfigModelConstant.PROPERTY_RESOURCE_ASSIGNMENTS, batchResourceAssignment);
- componentContext.put(ConfigModelConstant.PROPERTY_ACTION_NAME, recipeName);
- componentContext.put(ConfigModelConstant.PROPERTY_TEMPLATE_NAME, "sample-template");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARIES, dictionaries);
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".profile_name", "sample");
-
- Map<String, String> inParams = new HashMap<>();
- SvcLogicContext ctx = new SvcLogicContext();
- String datatypeContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/dt-location.json"), Charset.defaultCharset());
- ctx.setAttribute("data_types.dt-location", datatypeContent);
- dbResourceProcessor.process(inParams, ctx, componentContext);
- logger.info("Component Context = ({})", componentContext);
- Assert.assertNotNull("failed to populate Array Complex response ", componentContext);
-
- }
-
- @Test
- @SuppressWarnings("unchecked")
- public void testMDSALArraySimpleProcess() throws Exception {
- logger.info(" ******************************* testMDSALArrayComplexProcess ***************************");
-
- Mockito.doAnswer(new Answer<String>() {
- @Override
- public String answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- String response = null;
- if (args != null) {
- response = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/array-complex-v4-assigned-response.json"),
- Charset.defaultCharset());
- }
- return response;
- }
- }).when(configRestAdaptorService).getResource(Matchers.anyString(), Matchers.anyString(),
- Matchers.any(Class.class));
-
- String recipeName = "sample-recipe";
-
- String resourceassignmentContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/resource-assignments-complex-simple.json"),
- Charset.defaultCharset());
- List<ResourceAssignment> batchResourceAssignment =
- TransformationUtils.getListfromJson(resourceassignmentContent, ResourceAssignment.class);
-
- String dictionaryContent = FileUtils.readFileToString(
- new File("src/test/resources/mapping/Mdsal/mdsal-array-v4iplist.json"), Charset.defaultCharset());
- Map<String, ResourceDefinition> dictionaries =
- ConfigResourceAssignmentTestUtils.getMapfromJson(dictionaryContent);
- MdsalResourceProcessor mdsalResourceProcessor = new MdsalResourceProcessor(configRestAdaptorService);
- Map<String, Object> componentContext = new HashMap<>();
- componentContext.put(ConfigModelConstant.PROPERTY_RESOURCE_ASSIGNMENTS, batchResourceAssignment);
- componentContext.put(ConfigModelConstant.PROPERTY_ACTION_NAME, recipeName);
- componentContext.put(ConfigModelConstant.PROPERTY_TEMPLATE_NAME, "sample-template");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARIES, dictionaries);
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".service-instance-id",
- "3c8d5a63-a793-4206-a67c-4b2e8e648196");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".oam-network-role",
- "sample");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".oam-ipv4-ip-type",
- "sample");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".profile_name", "sample");
- componentContext.put(ConfigModelConstant.PROPERTY_DICTIONARY_KEY_DOT + recipeName + ".oam-vm-type", "sample");
-
- Map<String, String> inParams = new HashMap<>();
- SvcLogicContext ctx = new SvcLogicContext();
- // String datatypeContent = FileUtils.readFileToString(new
- // File("src/test/resources/mapping/Mdsal/dt-v4-assigned-ip-list.json"), Charset.defaultCharset() );
- // ctx.setAttribute("data_types.dt-v4-assigned-ip-list", datatypeContent);
- mdsalResourceProcessor.process(inParams, ctx, componentContext);
- logger.info("Component Context = ({})", componentContext);
- Assert.assertNotNull("failed to populate Array Complex response ", componentContext);
- Assert.assertEquals("Compare String ", "10.66.1.152",
- componentContext.get(ConfigModelConstant.PROPERTY_RECIPE_KEY_DOT + recipeName + ".v4-ip-prefix"));
-
- }
-
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ConfigAssignmentNodeTest.java b/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ConfigAssignmentNodeTest.java deleted file mode 100644 index 0fe6c9261..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ConfigAssignmentNodeTest.java +++ /dev/null @@ -1,246 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.assignment.service;
-
-import java.io.File;
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.sling.testing.mock.osgi.MockOsgi;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.onap.ccsdk.features.assignment.ConfigAssignmentConstants;
-import org.onap.ccsdk.features.data.adaptor.service.ConfigResourceService;
-import org.onap.ccsdk.features.generator.service.ConfigGeneratorService;
-import org.onap.ccsdk.features.generator.service.ConfigGeneratorServiceImpl;
-import org.onap.ccsdk.features.model.ConfigModelConstant;
-import org.onap.ccsdk.features.model.service.ComponentNodeDelegate;
-import org.onap.ccsdk.features.model.service.ComponentNodeService;
-import org.onap.ccsdk.features.model.service.ComponentNodeServiceImpl;
-import org.onap.ccsdk.features.model.service.ConfigModelService;
-import org.onap.ccsdk.features.model.service.ConfigModelServiceImpl;
-import org.onap.ccsdk.features.rest.adaptor.service.ConfigRestAdaptorService;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import org.osgi.framework.BundleContext;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-@RunWith(MockitoJUnitRunner.class)
-public class ConfigAssignmentNodeTest {
-
- private static EELFLogger logger = EELFManager.getInstance().getLogger(ConfigAssignmentNodeTest.class);
-
- @Rule
- public ExpectedException thrown = ExpectedException.none();
-
- @Mock
- private ConfigResourceService configResourceService;
-
- @Mock
- private ConfigRestAdaptorService configRestAdaptorService;
-
- private ConfigModelService configModelService;
-
- private ComponentNodeService componentNodeService;
-
- private ConfigGeneratorService configGeneratorService;
-
- BundleContext bundleContext = MockOsgi.newBundleContext();
-
- @SuppressWarnings("unchecked")
- @Before
- public void before() throws Exception {
- MockitoAnnotations.initMocks(this);
- /*
- * ConfigAssignmentNode configAssignmentNode = new ConfigAssignmentNode(componentNodeService,
- * configResourceService, configModelService, configRestAdaptorService, configGeneratorService);
- * bundleContext.registerService(ConfigAssignmentNode.class, configAssignmentNode, null);
- */
- }
-
- @Test
- public void testResourceAssignment() throws Exception {
- ConfigResourceAssignmentTestUtils.injectTransactionLogSaveMock(configResourceService);
-
- ConfigResourceAssignmentTestUtils.injectConfigModelMock(configRestAdaptorService, "resource_assignment");
-
- ConfigResourceAssignmentTestUtils.injectResourceDictionaryMock(configRestAdaptorService,
- "assignments/empty-dictionary.json");
-
- ConfigResourceAssignmentTestUtils.injectConfigResourceSaveMock(configResourceService);
-
- componentNodeService =
- new ComponentNodeServiceImpl(bundleContext, configResourceService, configRestAdaptorService);
- configModelService = new ConfigModelServiceImpl(configRestAdaptorService);
- configGeneratorService = new ConfigGeneratorServiceImpl(configResourceService);
-
- ConfigAssignmentNode configAssignmentNode = new ConfigAssignmentNode(configResourceService,
- configRestAdaptorService, configModelService, componentNodeService, configGeneratorService);
-
- String inputContent = FileUtils.readFileToString(
- new File("src/test/resources/service_templates/input/input.json"), Charset.defaultCharset());
-
- Map<String, String> inParams = new HashMap<>();
- inParams.put(ConfigModelConstant.PROPERTY_SELECTOR, "test");
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_REQUEST_ID, "1234");
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_RESOURCE_ID, "resourceid-1234");
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_RESOURCE_TYPE, "vnf-type");
- inParams.put(ConfigModelConstant.SERVICE_TEMPLATE_KEY_ARTIFACT_NAME, "vpe-201802-baseconfig");
- inParams.put(ConfigModelConstant.SERVICE_TEMPLATE_KEY_ARTIFACT_VERSION, "1.0.0");
- inParams.put(ConfigModelConstant.PROPERTY_ACTION_NAME, "resource-assignment-action");
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_INPUT_DATA, inputContent);
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_TEMPLATE_NAMES, "[\"base-config-template\"]");
-
- // Populate the SvcContext ( Simulation)
- SvcLogicContext svcLogicContext = new SvcLogicContext();
- Map<String, String> context = new HashMap<>();
- context.put(ConfigModelConstant.PROPERTY_ACTION_NAME, "resource-assignment-action");
- context = configModelService.prepareContext(context, inputContent, "vpe-201802-baseconfig", "1.0.0");
- context.forEach((key, value) -> svcLogicContext.setAttribute(key, value));
-
- Map<String, Object> componentContext = new HashMap<>();
- configAssignmentNode.process(inParams, svcLogicContext, componentContext);
- Assert.assertNotNull("Failed to get response status", svcLogicContext.getAttribute("test.status"));
-
- }
-
- @Test
- public void testSimplePreview() throws Exception {
- ConfigResourceAssignmentTestUtils.injectTransactionLogSaveMock(configResourceService);
-
- ConfigResourceAssignmentTestUtils.injectConfigModelMock(configRestAdaptorService, "resource_assignment");
-
- ConfigResourceAssignmentTestUtils.injectResourceDictionaryMock(configRestAdaptorService,
- "assignments/empty-dictionary.json");
-
- ConfigResourceAssignmentTestUtils.injectConfigResourceSaveMock(configResourceService);
-
- componentNodeService =
- new ComponentNodeServiceImpl(bundleContext, configResourceService, configRestAdaptorService);
- configModelService = new ConfigModelServiceImpl(configRestAdaptorService);
- configGeneratorService = new ConfigGeneratorServiceImpl(configResourceService);
-
- ConfigAssignmentNode configAssignmentNode = new ConfigAssignmentNode(configResourceService,
- configRestAdaptorService, configModelService, componentNodeService, configGeneratorService);
-
- String inputContent = FileUtils.readFileToString(
- new File("src/test/resources/service_templates/input/input.json"), Charset.defaultCharset());
-
- Map<String, String> inParams = new HashMap<>();
- inParams.put(ConfigModelConstant.PROPERTY_SELECTOR, "test");
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_REQUEST_ID, "1234");
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_RESOURCE_ID, "resourceid-1234");
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_RESOURCE_TYPE, "vnf-type");
- inParams.put(ConfigModelConstant.SERVICE_TEMPLATE_KEY_ARTIFACT_NAME, "vpe-201802-baseconfig");
- inParams.put(ConfigModelConstant.SERVICE_TEMPLATE_KEY_ARTIFACT_VERSION, "1.0.0");
- inParams.put(ConfigModelConstant.PROPERTY_ACTION_NAME, "resource-assignment-action");
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_INPUT_DATA, inputContent);
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_TEMPLATE_NAMES, "[\"base-config-template\"]");
- SvcLogicContext ctx = new SvcLogicContext();
- configAssignmentNode.process(inParams, ctx);
- Assert.assertNotNull("Failed to get response mashed Content",
- ctx.getAttribute("test.mashed-data.base-config-template"));
- }
-
- @Test
- public void testComplexPreview() throws Exception {
- ConfigResourceAssignmentTestUtils.injectTransactionLogSaveMock(configResourceService);
-
- ConfigResourceAssignmentTestUtils.injectConfigModelMock(configRestAdaptorService, "vpe-201802-baseconfig");
-
- ConfigResourceAssignmentTestUtils.injectResourceDictionaryMock(configRestAdaptorService,
- "service_templates/vpe-201802-baseconfig/dict.json");
-
- ConfigResourceAssignmentTestUtils.injectConfigResourceSaveMock(configResourceService);
-
- componentNodeService =
- new ComponentNodeServiceImpl(bundleContext, configResourceService, configRestAdaptorService);
- configModelService = new ConfigModelServiceImpl(configRestAdaptorService);
- configGeneratorService = new ConfigGeneratorServiceImpl(configResourceService);
-
- ConfigAssignmentNode configAssignmentNode = new ConfigAssignmentNode(configResourceService,
- configRestAdaptorService, configModelService, componentNodeService, configGeneratorService);
-
- String inputContent = FileUtils.readFileToString(
- new File("src/test/resources/service_templates/vpe-201802-baseconfig/input-complex.json"),
- Charset.defaultCharset());
-
- Map<String, String> inParams = new HashMap<>();
- inParams.put(ConfigModelConstant.PROPERTY_SELECTOR, "complex-test");
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_REQUEST_ID, "request-1234");
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_RESOURCE_ID, "resourceid-1234");
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_RESOURCE_TYPE, "vnf-type");
- inParams.put(ConfigModelConstant.SERVICE_TEMPLATE_KEY_ARTIFACT_NAME, "vpe-201802-baseconfig");
- inParams.put(ConfigModelConstant.SERVICE_TEMPLATE_KEY_ARTIFACT_VERSION, "1.0.0");
- inParams.put(ConfigModelConstant.PROPERTY_ACTION_NAME, "resource-assignment-action");
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_INPUT_DATA, inputContent);
- inParams.put(ConfigAssignmentConstants.INPUT_PARAM_TEMPLATE_NAMES, "[\"base-config-template\"]");
- SvcLogicContext ctx = new SvcLogicContext();
- configAssignmentNode.process(inParams, ctx);
- Assert.assertNotNull("Failed to get response mashed Content",
- ctx.getAttribute("complex-test.mashed-data.base-config-template"));
-
- }
-
- @Test
- public void inputValidator() {
- SvcLogicContext ctx = new SvcLogicContext();
- try {
-
- logger.info(" ******************************* inputValidator ***************************");
- String serviceTemplateContent = FileUtils.readFileToString(
- new File("src/test/resources/service_templates/resource_assignment.json"),
- Charset.defaultCharset());
-
- String inputcontent = FileUtils.readFileToString(
- new File("src/test/resources/service_templates/input/inputValidateTest.json"),
- Charset.defaultCharset());
-
- Map<String, String> context = new HashMap<>();
- configModelService.prepareContext(context, inputcontent, serviceTemplateContent);
-
- // TransformationUtils.printMap(context);
-
- context.forEach((name, value) -> {
- if (StringUtils.isNotBlank(name) && StringUtils.isNotBlank(value)) {
- ctx.setAttribute(name, value);
- }
- });
-
- ComponentNodeDelegate componentNodeDelegate = new ComponentNodeDelegate(componentNodeService);
- Map<String, String> inParams = new HashMap<>();
- inParams.put(ConfigModelConstant.PROPERTY_SELECTOR, "resource-assignment");
- componentNodeDelegate.process(inParams, ctx);
- Assert.fail();
- } catch (Exception e) {
- logger.error("Failed in inputValidator" + e.getMessage());
- logger.info("** ctx.getAttribute Check for **" + ctx.getAttribute("resource-assignment.error-message"));
- }
-
- }
-
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ConfigPreviewServiceTest.java b/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ConfigPreviewServiceTest.java deleted file mode 100644 index be4ca0381..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ConfigPreviewServiceTest.java +++ /dev/null @@ -1,111 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.assignment.service;
-
-import java.io.File;
-import java.nio.charset.Charset;
-import org.apache.commons.io.FileUtils;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.onap.ccsdk.features.assignment.data.ResourceAssignmentData;
-import org.onap.ccsdk.features.data.adaptor.domain.ConfigResource;
-import org.onap.ccsdk.features.data.adaptor.service.ConfigResourceService;
-import org.onap.ccsdk.features.generator.service.ConfigGeneratorService;
-import org.onap.ccsdk.features.generator.service.ConfigGeneratorServiceImpl;
-import org.onap.ccsdk.features.model.service.ConfigModelService;
-import org.onap.ccsdk.features.model.service.ConfigModelServiceImpl;
-import org.onap.ccsdk.features.rest.adaptor.service.ConfigRestAdaptorService;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-@RunWith(MockitoJUnitRunner.class)
-public class ConfigPreviewServiceTest {
-
- private static EELFLogger logger = EELFManager.getInstance().getLogger(ConfigPreviewServiceTest.class);
-
- @Rule
- public ExpectedException thrown = ExpectedException.none();
-
- @Mock
- private ConfigResourceService configResourceService;
-
- @Mock
- private ConfigRestAdaptorService configRestAdaptorService;
-
- private ConfigModelService configModelService;
- private ConfigGeneratorService configGeneratorService;
-
- @SuppressWarnings("unchecked")
- @Before
- public void before() throws Exception {
- MockitoAnnotations.initMocks(this);
- }
-
- @Test
- public void testGenerateTemplateResourceMash() throws Exception {
-
- ConfigResourceAssignmentTestUtils.injectTransactionLogSaveMock(configResourceService);
-
- ConfigResourceAssignmentTestUtils.injectConfigModelMock(configRestAdaptorService, "resource_assignment");
-
- ConfigResourceAssignmentTestUtils.injectResourceDictionaryMock(configRestAdaptorService,
- "assignments/empty-dictionary.json");
-
- ConfigResource configResourceQuery = new ConfigResource();
- configResourceQuery.setServiceTemplateVersion("sample-serviceTemplateName");
- configResourceQuery.setServiceTemplateVersion("1.0.0");
- configResourceQuery.setRecipeName("sample-action");
- configResourceQuery.setResourceId("123-resourceId");
- configResourceQuery.setResourceType("sample-resourceType");
- configResourceQuery.setTemplateName("base-config-template");
- String inputContent = FileUtils.readFileToString(
- new File("src/test/resources/service_templates/input/input.json"), Charset.defaultCharset());
- configResourceQuery.setResourceData(inputContent);
-
- ConfigResourceAssignmentTestUtils.injectGetConfigResourceMock(configResourceService, configResourceQuery);
-
- configModelService = new ConfigModelServiceImpl(configRestAdaptorService);
- configGeneratorService = new ConfigGeneratorServiceImpl(configResourceService);
-
- ConfigPreviewService configPreviewService =
- new ConfigPreviewService(configResourceService, configModelService, configGeneratorService);
-
- ResourceAssignmentData resourceAssignmentData = new ResourceAssignmentData();
- resourceAssignmentData.setResourceId("123-resourceId");
- resourceAssignmentData.setResourceType("sample-resourceType");
- resourceAssignmentData.setServiceTemplateName("sample-serviceTemplateName");
- resourceAssignmentData.setServiceTemplateVersion("1.0.0");
- resourceAssignmentData.setActionName("sample-action");
-
- resourceAssignmentData = configPreviewService.generateTemplateResourceMash(resourceAssignmentData);
-
- Assert.assertNotNull("Failed to get GenerateTemplateResourceMash response.", resourceAssignmentData);
- Assert.assertNotNull("Failed to get template mashed contents.",
- resourceAssignmentData.getTemplatesMashedContents());
-
- Assert.assertNotNull("Failed to get base-config template mashed contents.",
- resourceAssignmentData.getTemplatesMashedContents().get("base-config-template"));
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ConfigResourceAssignmentTestUtils.java b/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ConfigResourceAssignmentTestUtils.java deleted file mode 100644 index 97082ae0f..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ConfigResourceAssignmentTestUtils.java +++ /dev/null @@ -1,182 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.assignment.service;
-
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.anyString;
-import java.io.File;
-import java.nio.charset.Charset;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.FilenameUtils;
-import org.apache.commons.io.IOUtils;
-import org.mockito.Matchers;
-import org.mockito.Mockito;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-import org.onap.ccsdk.features.data.adaptor.domain.ConfigResource;
-import org.onap.ccsdk.features.data.adaptor.domain.TransactionLog;
-import org.onap.ccsdk.features.data.adaptor.service.ConfigResourceService;
-import org.onap.ccsdk.features.model.ConfigModelConstant;
-import org.onap.ccsdk.features.model.data.dict.ResourceDefinition;
-import org.onap.ccsdk.features.model.domain.ConfigModel;
-import org.onap.ccsdk.features.model.domain.ConfigModelContent;
-import org.onap.ccsdk.features.rest.adaptor.service.ConfigRestAdaptorService;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class ConfigResourceAssignmentTestUtils {
-
- private static EELFLogger logger = EELFManager.getInstance().getLogger(ConfigResourceAssignmentTestUtils.class);
-
- public static void injectTransactionLogSaveMock(ConfigResourceService configResourceService) throws Exception {
- Mockito.doAnswer(new Answer<Void>() {
- @Override
- public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- if (args != null) {
- logger.trace("Transaction info " + Arrays.asList(args));
- }
- return null;
- }
- }).when(configResourceService).save(any(TransactionLog.class));
- }
-
- public static void injectConfigModelMock(ConfigRestAdaptorService configRestAdaptorService,
- String serviceTemplateName) throws Exception {
-
- Mockito.doAnswer(new Answer<ConfigModel>() {
- @Override
- public org.onap.ccsdk.features.model.domain.ConfigModel answer(InvocationOnMock invocationOnMock)
- throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- org.onap.ccsdk.features.model.domain.ConfigModel serviceArtifact = null;
- if (args != null && args.length == 3) {
-
- logger.info("Artifact info " + Arrays.asList(args));
- String modelContent = IOUtils.toString(
- ConfigResourceAssignmentTestUtils.class.getClassLoader().getResourceAsStream(
- "service_templates/" + serviceTemplateName + "/" + serviceTemplateName + ".json"),
- Charset.defaultCharset());
-
- ConfigModelContent configModelContent = new ConfigModelContent();
- configModelContent.setContent(modelContent);
- configModelContent.setContentType(ConfigModelConstant.MODEL_CONTENT_TYPE_TOSCA_JSON);
-
- List<ConfigModelContent> configModelContents = new ArrayList<>();
- configModelContents.add(configModelContent);
-
- String velocityDir = ConfigResourceAssignmentTestUtils.class.getClassLoader()
- .getResource("service_templates/" + serviceTemplateName + "/velocity").getPath();
-
- Collection<File> templateFiles =
- FileUtils.listFiles(new File(velocityDir), new String[] {"vtl"}, true);
- logger.info("Template Files info " + templateFiles);
- for (File templateFile : templateFiles) {
- String templateContent = FileUtils.readFileToString(templateFile, Charset.defaultCharset());
- ConfigModelContent configModelTemplateContent = new ConfigModelContent();
- configModelTemplateContent.setContent(templateContent);
- configModelTemplateContent.setName(FilenameUtils.getBaseName(templateFile.getName()));
- configModelTemplateContent.setContentType(ConfigModelConstant.MODEL_CONTENT_TYPE_TEMPLATE);
- configModelContents.add(configModelTemplateContent);
- }
-
- serviceArtifact = new org.onap.ccsdk.features.model.domain.ConfigModel();
- serviceArtifact.setArtifactName(String.valueOf(args[0]));
- serviceArtifact.setArtifactVersion(String.valueOf(args[1]));
- serviceArtifact.setPublished("Y");
- serviceArtifact.setConfigModelContents(configModelContents);
- }
-
- return serviceArtifact;
- }
- }).when(configRestAdaptorService).getResource(anyString(), anyString(), Matchers.any(Class.class));
- }
-
- public static void injectResourceDictionaryMock(ConfigRestAdaptorService configRestAdaptorService,
- String dictionaryFileName) throws Exception {
-
- Mockito.doAnswer(new Answer<String>() {
- @Override
- public String answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- String dictionaties = "[]";
- if (args != null) {
- logger.info("getResourceDictionaryByNames " + Arrays.asList(args));
- dictionaties = IOUtils.toString(
- ConfigAssignmentNodeTest.class.getClassLoader().getResourceAsStream(dictionaryFileName),
- Charset.defaultCharset());
- }
- return dictionaties;
- }
- }).when(configRestAdaptorService).postResource(Matchers.any(), Matchers.any(), Matchers.any(),
- Matchers.any(Class.class));
- }
-
- public static void injectConfigResourceSaveMock(ConfigResourceService configResourceService) throws Exception {
- Mockito.doAnswer(new Answer<ConfigResource>() {
- @Override
- public ConfigResource answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- ConfigResource configResource = null;
- if (args != null) {
- configResource = (ConfigResource) args[0];
- logger.info("Config Resource Save info " + configResource);
- return configResource;
- }
- return configResource;
- }
- }).when(configResourceService).saveConfigResource(any(ConfigResource.class));
- }
-
- public static void injectGetConfigResourceMock(ConfigResourceService configResourceService,
- ConfigResource configResource) throws Exception {
- Mockito.doAnswer(new Answer<List<ConfigResource>>() {
- @Override
- public List<ConfigResource> answer(InvocationOnMock invocationOnMock) throws Throwable {
- Object[] args = invocationOnMock.getArguments();
- List<ConfigResource> configResources = new ArrayList<>();
- if (args != null) {
- configResources.add(configResource);
- }
- return configResources;
- }
- }).when(configResourceService).getConfigResource(any(ConfigResource.class));
- }
-
- public static String getFileContent(String filePath) throws Exception {
- return IOUtils.toString(ConfigResourceAssignmentTestUtils.class.getClassLoader().getResourceAsStream(filePath),
- Charset.defaultCharset());
- }
-
- public static Map<String, ResourceDefinition> getMapfromJson(String content) {
- try {
- ObjectMapper mapper = new ObjectMapper();
- return mapper.readValue(content, new TypeReference<Map<String, ResourceDefinition>>() {});
- } catch (Exception e) {
- logger.info("getMapfromJson Exception ({})", e);
- }
- return null;
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ResourceAssignmentGenerationTest.java b/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ResourceAssignmentGenerationTest.java deleted file mode 100644 index 73f0d0941..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ResourceAssignmentGenerationTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.assignment.service;
-
-import java.nio.charset.Charset;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.apache.commons.io.IOUtils;
-import org.junit.Assert;
-import org.junit.Test;
-import org.onap.ccsdk.features.model.ConfigModelConstant;
-import org.onap.ccsdk.features.model.ValidTypes;
-import org.onap.ccsdk.features.model.data.ResourceAssignment;
-import org.onap.ccsdk.features.model.utils.ResourceAssignmentUtils;
-import org.onap.ccsdk.features.model.utils.TransformationUtils;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.JsonNode;
-
-public class ResourceAssignmentGenerationTest {
-
- private static EELFLogger logger = EELFManager.getInstance().getLogger(ResourceAssignmentGenerationTest.class);
-
- @Test
- public void testResourceDataSetting() {
- try {
- logger.info(" **************** testResourceDataSetting *****************");
- String resourceAssignmentContents = IOUtils.toString(TopologicalSortingTest.class.getClassLoader()
- .getResourceAsStream("assignments/alltype-empty-value-mapping.json"), Charset.defaultCharset());
-
- List<ResourceAssignment> assignments =
- TransformationUtils.getListfromJson(resourceAssignmentContents, ResourceAssignment.class);
- if (assignments != null) {
- Map<String, Object> componentContext = new HashMap<>();
- componentContext.put(ConfigModelConstant.PROPERTY_ACTION_NAME, "sample-recipe");
- for (ResourceAssignment resourceAssignment : assignments) {
- if (resourceAssignment != null && resourceAssignment.getProperty() != null) {
- String type = resourceAssignment.getProperty().getType();
- Object value = null;
- if (ValidTypes.DATA_TYPE_STRING.equals(type)) {
- value = new String("abcdef");
- } else if (ValidTypes.DATA_TYPE_INTEGER.equals(type)) {
- value = new Integer(1234);
- } else if (ValidTypes.DATA_TYPE_BOOLEAN.equals(type)) {
- value = new Boolean(true);
- } else if (ValidTypes.DATA_TYPE_LIST.equals(type)) {
- String entityType = resourceAssignment.getProperty().getEntrySchema().getType();
- if (ValidTypes.DATA_TYPE_STRING.equals(entityType)) {
- value = "[\"abcd-array\"]";
- } else {
- String content = "[{\"name\" : \"abcd-array-complex\"}]";
- JsonNode node = TransformationUtils.getJsonNodeForString(content);
- value = node;
- }
- } else {
- String content = "{\"name\" : \"abcd-complex\"}";
- JsonNode node = TransformationUtils.getJsonNodeForString(content);
- value = node;
- }
- ResourceAssignmentUtils.setResourceDataValue(componentContext, resourceAssignment, value);
- }
- }
- String generatedData = ResourceAssignmentUtils.generateResourceDataForAssignments(assignments);
- logger.trace("Generated Data " + generatedData);
-
- Assert.assertNotNull("Failed to generate resource data", generatedData);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @Test
- public void testGenerateResourceData() {
- try {
- logger.info(" **************** testGenerateResourceData *****************");
- String resourceAssignmentContents = IOUtils.toString(TopologicalSortingTest.class.getClassLoader()
- .getResourceAsStream("assignments/alltype-mapping.json"), Charset.defaultCharset());
-
- List<ResourceAssignment> assignments =
- TransformationUtils.getListfromJson(resourceAssignmentContents, ResourceAssignment.class);
- if (assignments != null) {
-
- String generatedData = ResourceAssignmentUtils.generateResourceDataForAssignments(assignments);
- logger.trace("Generated Data " + generatedData);
-
- Assert.assertNotNull("Failed to generate resource data", generatedData);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ResourceAssignmentValidation.java b/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ResourceAssignmentValidation.java deleted file mode 100644 index 081315639..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/ResourceAssignmentValidation.java +++ /dev/null @@ -1,94 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.assignment.service;
-
-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.util.List;
-import org.apache.commons.io.IOUtils;
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.onap.ccsdk.features.model.ConfigModelException;
-import org.onap.ccsdk.features.model.data.ResourceAssignment;
-import org.onap.ccsdk.features.model.utils.TransformationUtils;
-import org.onap.ccsdk.features.model.validator.ResourceAssignmentValidator;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-public class ResourceAssignmentValidation {
- private static EELFLogger logger = EELFManager.getInstance().getLogger(ResourceAssignmentValidation.class);
-
- @Rule
- public final ExpectedException exception = ExpectedException.none();
-
- @Test
- public void testValidateSuccess() {
- try {
- logger.info(" **************** testValidateSuccess *****************");
- String resourceMapping = IOUtils.toString(
- TopologicalSortingTest.class.getClassLoader().getResourceAsStream("validation/success.json"),
- Charset.defaultCharset());
-
- List<ResourceAssignment> assignments =
- TransformationUtils.getListfromJson(resourceMapping, ResourceAssignment.class);
- if (assignments != null) {
- ResourceAssignmentValidator resourceAssignmentValidator = new ResourceAssignmentValidator(assignments);
-
- boolean result = resourceAssignmentValidator.validateResourceAssignment();
- Assert.assertTrue("Failed to Validate", result);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- @Test(expected = ConfigModelException.class)
- public void testValidateDuplicate() throws IOException, ConfigModelException {
- logger.info(" **************** testValidateDuplicate *****************");
- String resourceMapping = IOUtils.toString(
- TopologicalSortingTest.class.getClassLoader().getResourceAsStream("validation/duplicate.json"),
- Charset.defaultCharset());
-
- List<ResourceAssignment> assignments =
- TransformationUtils.getListfromJson(resourceMapping, ResourceAssignment.class);
- if (assignments != null) {
- ResourceAssignmentValidator resourceAssignmentValidator = new ResourceAssignmentValidator(assignments);
- resourceAssignmentValidator.validateResourceAssignment();
- }
-
- }
-
- @Test(expected = ConfigModelException.class)
- public void testValidateCyclic() throws IOException, ConfigModelException {
- logger.info(" **************** testValidateCyclic *****************");
- String resourceMapping = IOUtils.toString(
- TopologicalSortingTest.class.getClassLoader().getResourceAsStream("validation/cyclic.json"),
- Charset.defaultCharset());
-
- List<ResourceAssignment> assignments =
- TransformationUtils.getListfromJson(resourceMapping, ResourceAssignment.class);
- if (assignments != null) {
- ResourceAssignmentValidator resourceAssignmentValidator = new ResourceAssignmentValidator(assignments);
-
- resourceAssignmentValidator.validateResourceAssignment();
- }
-
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/TopologicalSortingTest.java b/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/TopologicalSortingTest.java deleted file mode 100644 index f6e8871a6..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/java/org/onap/ccsdk/features/assignment/service/TopologicalSortingTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- */
-
-package org.onap.ccsdk.features.assignment.service;
-
-import java.nio.charset.Charset;
-import java.util.List;
-import org.apache.commons.io.IOUtils;
-import org.junit.Assert;
-import org.junit.Test;
-import org.onap.ccsdk.features.assignment.processor.ResourceAssignmentProcessor;
-import org.onap.ccsdk.features.model.data.ResourceAssignment;
-import org.onap.ccsdk.features.model.utils.TransformationUtils;
-import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-public class TopologicalSortingTest {
- private static EELFLogger logger = EELFManager.getInstance().getLogger(TopologicalSortingTest.class);
-
- @Test
- public void testBulkSequencingMapping() {
- try {
- logger.info(" **************** Bulk Sequencing Default *****************");
- String resourceMapping = IOUtils.toString(
- TopologicalSortingTest.class.getClassLoader().getResourceAsStream("mapping/dependency.json"),
- Charset.defaultCharset());
-
- List<ResourceAssignment> assignments =
- TransformationUtils.getListfromJson(resourceMapping, ResourceAssignment.class);
- if (assignments != null) {
- SvcLogicContext ctx = new SvcLogicContext();
- ResourceAssignmentProcessor resourceAssignmentProcessor =
- new ResourceAssignmentProcessor(assignments, ctx);
- List<List<ResourceAssignment>> sequenceBatchResourceAssignment = resourceAssignmentProcessor.process();
-
- Assert.assertNotNull("Failed to populate Sequence Bulk Mappings", sequenceBatchResourceAssignment);
- Assert.assertNotEquals("Failed to populate Sequence Bulk Mappings size ",
- (sequenceBatchResourceAssignment.size() > 0));
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/assignments/alltype-empty-value-mapping.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/assignments/alltype-empty-value-mapping.json deleted file mode 100644 index a3d65927b..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/assignments/alltype-empty-value-mapping.json +++ /dev/null @@ -1,86 +0,0 @@ -[
- {
- "name": "vnf-id-string",
- "property": {
- "required": true,
- "type": "string"
- },
- "input-param": true,
- "dictionary-name": "vnf-id-string",
- "dictionary-source": "input",
- "version": 0,
- "status": "success",
- "updated-by": "System"
- },
- {
- "name": "vnf-id-integer",
- "property": {
- "required": true,
- "type": "integer"
- },
- "input-param": true,
- "dictionary-name": "vnf-id-integer",
- "dictionary-source": "input",
- "version": 0,
- "status": "success",
- "updated-by": "System"
- },
- {
- "name": "vnf-boolean",
- "property": {
- "required": true,
- "type": "boolean"
- },
- "input-param": true,
- "dictionary-name": "vnf-boolean",
- "dictionary-source": "input",
- "version": 0,
- "status": "success",
- "updated-by": "System"
- },
- {
- "name": "vnf-complex",
- "property": {
- "required": true,
- "type": "dt-complex"
- },
- "input-param": true,
- "dictionary-name": "vnf-complex",
- "dictionary-source": "input",
- "version": 0,
- "status": "success",
- "updated-by": "System"
- },
- {
- "name": "vnf-id-array",
- "property": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "input-param": true,
- "dictionary-name": "vnf-id-array",
- "dictionary-source": "input",
- "version": 0,
- "status": "success",
- "updated-by": "System"
- },
- {
- "name": "vnf-array-complex",
- "property": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "dt-complex"
- }
- },
- "input-param": true,
- "dictionary-name": "vnf-array-complex",
- "dictionary-source": "input",
- "version": 0,
- "status": "success",
- "updated-by": "System"
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/assignments/alltype-mapping.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/assignments/alltype-mapping.json deleted file mode 100644 index 36909da99..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/assignments/alltype-mapping.json +++ /dev/null @@ -1,110 +0,0 @@ -[
- {
- "name": "vnf-id-string",
- "property": {
- "required": true,
- "type": "string",
- "value": "123456"
- },
- "input-param": true,
- "dictionary-name": "vnf-id-string",
- "dictionary-source": "input",
- "version": 0,
- "status": "success",
- "updated-by": "System"
- },
- {
- "name": "vnf-id-integer",
- "property": {
- "required": true,
- "type": "integer",
- "value": 123456
- },
- "input-param": true,
- "dictionary-name": "vnf-id-integer",
- "dictionary-source": "input",
- "version": 0,
- "status": "success",
- "updated-by": "System"
- },
- {
- "name": "vnf-boolean",
- "property": {
- "required": true,
- "type": "boolean",
- "value": true
- },
- "input-param": true,
- "dictionary-name": "vnf-boolean",
- "dictionary-source": "input",
- "version": 0,
- "status": "success",
- "updated-by": "System"
- },
- {
- "name": "vnf-complex",
- "property": {
- "required": true,
- "type": "dt-complex",
- "value": {
- "name": "Brinda",
- "location": "Madurai",
- "count": 2
- }
- },
- "input-param": true,
- "dictionary-name": "vnf-complex",
- "dictionary-source": "input",
- "version": 0,
- "status": "success",
- "updated-by": "System"
- },
- {
- "name": "vnf-id-array",
- "property": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- },
- "value": [
- "A",
- "B",
- "C"
- ]
- },
- "input-param": true,
- "dictionary-name": "vnf-id-array",
- "dictionary-source": "input",
- "version": 0,
- "status": "success",
- "updated-by": "System"
- },
- {
- "name": "vnf-array-complex",
- "property": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "dt-complex"
- },
- "value": [
- {
- "name": "A"
- },
- {
- "name": "B"
- },
- {
- "name": "C"
- }
- ]
- },
- "input-param": true,
- "dictionary-name": "vnf-array-complex",
- "dictionary-source": "input",
- "version": 0,
- "status": "success",
- "updated-by": "System"
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/assignments/empty-dictionary.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/assignments/empty-dictionary.json deleted file mode 100644 index 0637a088a..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/assignments/empty-dictionary.json +++ /dev/null @@ -1 +0,0 @@ -[]
\ No newline at end of file diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/array-complex-response.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/array-complex-response.json deleted file mode 100644 index 2dfe89e29..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/array-complex-response.json +++ /dev/null @@ -1,12 +0,0 @@ -{
- "locations": [
- {
- "mdsal-country": "US",
- "mdsal-state": "NJ"
- },
- {
- "mdsal-country": "INDIA",
- "mdsal-state": "TN"
- }
- ]
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/array-complex-v4-assigned-response.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/array-complex-v4-assigned-response.json deleted file mode 100644 index d7c5546c1..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/array-complex-v4-assigned-response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "v4-assigned-ip-list": [ - { - "v4-ip-type": "NMLAN", - "ipv4-gateway-prefix": "10.66.1.129", - "v4-ip-prefix": "10.66.1.152", - "v4-ip-prefix-length": 32, - "ip-count": 1, - "v4-ip-source": "EIPAM", - "client-key": "ADIG_19_vnf_name061rej01" - } - ] -} diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/complex-response.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/complex-response.json deleted file mode 100644 index 1a36100fd..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/complex-response.json +++ /dev/null @@ -1,6 +0,0 @@ -{
- "locations": {
- "mdsal-country": "US",
- "mdsal-state": "NJ"
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/default-pointer.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/default-pointer.json deleted file mode 100644 index 47edb1881..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/default-pointer.json +++ /dev/null @@ -1,166 +0,0 @@ -{
- "vnf-topology-information": {
- "vnf-assignments": {
- "availability-zones": [
- {
- "availability-zone": "frkde-esx-az01"
- }
- ],
- "vnf-vms": [
- {
- "vm-type": "vre",
- "vm-count": 1,
- "vm-networks": [
- {
- "network-role": "ADIGOam.OAM",
- "network-name": "ADIGOAM.OAM",
- "v4-assigned-ip-list": [
- {
- "v4-ip-type": "NMLAN",
- "ipv4-gateway-prefix": "10.66.1.129",
- "v4-ip-prefix": "10.66.1.152",
- "v4-ip-prefix-length": 32,
- "ip-count": 1,
- "v4-ip-source": "EIPAM",
- "client-key": "ADIG_19_vnf_name061rej01"
- }
- ],
- "network-id": "VPEADIG1d77c-1086-41ec-b7f3-94bb30936807"
- },
- {
- "network-role": "Internal-Network",
- "network-name": "VMX-INTTERNAL056",
- "v4-assigned-ip-list": [
- {
- "v4-ip-type": "INTERNAL",
- "v4-ip-prefix": "128.0.0.1",
- "ipv4-prefix-block": "128.0.0.0",
- "v4-ip-prefix-length": 24,
- "v4-ip-source": "OTHER"
- }
- ],
- "network-forwarding": "l2",
- "network-id": "VMX-INT1"
- }
- ],
- "vm-names": [
- {
- "vm-name": "ADIG_19_vnf_name061rej",
- "vm-uuid": "50d2032d-fe15-4e82-94f3-8b73c566a345"
- }
- ]
- },
- {
- "vm-type": "vpfe",
- "vm-count": 1,
- "vm-networks": [
- {
- "network-role": "ADIG_SRIOV_3",
- "network-name": "ADIG_SRIOV_3",
- "multicast-allow": true,
- "broadcast-allow": true,
- "network-id": "VPEADIG1d77c-1086-41ec-b7f3-94bb30936810",
- "vlan-filter": "[4013,4014]",
- "network-macs": [
- {
- "mac-address": "dc:38:e1:69:bf:5f"
- }
- ],
- "vlan-strip": false,
- "unicast-allow": true
- },
- {
- "network-role": "ADIG_SRIOV_4",
- "network-name": "ADIG_SRIOV_4",
- "multicast-allow": true,
- "broadcast-allow": true,
- "network-id": "VPEADIG1d77c-1086-41ec-b7f3-94bb30936811",
- "vlan-filter": "[4013,4014]",
- "network-macs": [
- {
- "mac-address": "dc:38:e1:69:bf:5f"
- }
- ],
- "vlan-strip": false,
- "unicast-allow": true
- },
- {
- "network-role": "ADIG_SRIOV_1",
- "network-name": "ADIG_SRIOV_1",
- "multicast-allow": true,
- "broadcast-allow": true,
- "network-id": "VPEADIG1d77c-1086-41ec-b7f3-94bb30936808",
- "vlan-filter": "[4013,4014]",
- "network-macs": [
- {
- "mac-address": "dc:38:e1:69:bf:5f"
- }
- ],
- "vlan-strip": false,
- "unicast-allow": true
- },
- {
- "network-role": "ADIG_SRIOV_2",
- "network-name": "ADIG_SRIOV_2",
- "multicast-allow": true,
- "broadcast-allow": true,
- "network-id": "VPEADIG1d77c-1086-41ec-b7f3-94bb30936809",
- "vlan-filter": "[4013,4014]",
- "network-macs": [
- {
- "mac-address": "dc:38:e1:69:bf:5f"
- }
- ],
- "vlan-strip": false,
- "unicast-allow": true
- },
- {
- "network-role": "Internal-Network",
- "network-name": "VMX-INTTERNAL056",
- "v4-assigned-ip-list": [
- {
- "v4-ip-type": "INTERNAL",
- "v4-ip-prefix": "128.0.0.16",
- "ipv4-prefix-block": "128.0.0.0",
- "v4-ip-prefix-length": 24,
- "v4-ip-source": "OTHER"
- }
- ],
- "network-forwarding": "l2",
- "network-id": "VMX-INT1"
- }
- ],
- "vm-names": [
- {
- "vm-name": "ADIG_19_vnf_name056fej",
- "vm-uuid": "d2ce6023-a3ab-412e-bc63-360307aac165"
- }
- ]
- }
- ],
- "vnf-status": "Deactivated",
- "vnf-networks": [
- {
- "network-role": "ADIGOam.OAM",
- "network-id": "VPEADIG1d77c-1086-41ec-b7f3-94bb30936807"
- },
- {
- "network-role": "ADIG_SRIOV_3",
- "network-id": "VPEADIG1d77c-1086-41ec-b7f3-94bb30936810"
- },
- {
- "network-role": "ADIG_SRIOV_2",
- "network-id": "VPEADIG1d77c-1086-41ec-b7f3-94bb30936809"
- },
- {
- "network-role": "ADIG_SRIOV_4",
- "network-id": "VPEADIG1d77c-1086-41ec-b7f3-94bb30936811"
- },
- {
- "network-role": "ADIG_SRIOV_1",
- "network-id": "VPEADIG1d77c-1086-41ec-b7f3-94bb30936808"
- }
- ]
- }
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/dt-location.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/dt-location.json deleted file mode 100644 index 52e0a7967..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/dt-location.json +++ /dev/null @@ -1,15 +0,0 @@ -{
- "version": "1.0.0",
- "description": "test Data Type",
- "properties": {
- "country": {
- "required": true,
- "type": "string"
- },
- "state": {
- "required": false,
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Root"
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/dt-v4-assigned-ip-list.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/dt-v4-assigned-ip-list.json deleted file mode 100644 index bc8f1d2c2..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/dt-v4-assigned-ip-list.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "version": "1.0.0", - "description": "This is dt-v4-assigned-ip-list Data Type", - "properties": { - "v4-ip-type": { - "required": true, - "type": "string" - }, - "ipv4-gateway-prefix": { - "required": true, - "type": "string" - }, - "v4-ip-prefix": { - "required": true, - "type": "string" - }, - "v4-ip-prefix-length": { - "required": true, - "type": "string" - }, - "v4-ip-source": { - "required": true, - "type": "string" - } - }, - "derived_from": "tosca.datatypes.Root" -} diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/mdsal-array-v4iplist.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/mdsal-array-v4iplist.json deleted file mode 100644 index 387a5ad2d..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/mdsal-array-v4iplist.json +++ /dev/null @@ -1,76 +0,0 @@ -{
- "v4-ip-prefix": {
- "name": "v4-ip-prefix",
- "property": {
- "type": "string"
- },
- "sources": {
- "mdsal": {
- "type": "source-mdsal",
- "properties": {
- "url-path": "/restconf/config/L3VNF-API:services/service-list/$service-instance-id/service-data/vnf-topology-information/vnf-assignments/vnf-vms/$oam-ipv4-ip-type/vm-networks/$oam-network-role/v4-assigned-ip-list/$oam-vm-type",
- "path": "/v4-assigned-ip-list/0/v4-ip-prefix",
- "input-key-mapping": {
- "service-instance-id": "service-instance-id",
- "oam-network-role": "oam-network-role",
- "oam-ipv4-ip-type": "oam-ipv4-ip-type",
- "oam-vm-type": "oam-vm-type"
- },
- "output-key-mapping": {
- "v4-ip-prefix": "v4-ip-prefix"
- },
- "key-dependencies": [
- "service-instance-id",
- "oam-network-role",
- "oam-ipv4-ip-type",
- "oam-vm-type"
- ]
- }
- }
- }
- },
- "service-instance-id": {
- "name": "service-instance-id",
- "property": {
- "type": "string"
- },
- "sources": {
- "default": {
- "type": "source-input"
- }
- }
- },
- "oam-network-role": {
- "name": "oam-network-role",
- "property": {
- "type": "string"
- },
- "sources": {
- "default": {
- "type": "source-input"
- }
- }
- },
- "oam-ipv4-ip-type": {
- "name": "oam-ipv4-ip-type",
- "property": {
- "type": "string"
- },
- "sources": {
- "default": {
- "type": "source-input"
- }
- }
- },
- "oam-vm-type": {
- "name": "oam-vm-type",
- "property": {
- "type": "string"
- },
- "sources": {
- "default": {
- "type": "source-input"
- }
- }
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/mdsal-array.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/mdsal-array.json deleted file mode 100644 index 290a15752..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/mdsal-array.json +++ /dev/null @@ -1,42 +0,0 @@ -{
- "locations": {
- "name": "locations",
- "property": {
- "type": "list",
- "entry_schema": {
- "type": "dt-location"
- }
- },
- "sources": {
- "mdsal": {
- "type": "source-mdsal",
- "properties": {
- "url-path": "/restconf/config/L3VNF-API/services/service-list/$profile_name/12345",
- "path": "/locations",
- "input-key-mapping": {
- "profile_name": "profile_name"
- },
- "output-key-mapping": {
- "mdsal-country": "country",
- "mdsal-state": "state"
- },
- "key-dependencies": [
- "profile_name"
- ]
- }
- }
- }
- },
- "profile_name": {
- "name": "profile_name",
- "property": {
- "type": "string"
- },
- "sources": {
- "default": {
- "type": "source-input"
- }
- }
- }
-}
-
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/mdsal-complex.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/mdsal-complex.json deleted file mode 100644 index f5a7d7ef6..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/mdsal-complex.json +++ /dev/null @@ -1,38 +0,0 @@ -{
- "location": {
- "name": "location",
- "property": {
- "type": "dt-location"
- },
- "sources": {
- "mdsal": {
- "type": "source-mdsal",
- "properties": {
- "url-path": "/restconf/config/L3VNF-API/services/service-list/$profile_name/12345",
- "path": "/locations",
- "input-key-mapping": {
- "profile_name": "profile_name"
- },
- "output-key-mapping": {
- "mdsal-country": "country",
- "mdsal-state": "state"
- },
- "key-dependencies": [
- "profile_name"
- ]
- }
- }
- }
- },
- "profile_name": {
- "name": "profile_name",
- "property": {
- "type": "string"
- },
- "sources": {
- "default": {
- "type": "source-input"
- }
- }
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/mdsal-simple.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/mdsal-simple.json deleted file mode 100644 index db7ee7eed..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/mdsal-simple.json +++ /dev/null @@ -1,37 +0,0 @@ -{
- "country": {
- "name": "country",
- "property": {
- "type": "string"
- },
- "sources": {
- "mdsal": {
- "type": "source-mdsal",
- "properties": {
- "url-path": "/restconf/config/L3VNF-API/services/service-list/$profile_name/12345",
- "path": "/locations",
- "input-key-mapping": {
- "profile_name": "profile_name"
- },
- "output-key-mapping": {
- "country": "country"
- },
- "key-dependencies": [
- "profile_name"
- ]
- }
- }
- }
- },
- "profile_name": {
- "name": "profile_name",
- "property": {
- "type": "string"
- },
- "sources": {
- "input": {
- "type": "source-input"
- }
- }
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/resource-assignments-array.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/resource-assignments-array.json deleted file mode 100644 index 2b5865326..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/resource-assignments-array.json +++ /dev/null @@ -1,15 +0,0 @@ -[
- {
- "name": "locations",
- "input-param": true,
- "property": {
- "type": "list",
- "entry_schema": {
- "type": "dt-location"
- }
- },
- "dictionary-name": "locations",
- "dictionary-source": "mdsal",
- "dependencies": []
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/resource-assignments-complex-simple.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/resource-assignments-complex-simple.json deleted file mode 100644 index 15881cfd0..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/resource-assignments-complex-simple.json +++ /dev/null @@ -1,12 +0,0 @@ -[
- {
- "name": "v4-ip-prefix",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "v4-ip-prefix",
- "dictionary-source": "mdsal",
- "dependencies": []
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/resource-assignments-complex.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/resource-assignments-complex.json deleted file mode 100644 index e42bd9431..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/resource-assignments-complex.json +++ /dev/null @@ -1,12 +0,0 @@ -[
- {
- "name": "location",
- "input-param": true,
- "property": {
- "type": "dt-location"
- },
- "dictionary-name": "location",
- "dictionary-source": "mdsal",
- "dependencies": []
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/resource-assignments-simple.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/resource-assignments-simple.json deleted file mode 100644 index 6385e6a8b..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/resource-assignments-simple.json +++ /dev/null @@ -1,12 +0,0 @@ -[
- {
- "name": "country",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "country",
- "dictionary-source": "mdsal",
- "dependencies": []
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/simple-response.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/simple-response.json deleted file mode 100644 index 8c2bb898f..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/Mdsal/simple-response.json +++ /dev/null @@ -1,3 +0,0 @@ -{
- "locations": "US"
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-array.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-array.json deleted file mode 100644 index bab783544..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-array.json +++ /dev/null @@ -1,40 +0,0 @@ -{
- "locations": {
- "name": "locations",
- "property": {
- "type": "list",
- "entry_schema": {
- "type": "dt-location"
- }
- },
- "sources": {
- "db": {
- "type": "source-sdnctl-db",
- "properties": {
- "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name",
- "input-key-mapping": {
- "profile_name": "profile_name"
- },
- "output-key-mapping": {
- "db-country": "country",
- "db-state": "state"
- },
- "key-dependencies": [
- "profile_name"
- ]
- }
- }
- }
- },
- "profile_name": {
- "name": "profile_name",
- "property": {
- "type": "string"
- },
- "sources": {
- "input": {
- "type": "source-input"
- }
- }
- }
-}
\ No newline at end of file diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-complex.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-complex.json deleted file mode 100644 index 7310500e3..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-complex.json +++ /dev/null @@ -1,37 +0,0 @@ -{
- "location": {
- "name": "location",
- "property": {
- "type": "dt-location"
- },
- "sources": {
- "db": {
- "type": "source-sdnctl-db",
- "properties": {
- "query": "SELECT db-country, db-state FROM DEVICE_PROFILE WHERE profile_name = :profile_name",
- "input-key-mapping": {
- "profile_name": "profile_name"
- },
- "output-key-mapping": {
- "db-country": "country",
- "db-state": "state"
- },
- "key-dependencies": [
- "profile_name"
- ]
- }
- }
- }
- },
- "profile_name": {
- "name": "profile_name",
- "property": {
- "type": "string"
- },
- "sources": {
- "input": {
- "type": "source-input"
- }
- }
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-simple.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-simple.json deleted file mode 100644 index 86d29c751..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/db-simple.json +++ /dev/null @@ -1,36 +0,0 @@ -{
- "country": {
- "name": "country",
- "property": {
- "type": "string"
- },
- "sources": {
- "db": {
- "type": "source-sdnctl-db",
- "properties": {
- "query": "SELECT country FROM DEVICE_PROFILE WHERE profile_name = :profile_name",
- "input-key-mapping": {
- "profile_name": "profile_name"
- },
- "output-key-mapping": {
- "country": "country"
- },
- "key-dependencies": [
- "profile_name"
- ]
- }
- }
- }
- },
- "profile_name": {
- "name": "profile_name",
- "property": {
- "type": "string"
- },
- "sources": {
- "input": {
- "type": "source-input"
- }
- }
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/dt-location.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/dt-location.json deleted file mode 100644 index 52e0a7967..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/dt-location.json +++ /dev/null @@ -1,15 +0,0 @@ -{
- "version": "1.0.0",
- "description": "test Data Type",
- "properties": {
- "country": {
- "required": true,
- "type": "string"
- },
- "state": {
- "required": false,
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Root"
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-array.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-array.json deleted file mode 100644 index c82f9addc..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-array.json +++ /dev/null @@ -1,15 +0,0 @@ -[
- {
- "name": "locations",
- "input-param": true,
- "property": {
- "type": "list",
- "entry_schema": {
- "type": "dt-location"
- }
- },
- "dictionary-name": "locations",
- "dictionary-source": "db",
- "dependencies": []
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-complex.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-complex.json deleted file mode 100644 index 4cca99bde..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-complex.json +++ /dev/null @@ -1,12 +0,0 @@ -[
- {
- "name": "location",
- "input-param": true,
- "property": {
- "type": "dt-location"
- },
- "dictionary-name": "location",
- "dictionary-source": "db",
- "dependencies": []
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-simple.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-simple.json deleted file mode 100644 index 02ce68be4..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/db/resource-assignments-simple.json +++ /dev/null @@ -1,12 +0,0 @@ -[
- {
- "name": "country",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "country",
- "dictionary-source": "db",
- "dependencies": []
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/default/default-simple.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/default/default-simple.json deleted file mode 100644 index fca0dde83..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/default/default-simple.json +++ /dev/null @@ -1,35 +0,0 @@ -{
- "country": {
- "name": "country",
- "property": {
- "type": "string"
- },
- "sources": {
- "default": {
- "type": "source-default"
- }
- }
- },
- "port": {
- "name": "port",
- "property": {
- "type": "integer"
- },
- "sources": {
- "default": {
- "type": "source-default"
- }
- }
- },
- "voip-enabled": {
- "name": "voip-enabled",
- "property": {
- "type": "boolean"
- },
- "sources": {
- "default": {
- "type": "source-default"
- }
- }
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/default/resource-assignments-simple.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/default/resource-assignments-simple.json deleted file mode 100644 index fc92710a5..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/default/resource-assignments-simple.json +++ /dev/null @@ -1,35 +0,0 @@ -[
- {
- "name": "country",
- "input-param": true,
- "property": {
- "type": "string",
- "default": "US"
- },
- "dictionary-name": "country",
- "dictionary-source": "default",
- "dependencies": []
- },
- {
- "name": "port",
- "input-param": true,
- "property": {
- "type": "integer",
- "default": 830
- },
- "dictionary-name": "port",
- "dictionary-source": "default",
- "dependencies": []
- },
- {
- "name": "voip-enabled",
- "input-param": true,
- "property": {
- "type": "boolean",
- "default": true
- },
- "dictionary-name": "voip-enabled",
- "dictionary-source": "default",
- "dependencies": []
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/dependency.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/dependency.json deleted file mode 100644 index e08539c0d..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/dependency.json +++ /dev/null @@ -1,110 +0,0 @@ -[
- {
- "name": "vnf-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "vnf-id",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "service-instance-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "service-instance-id",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "bundle-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "bundle-id",
- "dictionary-source": "mdsal",
- "dependencies": [
- "vnf-id"
- ]
- },
- {
- "name": "bundle-ip",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "bundle-ip",
- "dictionary-source": "mdsal",
- "dependencies": [
- "vnf-id"
- ]
- },
- {
- "name": "bundle-mac",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "bundle-mac",
- "dictionary-source": "mdsal",
- "dependencies": [
- "vnf-id",
- "bundle-id"
- ]
- },
- {
- "name": "managed-ip",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "managed-ip",
- "dictionary-source": "mdsal",
- "dependencies": [
- "loopback-ip"
- ]
- },
- {
- "name": "vnf-name",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "vnf-name",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "managed-ip1",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "managed-ip1",
- "dictionary-source": "mdsal",
- "dependencies": [
- "loopback-ip"
- ]
- },
- {
- "name": "loopback-ip",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "loopback-ip",
- "dictionary-source": "db",
- "dependencies": [
- "bundle-mac"
- ]
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/dt-location.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/dt-location.json deleted file mode 100644 index 52e0a7967..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/dt-location.json +++ /dev/null @@ -1,15 +0,0 @@ -{
- "version": "1.0.0",
- "description": "test Data Type",
- "properties": {
- "country": {
- "required": true,
- "type": "string"
- },
- "state": {
- "required": false,
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Root"
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/input-complex.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/input-complex.json deleted file mode 100644 index 7eabe440a..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/input-complex.json +++ /dev/null @@ -1,24 +0,0 @@ -{
- "location": {
- "name": "location",
- "property": {
- "type": "dt-location"
- },
- "sources": {
- "default": {
- "type": "source-input"
- }
- }
- },
- "profile_name": {
- "name": "profile_name",
- "property": {
- "type": "string"
- },
- "sources": {
- "default": {
- "type": "source-input"
- }
- }
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/input-simple.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/input-simple.json deleted file mode 100644 index 7b663f36a..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/input-simple.json +++ /dev/null @@ -1,35 +0,0 @@ -{
- "country": {
- "name": "country",
- "property": {
- "type": "string"
- },
- "sources": {
- "default": {
- "type": "source-input"
- }
- }
- },
- "port": {
- "name": "port",
- "property": {
- "type": "integer"
- },
- "sources": {
- "default": {
- "type": "source-input"
- }
- }
- },
- "voip-enabled": {
- "name": "voip-enabled",
- "property": {
- "type": "boolean"
- },
- "sources": {
- "default": {
- "type": "source-input"
- }
- }
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/resource-assignments-complex.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/resource-assignments-complex.json deleted file mode 100644 index 9e17841b4..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/resource-assignments-complex.json +++ /dev/null @@ -1,13 +0,0 @@ -[
- {
- "name": "location",
- "input-param": true,
- "property": {
- "type": "dt-location",
- "required": true
- },
- "dictionary-name": "location",
- "dictionary-source": "input",
- "dependencies": []
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/resource-assignments-simple.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/resource-assignments-simple.json deleted file mode 100644 index e3b2bcc06..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/resource-assignments-simple.json +++ /dev/null @@ -1,32 +0,0 @@ -[
- {
- "name": "country",
- "input-param": true,
- "property": {
- "type": "string",
- "default": "US"
- },
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "port",
- "input-param": true,
- "property": {
- "type": "integer",
- "default": 830
- },
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "voip-enabled",
- "input-param": true,
- "property": {
- "type": "boolean",
- "default": true
- },
- "dictionary-source": "input",
- "dependencies": []
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/sample-location.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/sample-location.json deleted file mode 100644 index 2f3f1c102..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/mapping/input/sample-location.json +++ /dev/null @@ -1,4 +0,0 @@ -{
- "country": "US",
- "state": "NJ"
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/input/input.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/input/input.json deleted file mode 100644 index cd6fac128..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/input/input.json +++ /dev/null @@ -1,18 +0,0 @@ -{
- "api-ver": "2.00",
- "originator-id": "MSO",
- "request-id": "123456",
- "service-instance-id": "ibcx0001vm001",
- "service-type": "AVPN",
- "vnf-type": "vUSP - vDBE-IPX HUB",
- "vnf-id": 123456,
- "service-template-name": "VRR-baseconfiguration",
- "service-template-version": "1.0.0",
- "action-name": "resource-assignment-action",
- "group-name": "sample group name",
- "bundle-id": "sample bundle id",
- "bundle-mac": [
- "Sample bundle mac",
- "Sample bundle mac"
- ]
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/input/inputValidateTest.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/input/inputValidateTest.json deleted file mode 100644 index 354ca577b..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/input/inputValidateTest.json +++ /dev/null @@ -1,18 +0,0 @@ -{
- "api-ver": "2.00",
- "originator-id": "MSO",
- "request-id": "123456",
- "service-instance-id": "ibcx0001vm001",
- "service-type": "AVPN",
- "vnf-type": "vUSP - vDBE-IPX HUB",
- "vnf-id": "",
- "service-template-name": "VRR-baseconfiguration",
- "service-template-version": "1.0.0",
- "action-name": "resource-assignment-action",
- "group-name": "sample group name",
- "bundle-id": "sample bundle id",
- "bundle-mac": [
- "Sample bundle mac",
- "Sample bundle mac"
- ]
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/resource_assignment.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/resource_assignment.json deleted file mode 100644 index cbea6a82c..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/resource_assignment.json +++ /dev/null @@ -1,407 +0,0 @@ -{
- "metadata": {
- "author": "ks220y@att.com",
- "service-template-name": "VRR-baseconfiguration",
- "service-template-version": "1.0.0",
- "release": "1802",
- "service-type": "AVPN",
- "vnf-type": "VRR"
- },
- "topology_template": {
- "inputs": {
- "request-id": {
- "required": true,
- "type": "string"
- },
- "service-instance-id": {
- "required": true,
- "type": "string"
- },
- "action-name": {
- "required": true,
- "type": "string"
- },
- "scope-type": {
- "required": true,
- "type": "string"
- },
- "hostname": {
- "required": true,
- "type": "string"
- }
- },
- "node_templates": {
- "base-config-template": {
- "type": "artifact-config-template",
- "properties": {
- "action-names": [
- "resource-assignment-action"
- ]
- },
- "capabilities": {
- "content": {
- "properties": {
- "content": "db://base-config-template"
- }
- },
- "mapping": {
- "properties": {
- "mapping": [
- {
- "name": "vnf-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "vnf-id",
- "dictionary-source": "input"
- },
- {
- "name": "group-name",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "group-name",
- "dictionary-source": "input"
- }
- ]
- }
- }
- }
- },
- "resource-assignment-action": {
- "type": "dg-resource-assignment",
- "interfaces": {
- "CONFIG": {
- "operations": {
- "ResourceAssignment": {
-
- }
- }
- }
- },
- "capabilities": {
- "dg-node": {
-
- }
- },
- "requirements": {
- "component-dependency": {
- "capability": "component-node",
- "node": "resource-assignment",
- "relationship": "tosca.relationships.DependsOn"
- }
- }
- },
- "licence-template": {
- "type": "artifact-config-template",
- "properties": {
- "action-names": [
- "resource-assignment-action"
- ]
- },
- "capabilities": {
- "content": {
- "properties": {
- "content": "db://licence-template"
- }
- },
- "mapping": {
- "properties": {
- "mapping": [
- {
- "name": "bundle-id",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "bundle-id",
- "dictionary-source": "input"
- },
- {
- "name": "bundle-mac",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "bundle-mac",
- "dictionary-source": "input"
- }
- ]
- }
- }
- }
- },
- "resource-assignment": {
- "type": "component-resource-assignment",
- "interfaces": {
- "org-onap-ccsdk-features-assignment-service-ConfigAssignmentNode": {
- "operations": {
- "process": {
- "inputs": {
- "action-name": "{ \"get_input\" : \"action-name\" }",
- "resource-type": "vnf-type",
- "template-names": [
- "base-config-template",
- "licence-template"
- ],
- "request-id": "{ \"get_input\" : \"request-id\" }",
- "resource-id": "{ \"get_input\" : \"vnf-id\" }"
- },
- "outputs": {
- "resource-assignment-params": "",
- "status": ""
- }
- }
- }
- }
- },
- "capabilities": {
- "component-node": {
-
- }
- }
- }
- }
- },
- "node_types": {
- "dg-resource-assignment": {
- "description": "This is Resource Assignment Directed Graph",
- "version": "1.0.0",
- "properties": {
- "mode": {
- "required": false,
- "type": "string",
- "default": "sync"
- },
- "version": {
- "required": false,
- "type": "string",
- "default": "LATEST"
- },
- "is-start-flow": {
- "required": false,
- "type": "boolean",
- "default": "false"
- }
- },
- "capabilities": {
- "dg-node": {
- "type": "tosca.capabilities.Node"
- },
- "content": {
- "type": "tosca.capabilities.Content",
- "properties": {
- "type": {
- "required": false,
- "type": "string",
- "default": "json"
- },
- "content": {
- "required": true,
- "type": "string"
- }
- }
- }
- },
- "requirements": {
- "component-dependency": {
- "capability": "component-node",
- "node": "component-resource-assignment",
- "relationship": "tosca.relationships.DependsOn"
- }
- },
- "interfaces": {
- "CONFIG": {
- "operations": {
- "ResourceAssignment": {
- "inputs": {
- "params": {
- "required": false,
- "type": "list",
- "entry_schema": {
- "type": "datatype-property"
- }
- }
- }
- }
- }
- }
- },
- "derived_from": "tosca.nodes.DG"
- },
- "component-resource-assignment": {
- "description": "This is Resource Assignment Component API",
- "version": "1.0.0",
- "capabilities": {
- "component-node": {
- "type": "tosca.capabilities.Node"
- }
- },
- "interfaces": {
- "org-onap-ccsdk-features-assignment-service-ConfigAssignmentNode": {
- "operations": {
- "process": {
- "inputs": {
- "action-name": {
- "description": "Action Name to get from Database, Either (message & mask-info ) or ( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",
- "required": false,
- "type": "string"
- },
- "handler-name": {
- "description": "Name of the Artifact Node Template, to get the template Content. If template-content is present, then content wont be reterived from the Artifact Node Template.",
- "required": true,
- "type": "string"
- },
- "resource-type": {
- "required": false,
- "type": "string"
- },
- "template-names": {
- "description": "Name of the Artifact Node Templates, to get the template Content.",
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "request-id": {
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",
- "required": true,
- "type": "string"
- },
- "resource-id": {
- "description": "Id used to pull the data content from the data base. Either template-data or resource-id should be present",
- "required": true,
- "type": "string"
- }
- },
- "outputs": {
- "resource-assignment-params": {
- "required": true,
- "type": "string"
- },
- "status": {
- "required": true,
- "type": "string"
- }
- }
- }
- }
- }
- },
- "derived_from": "tosca.nodes.Component"
- },
- "artifact-config-template": {
- "description": "This is Configuration Velocity Template",
- "version": "1.0.0",
- "properties": {
- "action-names": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "content": {
- "required": false,
- "type": "string"
- },
- "mapping": {
- "required": false,
- "type": "list",
- "entry_schema": {
- "type": "datatype-resource-assignment"
- }
- }
- },
- "capabilities": {
- "content": {
- "type": "tosca.capabilities.Content",
- "properties": {
- "content": {
- "required": true,
- "type": "string"
- }
- }
- },
- "mapping": {
- "type": "tosca.capabilities.Mapping",
- "properties": {
- "mapping": {
- "required": false,
- "type": "list",
- "entry_schema": {
- "type": "datatype-resource-assignment"
- }
- }
- }
- }
- },
- "derived_from": "tosca.nodes.Artifact"
- }
- },
- "data_types": {
- "datatype-resource-assignment": {
- "version": "1.0.0",
- "description": "This is Resource Assignment Data Type",
- "properties": {
- "property": {
- "required": true,
- "type": "datatype-property"
- },
- "input-param": {
- "required": true,
- "type": "boolean"
- },
- "dictionary-name": {
- "required": false,
- "type": "string"
- },
- "dictionary-source": {
- "required": false,
- "type": "string"
- },
- "dependencies": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- }
- },
- "derived_from": "tosca.datatypes.Root"
- },
- "datatype-property": {
- "version": "1.0.0",
- "description": "This is Entry point Input Data Type, which is dynamic datatype, The parameter names will be populated during the Design time for each inputs",
- "properties": {
- "type": {
- "required": true,
- "type": "string"
- },
- "description": {
- "required": false,
- "type": "string"
- },
- "required": {
- "required": false,
- "type": "boolean"
- },
- "default": {
- "required": false,
- "type": "string"
- },
- "entry_schema": {
- "required": false,
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Root"
- }
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/resource_assignment/resource_assignment.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/resource_assignment/resource_assignment.json deleted file mode 100644 index 4cbb8fa25..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/resource_assignment/resource_assignment.json +++ /dev/null @@ -1,417 +0,0 @@ -{
- "metadata": {
- "author": "ks220y@att.com",
- "service-template-name": "VRR-baseconfiguration",
- "service-template-version": "1.0.0",
- "release": "1802",
- "service-type": "AVPN",
- "vnf-type": "VRR"
- },
- "topology_template": {
- "inputs": {
- "request-id": {
- "required": true,
- "type": "string"
- },
- "service-instance-id": {
- "required": true,
- "type": "string"
- },
- "action-name": {
- "required": true,
- "type": "string"
- },
- "scope-type": {
- "required": true,
- "type": "string"
- },
- "hostname": {
- "required": true,
- "type": "string"
- }
- },
- "node_templates": {
- "base-config-template": {
- "type": "artifact-config-template",
- "properties": {
- "action-names": [
- "resource-assignment-action"
- ]
- },
- "capabilities": {
- "content": {
- "properties": {
- "content": "db://base-config-template"
- }
- },
- "mapping": {
- "properties": {
- "mapping": [
- {
- "name": "vnf-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "vnf-id",
- "dictionary-source": "input"
- },
- {
- "name": "group-name",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "group-name",
- "dictionary-source": "input"
- }
- ]
- }
- }
- }
- },
- "resource-assignment-action": {
- "type": "dg-resource-assignment",
- "interfaces": {
- "CONFIG": {
- "operations": {
- "ResourceAssignment": {
-
- }
- }
- }
- },
- "capabilities": {
- "dg-node": {
-
- }
- },
- "requirements": {
- "component-dependency": {
- "capability": "component-node",
- "node": "resource-assignment",
- "relationship": "tosca.relationships.DependsOn"
- }
- }
- },
- "licence-template": {
- "type": "artifact-config-template",
- "properties": {
- "action-names": [
- "resource-assignment-action"
- ]
- },
- "capabilities": {
- "content": {
- "properties": {
- "content": "db://licence-template"
- }
- },
- "mapping": {
- "properties": {
- "mapping": [
- {
- "name": "bundle-id",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "bundle-id",
- "dictionary-source": "input"
- },
- {
- "name": "bundle-mac",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "bundle-mac",
- "dictionary-source": "input"
- }
- ]
- }
- }
- }
- },
- "resource-assignment": {
- "type": "component-resource-assignment",
- "interfaces": {
- "org-onap-ccsdk-features-assignment-service-ConfigAssignmentNode": {
- "operations": {
- "process": {
- "inputs": {
- "service-template-name": "VRR-baseconfiguration",
- "service-template-version": "1.0.0",
- "action-name": "{ \"get_input\" : \"action-name\" }",
- "resource-type": "vnf-type",
- "template-names": [
- "base-config-template",
- "licence-template"
- ],
- "request-id": "{ \"get_input\" : \"request-id\" }",
- "resource-id": "{ \"get_input\" : \"vnf-id\" }"
- },
- "outputs": {
- "resource-assignment-params": "",
- "status": ""
- }
- }
- }
- }
- },
- "capabilities": {
- "component-node": {
-
- }
- }
- }
- }
- },
- "node_types": {
- "dg-resource-assignment": {
- "description": "This is Resource Assignment Directed Graph",
- "version": "1.0.0",
- "properties": {
- "mode": {
- "required": false,
- "type": "string",
- "default": "sync"
- },
- "version": {
- "required": false,
- "type": "string",
- "default": "LATEST"
- },
- "is-start-flow": {
- "required": false,
- "type": "boolean",
- "default": "false"
- }
- },
- "capabilities": {
- "dg-node": {
- "type": "tosca.capabilities.Node"
- },
- "content": {
- "type": "tosca.capabilities.Content",
- "properties": {
- "type": {
- "required": false,
- "type": "string",
- "default": "json"
- },
- "content": {
- "required": true,
- "type": "string"
- }
- }
- }
- },
- "requirements": {
- "component-dependency": {
- "capability": "component-node",
- "node": "component-resource-assignment",
- "relationship": "tosca.relationships.DependsOn"
- }
- },
- "interfaces": {
- "CONFIG": {
- "operations": {
- "ResourceAssignment": {
- "inputs": {
- "params": {
- "required": false,
- "type": "list",
- "entry_schema": {
- "type": "datatype-property"
- }
- }
- }
- }
- }
- }
- },
- "derived_from": "tosca.nodes.DG"
- },
- "component-resource-assignment": {
- "description": "This is Resource Assignment Component API",
- "version": "1.0.0",
- "capabilities": {
- "component-node": {
- "type": "tosca.capabilities.Node"
- }
- },
- "interfaces": {
- "org-onap-ccsdk-features-assignment-service-ConfigAssignmentNode": {
- "operations": {
- "process": {
- "inputs": {
- "action-name": {
- "description": "Action Name to get from Database, Either (message & mask-info ) or ( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",
- "required": false,
- "type": "string"
- },
- "handler-name": {
- "description": "Name of the Artifact Node Template, to get the template Content. If template-content is present, then content wont be reterived from the Artifact Node Template.",
- "required": true,
- "type": "string"
- },
- "resource-type": {
- "required": false,
- "type": "string"
- },
- "service-template-name": {
- "required": true,
- "type": "string"
- },
- "service-template-version": {
- "required": true,
- "type": "string"
- },
- "template-names": {
- "description": "Name of the Artifact Node Templates, to get the template Content.",
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "request-id": {
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",
- "required": true,
- "type": "string"
- },
- "resource-id": {
- "description": "Id used to pull the data content from the data base. Either template-data or resource-id should be present",
- "required": true,
- "type": "string"
- }
- },
- "outputs": {
- "resource-assignment-params": {
- "required": true,
- "type": "string"
- },
- "status": {
- "required": true,
- "type": "string"
- }
- }
- }
- }
- }
- },
- "derived_from": "tosca.nodes.Component"
- },
- "artifact-config-template": {
- "description": "This is Configuration Velocity Template",
- "version": "1.0.0",
- "properties": {
- "action-names": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "content": {
- "required": false,
- "type": "string"
- },
- "mapping": {
- "required": false,
- "type": "list",
- "entry_schema": {
- "type": "datatype-resource-assignment"
- }
- }
- },
- "capabilities": {
- "content": {
- "type": "tosca.capabilities.Content",
- "properties": {
- "content": {
- "required": true,
- "type": "string"
- }
- }
- },
- "mapping": {
- "type": "tosca.capabilities.Mapping",
- "properties": {
- "mapping": {
- "required": false,
- "type": "list",
- "entry_schema": {
- "type": "datatype-resource-assignment"
- }
- }
- }
- }
- },
- "derived_from": "tosca.nodes.Artifact"
- }
- },
- "data_types": {
- "datatype-resource-assignment": {
- "version": "1.0.0",
- "description": "This is Resource Assignment Data Type",
- "properties": {
- "property": {
- "required": true,
- "type": "datatype-property"
- },
- "input-param": {
- "required": true,
- "type": "boolean"
- },
- "dictionary-name": {
- "required": false,
- "type": "string"
- },
- "dictionary-source": {
- "required": false,
- "type": "string"
- },
- "dependencies": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- }
- },
- "derived_from": "tosca.datatypes.Root"
- },
- "datatype-property": {
- "version": "1.0.0",
- "description": "This is Entry point Input Data Type, which is dynamic datatype, The parameter names will be populated during the Design time for each inputs",
- "properties": {
- "type": {
- "required": true,
- "type": "string"
- },
- "description": {
- "required": false,
- "type": "string"
- },
- "required": {
- "required": false,
- "type": "boolean"
- },
- "default": {
- "required": false,
- "type": "string"
- },
- "entry_schema": {
- "required": false,
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Root"
- }
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/resource_assignment/velocity/base-config-template.vtl b/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/resource_assignment/velocity/base-config-template.vtl deleted file mode 100644 index 92dba1024..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/resource_assignment/velocity/base-config-template.vtl +++ /dev/null @@ -1,40 +0,0 @@ - <config>
- <configuration>
- <groups>
- <name>${group-name}</name>
- <routing-instances>
- <instance>
- <name><*></name>
- <protocols>
- <pim>
- <dense-groups>
- <dynamic-reject />
- <pim-dense-group-type>
- <name>224.0.1.40/32</name>
- </pim-dense-group-type>
- <pim-dense-group-type>
- <name>224.0.1.39/32</name>
- </pim-dense-group-type>
- <pim-dense-group-type>
- <name>224.0.0.0/4</name>
- <reject />
- </pim-dense-group-type>
- </dense-groups>
- <rp>
- <auto-rp>
- <discovery />
- </auto-rp>
- </rp>
- <interface>
- <name><*></name>
- <disable />
- <priority>1000</priority>
- </interface>
- <reset-tracking-bit />
- </pim>
- </protocols>
- </instance>
- </routing-instances>
- </groups>
- </configuration>
- </config>
\ No newline at end of file diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/vpe-201802-baseconfig/dict.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/vpe-201802-baseconfig/dict.json deleted file mode 100644 index f7b09d5af..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/vpe-201802-baseconfig/dict.json +++ /dev/null @@ -1,172 +0,0 @@ -[
- {
- "name": "adiod-unicast-route-reflectors",
- "resourcePath": "vnf/protocol/adiod-unicast-route-reflectors",
- "resourceType": "ATT",
- "dataType": "list",
- "entrySchema": "dt-adiod-unicast-route-reflectors",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"adiod-unicast-route-reflectors\",\r\n \"description\" : \"dd\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/protocol/adiod-unicast-route-reflectors\",\r\n \"data-type\" : \"list\",\r\n \"entry-schema\" : \"dt-adiod-unicast-route-reflectors\",\r\n \"source\" : {\r\n \"input\" : { },\r\n \"network-resource-discovery\" : {\r\n \"input-key-mapping\" : {\r\n \"complex-code-char8\" : \"complex-code-char8\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"adiod-unicast-route-reflectors\" : \"adiod-unicast-route-reflectors\"\r\n }\r\n }\r\n },\r\n \"candidate-dependency\" : {\r\n \"network-resource-discovery\" : {\r\n \"names\" : [ \"complex-code-char8\" ]\r\n }\r\n }\r\n}",
- "description": "dd",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T17:31:38.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "adiod-vpnv4-route-reflectors",
- "resourcePath": "vnf/servers/adiod-vpnv4-route-reflectors",
- "resourceType": "ATT",
- "dataType": "list",
- "entrySchema": "dt-adiod-vpnv4-route-reflectors",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"adiod-vpnv4-route-reflectors\",\r\n \"description\" : \"To be provided\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/servers/adiod-vpnv4-route-reflectors\",\r\n \"data-type\" : \"list\",\r\n \"entry-schema\" : \"dt-adiod-vpnv4-route-reflectors\",\r\n \"source\" : {\r\n \"input\" : { }\r\n }\r\n}",
- "description": "To be provided",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T17:31:38.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "asn-region",
- "resourcePath": "vnf/protocols/asn-region",
- "resourceType": "ATT",
- "dataType": "string",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"asn-region\",\r\n \"description\" : \"To be provided\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/protocols/asn-region\",\r\n \"data-type\" : \"string\",\r\n \"source\" : {\r\n \"input\" : { },\r\n \"network-resource-discovery\" : {\r\n \"input-key-mapping\" : {\r\n \"hostname\" : \"hostname\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"asn-region\" : \"asn-region\"\r\n }\r\n }\r\n },\r\n \"candidate-dependency\" : {\r\n \"network-resource-discovery\" : {\r\n \"names\" : [ \"hostname\" ]\r\n }\r\n }\r\n}",
- "description": "To be provided",
- "tags": "ADIOD3",
- "creationDate": "2017-11-17T11:31:29.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "bundle-id",
- "resourcePath": "vnf/interface/bundle-id",
- "resourceType": "ATT",
- "dataType": "string",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"bundle-id\",\r\n \"description\" : \"To be provided\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/interface/bundle-id\",\r\n \"data-type\" : \"string\",\r\n \"source\" : {\r\n \"input\" : { },\r\n \"network-resource-discovery\" : {\r\n \"input-key-mapping\" : {\r\n \"hostname\" : \"hostname\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"bundle-id\" : \"bundle-id\"\r\n }\r\n }\r\n },\r\n \"candidate-dependency\" : {\r\n \"network-resource-discovery\" : {\r\n \"names\" : [ \"hostname\" ]\r\n }\r\n }\r\n}",
- "description": "To be provided",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T17:31:39.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "lo0-local-ipv4-address",
- "resourcePath": "vnf/interface/lo0-local-ipv4",
- "resourceType": "ATT",
- "dataType": "ipv4-address",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"lo0-local-ipv4-address\",\r\n \"description\" : \"To be provided\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/interface/lo0-local-ipv4\",\r\n \"data-type\" : \"string\",\r\n \"source\" : {\r\n \"input\" : { },\r\n \"network-resource-discovery\" : {\r\n \"input-key-mapping\" : {\r\n \"hostname\" : \"hostname\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"lo0-local-ipv4\" : \"lo0-local-ipv4\"\r\n }\r\n }\r\n },\r\n \"candidate-dependency\" : {\r\n \"network-resource-discovery\" : {\r\n \"names\" : [ \"hostname\" ]\r\n }\r\n }\r\n}",
- "description": "To be provided",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T17:31:40.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "lo10-local-ipv4-address",
- "resourcePath": "vnf/interface/lo10-local-ipv4",
- "resourceType": "ATT",
- "dataType": "ipv4-address",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"lo10-local-ipv4-address\",\r\n \"description\" : \"To be provided\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/interface/lo10-local-ipv4\",\r\n \"data-type\" : \"string\",\r\n \"source\" : {\r\n \"input\" : { },\r\n \"network-resource-discovery\" : {\r\n \"input-key-mapping\" : {\r\n \"hostname\" : \"hostname\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"lo10-local-ipv4\" : \"lo10-local-ipv4\"\r\n }\r\n }\r\n },\r\n \"candidate-dependency\" : {\r\n \"network-resource-discovery\" : {\r\n \"names\" : [ \"hostname\" ]\r\n }\r\n }\r\n}",
- "description": "To be provided",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T17:31:41.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "oam-remote-ipv4-address",
- "resourcePath": "vnf/oam-remote-ipv4-address",
- "resourceType": "ATT",
- "dataType": "string",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"oam-remote-ipv4-address\",\r\n \"description\" : \"To be provided\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/oam-remote-ipv4-address\",\r\n \"data-type\" : \"string\",\r\n \"source\" : {\r\n \"input\" : {\r\n \"key\" : \"oam-remote-ipv4-address\"\r\n },\r\n \"mdsal\" : {\r\n \"base\" : \"sdnc-gc\",\r\n \"type\" : \"JSON\",\r\n \"url-path\" : \"/restconf/config/L3VNF-API\",\r\n \"path\" : \"/${services/service-list/$service-instance-id/service-data/vnf-topology-information/vnf-assignments/vnf-vms/$oam-ipv4-ip-type/vm-networks/$oam-network-role/v4-assigned-ip-list/$oam-vm-type\",\r\n \"input-key-mapping\" : {\r\n \"service-instance-id\" : \"service-instance-id\",\r\n \"oam-network-role\" : \"oam-network-role\",\r\n \"oam-ipv4-ip-type\" : \"oam-ipv4-ip-type\",\r\n \"oam-vm-type\" : \"oam-vm-type\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"oam-remote-ipv4-address\" : \"ipv4-gateway-prefix\"\r\n }\r\n }\r\n },\r\n \"candidate-dependency\" : {\r\n \"mdsal\" : {\r\n \"names\" : [ \"service-instance-id\", \"oam-network-role\", \"oam-v4-ip-type \", \"oam-vm-type\" ]\r\n }\r\n }\r\n}",
- "description": "To be provided",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T10:52:24.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "ospf-area",
- "resourcePath": "/ospf-area",
- "resourceType": "ATT",
- "dataType": "string",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"ospf-area\",\r\n \"description\" : \"ospf-area\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"/ospf-area\",\r\n \"data-type\" : \"string\",\r\n \"source\" : {\r\n \"input\" : {\r\n \"key\" : \"ospf-area\"\r\n },\r\n \"network-resource-discovery\" : {\r\n \"input-key-mapping\" : {\r\n \"hostname\" : \"mainResource\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"ospf-area\" : \"ospf-area\"\r\n }\r\n }\r\n }\r\n}",
- "description": "ospf-area",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T10:52:24.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "ospf-cost",
- "resourcePath": "/ospf-cost",
- "resourceType": "ATT",
- "dataType": "string",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"ospf-cost\",\r\n \"description\" : \"ospf-cost\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"/ospf-cost\",\r\n \"data-type\" : \"string\",\r\n \"source\" : {\r\n \"input\" : {\r\n \"key\" : \"ospf-cost\"\r\n },\r\n \"network-resource-discovery\" : {\r\n \"input-key-mapping\" : {\r\n \"hostname\" : \"mainResource\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"ospf-cost\" : \"ospf-cost\"\r\n }\r\n }\r\n }\r\n}",
- "description": "ospf-cost",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T10:52:25.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "si-local-ipv4-address",
- "resourcePath": "vnf/interface/si-local-ipv4",
- "resourceType": "ATT",
- "dataType": "string",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"si-local-ipv4-address\",\r\n \"description\" : \"To be provided\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/interface/si-local-ipv4\",\r\n \"data-type\" : \"string\",\r\n \"source\" : {\r\n \"input\" : { },\r\n \"network-resource-discovery\" : {\r\n \"input-key-mapping\" : {\r\n \"hostname\" : \"hostname\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"si-local-ipv4\" : \"si-local-ipv4\"\r\n }\r\n }\r\n },\r\n \"candidate-dependency\" : {\r\n \"network-resource-discovery\" : {\r\n \"names\" : [ \"hostname\" ]\r\n }\r\n }\r\n}",
- "description": "To be provided",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T10:52:25.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "tacacs-server-ipv4-addresses",
- "resourcePath": "vnf/servers/tacacs-server-ipv4-addresses",
- "resourceType": "ATT",
- "dataType": "list",
- "entrySchema": "dt-tacacs-server-ipv4-addresses",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"tacacs-server-ipv4-addresses\",\r\n \"description\" : \"to be provided\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/servers/tacacs-server-ipv4-addresses\",\r\n \"data-type\" : \"list\",\r\n \"entry-schema\" : \"dt-tacacs-server-ipv4-addresses\",\r\n \"source\" : {\r\n \"input\" : { },\r\n \"network-resource-discovery\" : {\r\n \"input-key-mapping\" : {\r\n \"region\" : \"region\",\r\n \"complex-code-char8\" : \"complex-code-char8\",\r\n \"tacacs-domain-name\" : \"tacacs-domain-name\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"tacacs-server-ipv4-addresses\" : \"tacacs-server-ipv4-addresses\"\r\n }\r\n }\r\n },\r\n \"candidate-dependency\" : {\r\n \"network-resource-discovery\" : {\r\n \"names\" : [ \"region\", \"complex-code-char8\", \"tacacs-domain-name\" ]\r\n }\r\n }\r\n}",
- "description": "to be provided",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T17:31:43.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "uplink-1-unit",
- "resourcePath": "vnf/interface/uplink-1-unit",
- "resourceType": "ATT",
- "dataType": "string",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"uplink-1-unit\",\r\n \"description\" : \"To be provided\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/interface/uplink-1-unit\",\r\n \"data-type\" : \"string\",\r\n \"source\" : {\r\n \"input\" : { },\r\n \"network-resource-discovery\" : {\r\n \"input-key-mapping\" : {\r\n \"hostname\" : \"hostname\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"uplink-1-unit\" : \"uplink-1-unit\"\r\n }\r\n }\r\n },\r\n \"candidate-dependency\" : {\r\n \"network-resource-discovery\" : {\r\n \"names\" : [ \"hostname\" ]\r\n }\r\n }\r\n}",
- "description": "To be provided",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T17:31:44.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "uplink-2-unit",
- "resourcePath": "vnf/interface/uplink-2-unit",
- "resourceType": "ATT",
- "dataType": "string",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"uplink-2-unit\",\r\n \"description\" : \"To be provided\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/interface/uplink-2-unit\",\r\n \"data-type\" : \"string\",\r\n \"source\" : {\r\n \"input\" : { },\r\n \"network-resource-discovery\" : {\r\n \"input-key-mapping\" : {\r\n \"hostname\" : \"hostname\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"uplink-2-unit\" : \"uplink-2-unit\"\r\n }\r\n }\r\n },\r\n \"candidate-dependency\" : {\r\n \"network-resource-discovery\" : {\r\n \"names\" : [ \"hostname\" ]\r\n }\r\n }\r\n}",
- "description": "To be provided",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T17:31:45.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "wan-aggregate-ipv4-addresses",
- "resourcePath": "vnf/wan-aggregate-ipv4-addresses",
- "resourceType": "ATT",
- "dataType": "list",
- "entrySchema": "dt-v4-aggregate",
- "definition": "{\r\n \"tags\" : \"wan-aggregate-ipv4-addresses, tosca.datatypes.Root, data_type, ks220y@att.com\",\r\n \"name\" : \"wan-aggregate-ipv4-addresses\",\r\n \"description\" : \"To be provided\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/wan-aggregate-ipv4-addresses\",\r\n \"data-type\" : \"list\",\r\n \"entry-schema\" : \"dt-v4-aggregate\",\r\n \"source\" : {\r\n \"input\" : { },\r\n \"mdsal\" : {\r\n \"base\" : \"sdnc-gc\",\r\n \"type\" : \"JSON\",\r\n \"url-path\" : \"/restconf/config/L3VNF-API\",\r\n \"path\" : \"/${services/service-list/$service-instance-id/service-data/vnf-topology-information/vnf-assignments/vnf-vms/$oam-ipv4-ip-type/vm-networks/$oam-network-role/v4-assigned-ip-list/$oam-vm-type\",\r\n \"input-key-mapping\" : {\r\n \"service-instance-id\" : \"service-instance-id\",\r\n \"oam-network-role\" : \"oam-network-role\",\r\n \"oam-ipv4-ip-type\" : \"oam-ipv4-ip-type\",\r\n \"oam-vm-type\" : \"oam-vm-type\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"wan-aggregate-ipv4-addresses\" : \"v4-ip-prefix-length\"\r\n }\r\n }\r\n },\r\n \"candidate-dependency\" : {\r\n \"mdsal\" : {\r\n \"names\" : [ \"service-instance-id\", \"oam-network-role\", \"oam-v4-ip-type \", \"oam-vm-type\" ]\r\n }\r\n }\r\n}",
- "description": "To be provided",
- "tags": "wan-aggregate-ipv4-addresses, tosca.datatypes.Root, data_type, ks220y@att.com",
- "creationDate": "2017-11-16T17:31:45.000+0000",
- "updatedBy": "ks220y@att.com"
- },
- {
- "name": "wan-aggregate-ipv6-addresses",
- "resourcePath": "vnf/wan-aggregate-ipv6-addresses",
- "resourceType": "ATT",
- "dataType": "list",
- "entrySchema": "dt-v6-aggregate",
- "definition": "{\r\n \"tags\" : \"ADIOD3\",\r\n \"name\" : \"wan-aggregate-ipv6-addresses\",\r\n \"description\" : \"To be provided\",\r\n \"updated-by\" : \"ks220y@att.com\",\r\n \"resource-type\" : \"ATT\",\r\n \"resource-path\" : \"vnf/wan-aggregate-ipv6-addresses\",\r\n \"data-type\" : \"list\",\r\n \"entry-schema\" : \"dt-v6-aggregate\",\r\n \"source\" : {\r\n \"input\" : { },\r\n \"mdsal\" : {\r\n \"base\" : \"sdnc-gc\",\r\n \"type\" : \"JSON\",\r\n \"url-path\" : \"/restconf/config/L3VNF-API\",\r\n \"path\" : \"/${services/service-list/$service-instance-id/service-data/vnf-topology-information/vnf-assignments/vnf-vms/VCO\",\r\n \"input-key-mapping\" : {\r\n \"service-instance-id\" : \"service-instance-id\",\r\n \"oam-network-role\" : \"oam-network-role\",\r\n \"oam-ipv4-ip-type\" : \"oam-ipv4-ip-type\",\r\n \"oam-vm-type\" : \"oam-vm-type\"\r\n },\r\n \"output-key-mapping\" : {\r\n \"wan-aggregate-ipv6.addresses\" : \"v4-ip-prefix-length\"\r\n }\r\n }\r\n },\r\n \"candidate-dependency\" : {\r\n \"mdsal\" : {\r\n \"names\" : [ \"service-instance-id\", \"oam-network-role\", \"oam-v4-ip-type \", \"oam-vm-type\" ]\r\n }\r\n }\r\n}",
- "description": "To be provided",
- "tags": "ADIOD3",
- "creationDate": "2017-11-16T17:31:46.000+0000",
- "updatedBy": "ks220y@att.com"
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/vpe-201802-baseconfig/input-complex.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/vpe-201802-baseconfig/input-complex.json deleted file mode 100644 index 70865015c..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/vpe-201802-baseconfig/input-complex.json +++ /dev/null @@ -1,49 +0,0 @@ -{
- "request-id": "1234",
- "service-instance-id": "adsfdsf",
- "action-name": "resource-assignment-action",
- "scope-type": "vnf-type",
- "hostname": "sample-host",
- "resource-assignment-request": {
- "uplink-2-unit": "sample-uplink-2-unit",
- "bundle-mac": "sample-bundle-mac",
- "wan-aggregate-ipv6-addresses": [
- {
- "v6-address": "sample-v6-address",
- "v6-plen": "sample-v6-plen"
- }
- ],
- "ospf-area": "sample-ospf-area",
- "ospf-cost": 10.0,
- "bundle-id": "bundle-id",
- "adiod-unicast-route-reflectors": [
- {
- "v4-address": "sample-v4-address",
- "name": "sample-name"
- }
- ],
- "oam-remote-ipv4-address": "",
- "adiod-vpnv4-route-reflectors": [
- {
- "v4-address": "sample-v4-address",
- "name": "sample-name"
- }
- ],
- "lo10-local-ipv4-address": "sample-lo10-local-ipv4-address",
- "wan-aggregate-ipv4-addresses": [
- {
- "v4-address": "sample-v4-address",
- "v4-plen": 0
- }
- ],
- "lo0-local-ipv4-address": "sample-lo0-local-ipv4-address",
- "uplink-1-unit": "sample-uplink-1-unit",
- "tacacs-server-ipv4-addresses": [
- {
- "tacacs-server-ipv4-address": "sample-tacacs-server-ipv4-address"
- }
- ],
- "asn-region": "sample-asn-region",
- "si-local-ipv4-address": "sample-si-local-ipv4-address"
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/vpe-201802-baseconfig/velocity/base-config-template.vtl b/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/vpe-201802-baseconfig/velocity/base-config-template.vtl deleted file mode 100644 index 92dba1024..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/vpe-201802-baseconfig/velocity/base-config-template.vtl +++ /dev/null @@ -1,40 +0,0 @@ - <config>
- <configuration>
- <groups>
- <name>${group-name}</name>
- <routing-instances>
- <instance>
- <name><*></name>
- <protocols>
- <pim>
- <dense-groups>
- <dynamic-reject />
- <pim-dense-group-type>
- <name>224.0.1.40/32</name>
- </pim-dense-group-type>
- <pim-dense-group-type>
- <name>224.0.1.39/32</name>
- </pim-dense-group-type>
- <pim-dense-group-type>
- <name>224.0.0.0/4</name>
- <reject />
- </pim-dense-group-type>
- </dense-groups>
- <rp>
- <auto-rp>
- <discovery />
- </auto-rp>
- </rp>
- <interface>
- <name><*></name>
- <disable />
- <priority>1000</priority>
- </interface>
- <reset-tracking-bit />
- </pim>
- </protocols>
- </instance>
- </routing-instances>
- </groups>
- </configuration>
- </config>
\ No newline at end of file diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/vpe-201802-baseconfig/vpe-201802-baseconfig.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/vpe-201802-baseconfig/vpe-201802-baseconfig.json deleted file mode 100644 index 7113b70c2..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/service_templates/vpe-201802-baseconfig/vpe-201802-baseconfig.json +++ /dev/null @@ -1,639 +0,0 @@ -{
- "metadata": {
- "author": "ks220y@att.com",
- "service-template-name": "vpe-201802-baseconfig",
- "service-template-version": "1.0.0",
- "release": "1802",
- "service-type": "ADIOD",
- "vnf-type": "VPE"
- },
- "topology_template": {
- "inputs": {
- "request-id": {
- "required": true,
- "type": "string"
- },
- "service-instance-id": {
- "required": true,
- "type": "string"
- },
- "action-name": {
- "required": true,
- "type": "string"
- },
- "scope-type": {
- "required": true,
- "type": "string"
- },
- "hostname": {
- "required": true,
- "type": "string"
- },
- "resource-assignment-request": {
- "description": "This is Dynamic Data type for the receipe resource-assignment-action.",
- "required": false,
- "type": "dt-resource-assignment-request"
- }
- },
- "node_templates": {
- "base-config-template": {
- "type": "artifact-config-template",
- "properties": {
- "action-names": [
- "resource-assignment-action"
- ]
- },
- "capabilities": {
- "content": {
- "properties": {
- "content": "db://base-config-template"
- }
- },
- "mapping": {
- "properties": {
- "mapping": [
- {
- "name": "wan-aggregate-ipv6-addresses",
- "input-param": true,
- "property": {
- "type": "list",
- "entry_schema": {
- "type": "dt-v6-aggregate"
- }
- },
- "dictionary-name": "wan-aggregate-ipv6-addresses",
- "dictionary-source": "input"
- },
- {
- "name": "wan-aggregate-ipv4-addresses",
- "input-param": true,
- "property": {
- "type": "list",
- "entry_schema": {
- "type": "dt-v4-aggregate"
- }
- },
- "dictionary-name": "wan-aggregate-ipv4-addresses",
- "dictionary-source": "input"
- },
- {
- "name": "tacacs-server-ipv4-addresses",
- "input-param": true,
- "property": {
- "type": "list",
- "entry_schema": {
- "type": "dt-tacacs-server-ipv4"
- }
- },
- "dictionary-name": "tacacs-server-ipv4-addresses",
- "dictionary-source": "input"
- },
- {
- "name": "oam-remote-ipv4-address",
- "property": {
- "type": "string"
- },
- "dictionary-name": "oam-remote-ipv4-address",
- "dictionary-source": "input"
- },
- {
- "name": "si-local-ipv4-address",
- "property": {
- "type": "string"
- },
- "dictionary-name": "si-local-ipv4-address",
- "dictionary-source": "input"
- },
- {
- "name": "lo0-local-ipv4-address",
- "property": {
- "type": "string"
- },
- "dictionary-name": "lo0-local-ipv4-address",
- "dictionary-source": "input"
- },
- {
- "name": "asn-region",
- "property": {
- "type": "string"
- },
- "dictionary-name": "asn-region",
- "dictionary-source": "input"
- },
- {
- "name": "adiod-unicast-route-reflectors",
- "input-param": true,
- "property": {
- "type": "list",
- "entry_schema": {
- "type": "dt-adiod-unicast-route-reflector"
- }
- },
- "dictionary-name": "adiod-unicast-route-reflectors",
- "dictionary-source": "input"
- },
- {
- "name": "adiod-vpnv4-route-reflectors",
- "input-param": true,
- "property": {
- "type": "list",
- "entry_schema": {
- "type": "dt-adiod-vpnv4-route-reflector"
- }
- },
- "dictionary-name": "adiod-vpnv4-route-reflectors",
- "dictionary-source": "input"
- },
- {
- "name": "bundle-id",
- "property": {
- "type": "string"
- },
- "dictionary-name": "bundle-id",
- "dictionary-source": "input"
- },
- {
- "name": "uplink-1-unit",
- "property": {
- "type": "string"
- },
- "dictionary-name": "uplink-1-unit",
- "dictionary-source": "input"
- },
- {
- "name": "uplink-2-unit",
- "property": {
- "type": "string"
- },
- "dictionary-name": "uplink-2-unit",
- "dictionary-source": "input"
- },
- {
- "name": "ospf-area",
- "property": {
- "type": "string"
- },
- "dictionary-name": "ospf-area",
- "dictionary-source": "input"
- },
- {
- "name": "ospf-cost",
- "property": {
- "type": "string"
- },
- "dictionary-name": "ospf-cost",
- "dictionary-source": "input"
- },
- {
- "name": "lo10-local-ipv4-address",
- "property": {
- "type": "string"
- },
- "dictionary-name": "lo10-local-ipv4-address",
- "dictionary-source": "input"
- }
- ]
- }
- }
- }
- },
- "resource-assignment-action": {
- "type": "dg-resource-assignment",
- "interfaces": {
- "CONFIG": {
- "operations": {
- "ResourceAssignment": {
-
- }
- }
- }
- },
- "capabilities": {
- "dg-node": {
-
- }
- },
- "requirements": {
- "component-dependency": {
- "capability": "component-node",
- "node": "resource-assignment",
- "relationship": "tosca.relationships.DependsOn"
- }
- }
- },
- "resource-assignment": {
- "type": "component-resource-assignment",
- "interfaces": {
- "org-onap-ccsdk-features-assignment-service-ConfigAssignmentNode": {
- "operations": {
- "process": {
- "inputs": {
- "action-name": "{ \"get_input\" : \"action-name\" }",
- "resource-type": "vnf-type",
- "template-names": [
- "base-config-template",
- "licence-template"
- ],
- "request-id": "{ \"get_input\" : \"request-id\" }",
- "resource-id": "{ \"get_input\" : \"hostname\" }"
- },
- "outputs": {
- "resource-assignment-params": "",
- "status": ""
- }
- }
- }
- }
- },
- "capabilities": {
- "component-node": {
-
- }
- }
- }
- }
- },
- "node_types": {
- "dg-resource-assignment": {
- "description": "This is Resource Assignment Directed Graph",
- "version": "1.0.0",
- "properties": {
- "mode": {
- "required": false,
- "type": "string",
- "default": "sync"
- },
- "version": {
- "required": false,
- "type": "string",
- "default": "LATEST"
- },
- "is-start-flow": {
- "required": false,
- "type": "boolean",
- "default": "false"
- }
- },
- "capabilities": {
- "dg-node": {
- "type": "tosca.capabilities.Node"
- },
- "content": {
- "type": "tosca.capabilities.Content",
- "properties": {
- "type": {
- "required": false,
- "type": "string",
- "default": "json"
- },
- "content": {
- "required": true,
- "type": "string"
- }
- }
- }
- },
- "requirements": {
- "component-dependency": {
- "capability": "component-node",
- "node": "component-resource-assignment",
- "relationship": "tosca.relationships.DependsOn"
- }
- },
- "interfaces": {
- "CONFIG": {
- "operations": {
- "ResourceAssignment": {
- "inputs": {
- "params": {
- "required": false,
- "type": "list",
- "entry_schema": {
- "type": "datatype-property"
- }
- }
- }
- }
- }
- }
- },
- "derived_from": "tosca.nodes.DG"
- },
- "component-resource-assignment": {
- "description": "This is Resource Assignment Component API",
- "version": "1.0.0",
- "capabilities": {
- "component-node": {
- "type": "tosca.capabilities.Node"
- }
- },
- "interfaces": {
- "org-onap-ccsdk-features-assignment-service-ConfigAssignmentNode": {
- "operations": {
- "process": {
- "inputs": {
- "action-name": {
- "description": "Action Name to get from Database, Either (message & mask-info ) or ( resource-id & resource-type & action-name & template-name ) should be present. Message will be given higest priority",
- "required": false,
- "type": "string"
- },
- "handler-name": {
- "description": "Name of the Artifact Node Template, to get the template Content. If template-content is present, then content wont be reterived from the Artifact Node Template.",
- "required": true,
- "type": "string"
- },
- "resource-type": {
- "required": false,
- "type": "string"
- },
- "template-names": {
- "description": "Name of the Artifact Node Templates, to get the template Content.",
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "request-id": {
- "description": "Request Id used to store the generated configuration, in the database along with the template-name",
- "required": true,
- "type": "string"
- },
- "resource-id": {
- "description": "Id used to pull the data content from the data base. Either template-data or resource-id should be present",
- "required": true,
- "type": "string"
- }
- },
- "outputs": {
- "resource-assignment-params": {
- "required": true,
- "type": "string"
- },
- "status": {
- "required": true,
- "type": "string"
- }
- }
- }
- }
- }
- },
- "derived_from": "tosca.nodes.Component"
- },
- "artifact-config-template": {
- "description": "This is Configuration Velocity Template",
- "version": "1.0.0",
- "properties": {
- "action-names": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- }
- },
- "capabilities": {
- "content": {
- "type": "tosca.capabilities.Content",
- "properties": {
- "content": {
- "required": true,
- "type": "string"
- }
- }
- },
- "mapping": {
- "type": "tosca.capabilities.Mapping",
- "properties": {
- "mapping": {
- "required": false,
- "type": "list",
- "entry_schema": {
- "type": "datatype-resource-assignment"
- }
- }
- }
- }
- },
- "derived_from": "tosca.nodes.Artifact"
- }
- },
- "data_types": {
- "dt-v4-aggregate": {
- "version": "1.0.0",
- "description": "This is dt-v4-aggregate Data Type",
- "properties": {
- "v4-address": {
- "required": true,
- "type": "string"
- },
- "v4-plen": {
- "required": false,
- "type": "integer"
- }
- },
- "derived_from": "tosca.datatypes.Root"
- },
- "dt-tacacs-server-ipv4": {
- "version": "1.0.0",
- "description": "This is dt-tacacs-server-ipv4 Data Type",
- "properties": {
- "tacacs-server-ipv4-address": {
- "required": true,
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Root"
- },
- "dt-adiod-vpnv4-route-reflector": {
- "version": "1.0.0",
- "description": "This is dt-adiod-unicast-route-reflector Data Type",
- "properties": {
- "v4-address": {
- "required": true,
- "type": "string"
- },
- "name": {
- "required": false,
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Root"
- },
- "datatype-resource-assignment": {
- "version": "1.0.0",
- "description": "This is Resource Assignment Data Type",
- "properties": {
- "property": {
- "required": true,
- "type": "datatype-property"
- },
- "input-param": {
- "required": true,
- "type": "boolean"
- },
- "dictionary-name": {
- "required": false,
- "type": "string"
- },
- "dictionary-source": {
- "required": false,
- "type": "string"
- },
- "dependencies": {
- "required": true,
- "type": "list",
- "entry_schema": {
- "type": "string"
- }
- },
- "status": {
- "required": false,
- "type": "string"
- },
- "message": {
- "required": false,
- "type": "string"
- },
- "updated-date": {
- "required": false,
- "type": "string"
- },
- "updated-by": {
- "required": false,
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Root"
- },
- "dt-adiod-unicast-route-reflector": {
- "version": "1.0.0",
- "description": "This is dt-adiod-unicast-route-reflector Data Type",
- "properties": {
- "v4-address": {
- "required": true,
- "type": "string"
- },
- "name": {
- "required": false,
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Root"
- },
- "datatype-property": {
- "version": "1.0.0",
- "description": "This is Entry point Input Data Type, which is dynamic datatype, The parameter names will be populated during the Design time for each inputs",
- "properties": {
- "type": {
- "required": true,
- "type": "string"
- },
- "description": {
- "required": false,
- "type": "string"
- },
- "required": {
- "required": false,
- "type": "boolean"
- },
- "default": {
- "required": false,
- "type": "string"
- },
- "entry_schema": {
- "required": false,
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Root"
- },
- "dt-v6-aggregate": {
- "version": "1.0.0",
- "description": "This is dt-v6-aggregate Data Type",
- "properties": {
- "v6-address": {
- "required": true,
- "type": "string"
- },
- "v6-plen": {
- "required": false,
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Root"
- },
- "dt-resource-assignment-request": {
- "version": "1.0.0",
- "description": "This is Dynamic Data type definition generated from resource mapping for the config template name base-config-template.",
- "properties": {
- "uplink-2-unit": {
- "type": "string"
- },
- "bundle-mac": {
- "required": true,
- "type": "string"
- },
- "wan-aggregate-ipv6-addresses": {
- "type": "list",
- "entry_schema": {
- "type": "dt-v6-aggregate"
- }
- },
- "ospf-area": {
- "type": "string"
- },
- "ospf-cost": {
- "type": "string"
- },
- "bundle-id": {
- "type": "string"
- },
- "adiod-unicast-route-reflectors": {
- "type": "list",
- "entry_schema": {
- "type": "dt-adiod-unicast-route-reflector"
- }
- },
- "oam-remote-ipv4-address": {
- "type": "string"
- },
- "adiod-vpnv4-route-reflectors": {
- "type": "list",
- "entry_schema": {
- "type": "dt-adiod-vpnv4-route-reflector"
- }
- },
- "lo10-local-ipv4-address": {
- "type": "string"
- },
- "wan-aggregate-ipv4-addresses": {
- "type": "list",
- "entry_schema": {
- "type": "dt-v4-aggregate"
- }
- },
- "lo0-local-ipv4-address": {
- "type": "string"
- },
- "uplink-1-unit": {
- "type": "string"
- },
- "tacacs-server-ipv4-addresses": {
- "type": "list",
- "entry_schema": {
- "type": "dt-tacacs-server-ipv4"
- }
- },
- "asn-region": {
- "type": "string"
- },
- "si-local-ipv4-address": {
- "type": "string"
- }
- },
- "derived_from": "tosca.datatypes.Dynamic"
- }
- }
-}
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/validation/cyclic.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/validation/cyclic.json deleted file mode 100644 index fc6357f2d..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/validation/cyclic.json +++ /dev/null @@ -1,111 +0,0 @@ -[
- {
- "name": "vnf-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "vnf-id",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "service-instance-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "service-instance-id",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "bundle-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "bundle-id",
- "dictionary-source": "mdsal",
- "dependencies": [
- "vnf-id"
- ]
- },
- {
- "name": "bundle-ip",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "bundle-ip",
- "dictionary-source": "mdsal",
- "dependencies": [
- "vnf-id"
- ]
- },
- {
- "name": "bundle-mac",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "bundle-mac",
- "dictionary-source": "mdsal",
- "dependencies": [
- "vnf-id",
- "bundle-id"
- ]
- },
- {
- "name": "managed-ip",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "managed-ip",
- "dictionary-source": "mdsal",
- "dependencies": [
- "loopback-ip"
- ]
- },
- {
- "name": "vnf-name",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "vnf-name",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "managed-ip1",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "managed-ip1",
- "dictionary-source": "mdsal",
- "dependencies": [
- "loopback-ip"
- ]
- },
- {
- "name": "loopback-ip",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "loopback-ip",
- "dictionary-source": "db",
- "dependencies": [
- "bundle-mac",
- "managed-ip1"
- ]
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/validation/duplicate.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/validation/duplicate.json deleted file mode 100644 index 86909a6a4..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/validation/duplicate.json +++ /dev/null @@ -1,110 +0,0 @@ -[
- {
- "name": "vnf-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "vnf-id",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "service-instance-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "service-instance-id",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "bundle-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "bundle-id",
- "dictionary-source": "mdsal",
- "dependencies": [
- "vnf-id"
- ]
- },
- {
- "name": "bundle-ip",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "bundle-ip",
- "dictionary-source": "mdsal",
- "dependencies": [
- "vnf-id"
- ]
- },
- {
- "name": "bundle-mac",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "bundle-mac",
- "dictionary-source": "mdsal",
- "dependencies": [
- "vnf-id",
- "bundle-id"
- ]
- },
- {
- "name": "bundle-mac",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "bundle-mac",
- "dictionary-source": "mdsal",
- "dependencies": [
- "loopback-ip"
- ]
- },
- {
- "name": "vnf-name",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "vnf-name",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "managed-ip1",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "managed-ip1",
- "dictionary-source": "mdsal",
- "dependencies": [
- "loopback-ip"
- ]
- },
- {
- "name": "loopback-ip",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "loopback-ip",
- "dictionary-source": "db",
- "dependencies": [
- "bundle-mac"
- ]
- }
-]
diff --git a/blueprints-processor/plugin/assignment-provider/src/test/resources/validation/success.json b/blueprints-processor/plugin/assignment-provider/src/test/resources/validation/success.json deleted file mode 100644 index e08539c0d..000000000 --- a/blueprints-processor/plugin/assignment-provider/src/test/resources/validation/success.json +++ /dev/null @@ -1,110 +0,0 @@ -[
- {
- "name": "vnf-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "vnf-id",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "service-instance-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "service-instance-id",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "bundle-id",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "bundle-id",
- "dictionary-source": "mdsal",
- "dependencies": [
- "vnf-id"
- ]
- },
- {
- "name": "bundle-ip",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "bundle-ip",
- "dictionary-source": "mdsal",
- "dependencies": [
- "vnf-id"
- ]
- },
- {
- "name": "bundle-mac",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "bundle-mac",
- "dictionary-source": "mdsal",
- "dependencies": [
- "vnf-id",
- "bundle-id"
- ]
- },
- {
- "name": "managed-ip",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "managed-ip",
- "dictionary-source": "mdsal",
- "dependencies": [
- "loopback-ip"
- ]
- },
- {
- "name": "vnf-name",
- "input-param": true,
- "property": {
- "type": "string",
- "required": true
- },
- "dictionary-name": "vnf-name",
- "dictionary-source": "input",
- "dependencies": []
- },
- {
- "name": "managed-ip1",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "managed-ip1",
- "dictionary-source": "mdsal",
- "dependencies": [
- "loopback-ip"
- ]
- },
- {
- "name": "loopback-ip",
- "input-param": true,
- "property": {
- "type": "string"
- },
- "dictionary-name": "loopback-ip",
- "dictionary-source": "db",
- "dependencies": [
- "bundle-mac"
- ]
- }
-]
|