2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2021 Nordix Foundation.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 * ============LICENSE_END=========================================================
19 package org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar.validation;
21 import static org.openecomp.sdc.tosca.csar.ManifestTokenType.ATTRIBUTE_VALUE_SEPARATOR;
22 import static org.openecomp.sdc.tosca.csar.ToscaMetaEntry.OTHER_DEFINITIONS;
23 import static org.openecomp.sdc.vendorsoftwareproduct.impl.orchestration.csar.validation.TestConstants.TOSCA_DEFINITION_FILEPATH;
25 import org.openecomp.sdc.tosca.csar.ManifestTokenType;
26 import org.openecomp.sdc.vendorsoftwareproduct.security.SecurityManager;
28 public class SOL004Version3MetaDirectoryValidatorTest extends SOL004MetaDirectoryValidatorTest {
30 private static int MANIFEST_DEFINITION_ERROR_COUNT_VERSION_3 = 2;
33 public SOL004MetaDirectoryValidator getSOL004MetaDirectoryValidator() {
34 return new SOL004Version3MetaDirectoryValidator();
38 public StringBuilder getMetaFileBuilder() {
39 return super.getMetaFileBuilder().append(OTHER_DEFINITIONS.getName())
40 .append(ATTRIBUTE_VALUE_SEPARATOR.getToken()).append(" ").append(TOSCA_DEFINITION_FILEPATH).append("\n");
44 protected SOL004MetaDirectoryValidator getSol004WithSecurity(SecurityManager securityManagerMock) {
45 return new SOL004Version3MetaDirectoryValidator(securityManagerMock);
49 protected ManifestBuilder getVnfManifestSampleBuilder() {
50 return super.getVnfManifestSampleBuilder()
51 .withMetaData(ManifestTokenType.VNFD_ID.getToken(), "2116fd24-83f2-416b-bf3c-ca1964793aca")
52 .withMetaData(ManifestTokenType.COMPATIBLE_SPECIFICATION_VERSIONS.getToken(), "2.7.1,3.3.1")
53 .withMetaData(ManifestTokenType.VNF_SOFTWARE_VERSION.getToken(), "1.0.0")
54 .withMetaData(ManifestTokenType.VNFM_INFO.getToken(), "etsivnfm:v2.3.1,0:myGreatVnfm-1");
58 protected ManifestBuilder getPnfManifestSampleBuilder() {
59 return super.getPnfManifestSampleBuilder()
60 .withMetaData(ManifestTokenType.COMPATIBLE_SPECIFICATION_VERSIONS.getToken(), "2.7.1,3.3.1");
64 protected int getManifestDefintionErrorCount() {
65 return MANIFEST_DEFINITION_ERROR_COUNT_VERSION_3;