diff options
author | andre.schmid <andre.schmid@est.tech> | 2021-10-01 18:45:17 +0100 |
---|---|---|
committer | André Schmid <andre.schmid@est.tech> | 2021-10-15 14:26:03 +0000 |
commit | 1b61e72f6506de7c1f64098dd25adf7af7b31dc1 (patch) | |
tree | 53036d7bb556547059f1207ec7c8a42959cd05a7 /catalog-model/src/test/java | |
parent | 08ba15073ff236c67303d084d56a026975ba1a25 (diff) |
Import multiple node types in a single endpoint
Change-Id: I7aa914d459a083146b92ef82197c8df265b8c5b6
Issue-ID: SDC-3752
Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-model/src/test/java')
-rw-r--r-- | catalog-model/src/test/java/org/openecomp/sdc/be/model/mapper/NodeTypeMetadataMapperTest.java | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/mapper/NodeTypeMetadataMapperTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/mapper/NodeTypeMetadataMapperTest.java new file mode 100644 index 0000000000..1121503228 --- /dev/null +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/mapper/NodeTypeMetadataMapperTest.java @@ -0,0 +1,69 @@ +/* + * - + * ============LICENSE_START======================================================= + * Copyright (C) 2021 Nordix Foundation. + * ================================================================================ + * 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.openecomp.sdc.be.model.mapper; + +import static org.junit.jupiter.api.Assertions.*; + +import java.util.List; +import org.junit.jupiter.api.Test; +import org.openecomp.sdc.be.model.NodeTypeMetadata; +import org.openecomp.sdc.be.model.UploadResourceInfo; +import org.openecomp.sdc.be.model.category.CategoryDefinition; + +class NodeTypeMetadataMapperTest { + + @Test + void mapToUploadResourceInfoTest() { + final var nodeTypeMetadata = new NodeTypeMetadata(); + nodeTypeMetadata.setName("name"); + nodeTypeMetadata.setDescription("description"); + nodeTypeMetadata.setContactId("contactId"); + nodeTypeMetadata.setIcon("icon"); + nodeTypeMetadata.setResourceIconPath("resourceIconPath"); + nodeTypeMetadata.setVendorName("vendorName"); + nodeTypeMetadata.setModel("model"); + nodeTypeMetadata.setVendorRelease("vendorRelease"); + nodeTypeMetadata.setResourceVendorModelNumber("resourceVendorModelNumber"); + nodeTypeMetadata.setResourceType("resourceType"); + nodeTypeMetadata.setTags(List.of("tag1", "tag2")); + nodeTypeMetadata.setCategories(List.of(new CategoryDefinition())); + + final UploadResourceInfo uploadResourceInfo = NodeTypeMetadataMapper.mapTo(nodeTypeMetadata); + assertEquals(nodeTypeMetadata.getName(), uploadResourceInfo.getName()); + assertEquals(nodeTypeMetadata.getDescription(), uploadResourceInfo.getDescription()); + assertEquals(nodeTypeMetadata.getContactId(), uploadResourceInfo.getContactId()); + assertEquals(nodeTypeMetadata.getResourceIconPath(), uploadResourceInfo.getResourceIconPath()); + assertEquals(nodeTypeMetadata.getVendorName(), uploadResourceInfo.getVendorName()); + assertEquals(nodeTypeMetadata.getModel(), uploadResourceInfo.getModel()); + assertEquals(nodeTypeMetadata.getVendorRelease(), uploadResourceInfo.getVendorRelease()); + assertEquals(nodeTypeMetadata.getResourceVendorModelNumber(), uploadResourceInfo.getResourceVendorModelNumber()); + assertEquals(nodeTypeMetadata.getResourceType(), uploadResourceInfo.getResourceType()); + assertEquals(nodeTypeMetadata.getTags(), uploadResourceInfo.getTags()); + assertEquals(nodeTypeMetadata.getCategories(), uploadResourceInfo.getCategories()); + + final var nodeTypeMetadata1 = new NodeTypeMetadata(); + nodeTypeMetadata1.setIcon("icon"); + final UploadResourceInfo uploadResourceInfo1 = NodeTypeMetadataMapper.mapTo(nodeTypeMetadata1); + assertEquals(nodeTypeMetadata1.getIcon(), uploadResourceInfo1.getResourceIconPath()); + } + +}
\ No newline at end of file |