Age | Commit message (Expand) | Author | Files | Lines |
2022-03-22 | Step version to 1.10.3-SNAPSHOT1.10.3 | ![](//seccdn.libravatar.org/avatar/5212099875553fbd1e3635b9e1a75446?s=13&d=retro) MichaelMorris | 1 | -1/+1 |
2022-03-11 | Support complex types in artifact properties | ![](//seccdn.libravatar.org/avatar/645ac1601f562a4f73979ba334c56fb5?s=13&d=retro) andre.schmid | 3 | -23/+38 |
2022-03-11 | Support complex types in interface operation inputs | ![](//seccdn.libravatar.org/avatar/645ac1601f562a4f73979ba334c56fb5?s=13&d=retro) andre.schmid | 4 | -119/+176 |
2022-03-08 | Rename ControlLoop to AutomationComposition | ![](//seccdn.libravatar.org/avatar/683468ef106402585ce2109f3e04db0a?s=13&d=retro) Sirisha_Manchikanti | 2 | -4/+4 |
2022-03-08 | Support property of type List<Map<String,String>> | ![](//seccdn.libravatar.org/avatar/5212099875553fbd1e3635b9e1a75446?s=13&d=retro) MichaelMorris | 1 | -1/+4 |
2022-02-09 | Step version to 1.10.2-SNAPSHOT | ![](//seccdn.libravatar.org/avatar/5212099875553fbd1e3635b9e1a75446?s=13&d=retro) MichaelMorris | 1 | -1/+1 |
2022-02-02 | Step version to 1.10.1-SNAPSHOT | ![](//seccdn.libravatar.org/avatar/5212099875553fbd1e3635b9e1a75446?s=13&d=retro) MichaelMorris | 1 | -1/+1 |
2022-02-02 | Improve service import support | ![](//seccdn.libravatar.org/avatar/5212099875553fbd1e3635b9e1a75446?s=13&d=retro) MichaelMorris | 2 | .highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long *//*-
* ============LICENSE_START=======================================================
* ONAP Policy API
* ================================================================================
* Copyright (C) 2022-2024 Nordix Foundation. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
package org.onap.policy.api.main.service;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Optional;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.onap.policy.api.main.repository.NodeTemplateRepository;
import org.onap.policy.api.main.repository.NodeTypeRepository;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.coder.YamlJsonTranslator;
import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfModelRuntimeException;
import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaNodeTemplate;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaNodeType;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate;
class TestNodeTemplateService {
@Mock
private NodeTemplateRepository nodeTemplateRepository;
@Mock
private NodeTypeRepository nodeTypeRepository;
@InjectMocks
private NodeTemplateService nodeTemplateService;
private static final String POLICY_WITH_METADATA_SET_REF = "nodetemplates/dummy.apex.decisionmaker.policy.yaml";
private static final String UPDATED_NODE_TEMPLATE_JSON = "nodetemplates/nodetemplates.metadatasets.update.json";
private static ToscaServiceTemplate updatedToscaServiceTemplate;
private final YamlJsonTranslator yamlJsonTranslator = new YamlJsonTranslator();
ToscaServiceTemplate policyServiceTemplate;
AutoCloseable closeable;
/**
* Set up for tests.
*
* @throws CoderException if error in json parsing
*/
@BeforeEach
public void setUp() throws CoderException {
closeable = MockitoAnnotations.openMocks(this);
StandardCoder standardCoder = new StandardCoder();
policyServiceTemplate =
yamlJsonTranslator.fromYaml(ResourceUtils.getResourceAsString(POLICY_WITH_METADATA_SET_REF),
ToscaServiceTemplate.class);
updatedToscaServiceTemplate =
standardCoder.decode(ResourceUtils.getResourceAsString(UPDATED_NODE_TEMPLATE_JSON),
ToscaServiceTemplate.class);
}
@AfterEach
void tearDown() throws Exception {
closeable.close();
}
@Test
void testVerifyNodeType() {
assertThatThrownBy(() -> nodeTemplateService.verifyNodeTypeInDbTemplate(new JpaTos2021-10-05 | Filter categories by model name | ![](//seccdn.libravatar.org/avatar/5e7d01d3bc4c543420c3989b023c5bc2?s=13&d=retro) aribeiro | 4 | -16/+30 |
2021-10-05 | Allow multiple base types for a service | ![](//seccdn.libravatar.org/avatar/aa657667404dd133b65ee28d9c0a6364?s=13&d=retro) vasraz | 4 | -439/+426 |
2021-10-01 | Step version for Jakarta | ![](//seccdn.libravatar.org/avatar/5212099875553fbd1e3635b9e1a75446?s=13&d=retro) MichaelMorris | 1 | -1/+1 |
2021-09-23 | Fix certify VFC with Model | ![](//seccdn.libravatar.org/avatar/5e7d01d3bc4c543420c3989b023c5bc2?s=13&d=retro) aribeiro | 1 | -5/+11 |
2021-09-20 | Error re-importing VSP | ![](//seccdn.libravatar.org/avatar/0968d8c17797f158314a031b09d72470?s=13&d=retro) KrupaNagabhushan | 11 | -32/+318 |
2021-09-20 | Updated SDC version to 1.9.2-SNAPSHOT1.9.2 | ![](//seccdn.libravatar.org/avatar/5212099875553fbd1e3635b9e1a75446?s=13&d=retro) MichaelMorris | 1 | -1/+1 |
2021-09-20 | Fix update VSP missing VSP version id | ![](//seccdn.libravatar.org/avatar/645ac1601f562a4f73979ba334c56fb5?s=13&d=retro) andre.schmid | 4 | -3/+9 |
2021-09-17 | Fix Update VSP when no version id is provided | ![](//seccdn.libravatar.org/avatar/645ac1601f562a4f73979ba334c56fb5?s=13&d=retro) andre.schmid | 3 | -0/+69 |
2021-09-13 | Update SDC version to 1.9.1-SNAPSHOT1.9.1 | ![](//seccdn.libravatar.org/avatar/5212099875553fbd1e3635b9e1a75446?s=13&d=retro) MichaelMorris | 1 | -1/+1 |
2021-09-10 | Fix model init | ![](//seccdn.libravatar.org/avatar/5e7d01d3bc4c543420c3989b023c5bc2?s=13&d=retro) aribeiro | 1 | -1/+2 |
2021-09-06 | Fix data type cache issue for model extensions | ![](//seccdn.libravatar.org/avatar/5212099875553fbd1e3635b9e1a75446?s=13&d=retro) MichaelMorris | 3 | -44/+50 |
2021-09-03 | Fix CSAR generation default imports file conflict | ![](//seccdn.libravatar.org/avatar/645ac1601f562a4f73979ba334c56fb5?s=13&d=retro) andre.schmid | 1 | -0/+7 |
2021-08-31 | Fix additional types import file generation | ![](//seccdn.libravatar.org/avatar/645ac1601f562a4f73979ba334c56fb5?s=13&d=retro) andre.schmid | 11 | -64/+295 |
2021-08-30 | Include custom data types from VSP in csar imports | | |