1 package org.openecomp.sdc.be.components.impl;
5 import java.util.Optional;
8 import javax.annotation.Generated;
10 import org.apache.commons.httpclient.NameValuePair;
11 import org.apache.commons.lang3.tuple.ImmutablePair;
12 import org.apache.tinkerpop.gremlin.structure.T;
13 import org.junit.Assert;
14 import org.junit.Test;
15 import org.openecomp.sdc.be.dao.api.ActionStatus;
16 import org.openecomp.sdc.be.dao.graph.datatype.GraphEdge;
17 import org.openecomp.sdc.be.datamodel.api.CategoryTypeEnum;
18 import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition;
19 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
20 import org.openecomp.sdc.be.datatypes.enums.FilterKeyEnum;
21 import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
22 import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
23 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
24 import org.openecomp.sdc.be.model.ArtifactType;
25 import org.openecomp.sdc.be.model.Component;
26 import org.openecomp.sdc.be.model.DistributionStatusEnum;
27 import org.openecomp.sdc.be.model.LifecycleStateEnum;
28 import org.openecomp.sdc.be.model.PropertyScope;
29 import org.openecomp.sdc.be.model.Resource;
30 import org.openecomp.sdc.be.model.User;
31 import org.openecomp.sdc.be.model.category.CategoryDefinition;
32 import org.openecomp.sdc.be.model.category.GroupingDefinition;
33 import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
34 import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
35 import org.openecomp.sdc.be.resources.data.ComponentMetadataData;
36 import org.openecomp.sdc.be.resources.data.ResourceMetadataData;
37 import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
38 import org.openecomp.sdc.be.resources.data.category.SubCategoryData;
39 import org.openecomp.sdc.be.ui.model.UiCategories;
40 import org.openecomp.sdc.exception.ResponseFormat;
42 import com.google.common.util.concurrent.Service;
43 import com.thinkaurelius.titan.core.TitanGraph;
45 import fj.data.Either;
46 import io.swagger.annotations.Tag;
49 public class ElementBusinessLogicTest {
51 private ElementBusinessLogic createTestSubject() {
52 return new ElementBusinessLogic();
57 public void testGetFollowed() throws Exception {
58 ElementBusinessLogic testSubject;
60 Either<Map<String, List<? extends Component>>, ResponseFormat> result;
63 testSubject = createTestSubject();
70 public void testGetAllResourceCategories() throws Exception {
71 ElementBusinessLogic testSubject;
72 Either<List<CategoryDefinition>, ActionStatus> result;
75 testSubject = createTestSubject();
80 public void testGetAllServiceCategories() throws Exception {
81 ElementBusinessLogic testSubject;
82 Either<List<CategoryDefinition>, ActionStatus> result;
85 testSubject = createTestSubject();
90 public void testCreateCategory() throws Exception {
91 ElementBusinessLogic testSubject;
92 CategoryDefinition category = null;
93 String componentTypeParamName = "";
95 Either<CategoryDefinition, ResponseFormat> result;
98 testSubject = createTestSubject();
104 public void testCreateSubCategory() throws Exception {
105 ElementBusinessLogic testSubject;
106 SubCategoryDefinition subCategory = null;
107 String componentTypeParamName = "";
108 String parentCategoryId = "";
110 Either<SubCategoryDefinition, ResponseFormat> result;
113 testSubject = createTestSubject();
119 public void testCreateGrouping() throws Exception {
120 ElementBusinessLogic testSubject;
121 GroupingDefinition grouping = null;
122 String componentTypeParamName = "";
123 String grandParentCategoryId = "";
124 String parentSubCategoryId = "";
126 Either<GroupingDefinition, ResponseFormat> result;
129 testSubject = createTestSubject();
135 public void testGetAllCategories() throws Exception {
136 ElementBusinessLogic testSubject;
137 String componentType = "";
139 Either<List<CategoryDefinition>, ResponseFormat> result;
142 testSubject = createTestSubject();
146 testSubject = createTestSubject();
152 public void testGetAllCategories_1() throws Exception {
153 ElementBusinessLogic testSubject;
155 Either<UiCategories, ResponseFormat> result;
158 testSubject = createTestSubject();
163 public void testDeleteCategory() throws Exception {
164 ElementBusinessLogic testSubject;
165 String categoryId = "";
166 String componentTypeParamName = "";
168 Either<CategoryDefinition, ResponseFormat> result;
171 testSubject = createTestSubject();
176 public void testDeleteSubCategory() throws Exception {
177 ElementBusinessLogic testSubject;
178 String grandParentCategoryId = "";
179 String parentSubCategoryId = "";
180 String componentTypeParamName = "";
182 Either<SubCategoryDefinition, ResponseFormat> result;
185 testSubject = createTestSubject();
190 public void testDeleteGrouping() throws Exception {
191 ElementBusinessLogic testSubject;
192 String grandParentCategoryId = "";
193 String parentSubCategoryId = "";
194 String groupingId = "";
195 String componentTypeParamName = "";
197 Either<GroupingDefinition, ResponseFormat> result;
200 testSubject = createTestSubject();
207 public void testGetAllPropertyScopes() throws Exception {
208 ElementBusinessLogic testSubject;
210 Either<List<PropertyScope>, ActionStatus> result;
213 testSubject = createTestSubject();
218 public void testGetAllArtifactTypes() throws Exception {
219 ElementBusinessLogic testSubject;
221 Either<List<ArtifactType>, ActionStatus> result;
224 testSubject = createTestSubject();
229 public void testGetAllDeploymentArtifactTypes() throws Exception {
230 ElementBusinessLogic testSubject;
231 Either<Map<String, Object>, ActionStatus> result;
234 testSubject = createTestSubject();
239 public void testGetDefaultHeatTimeout() throws Exception {
240 ElementBusinessLogic testSubject;
241 Either<Integer, ActionStatus> result;
244 testSubject = createTestSubject();
249 public void testGetCatalogComponents() throws Exception {
250 ElementBusinessLogic testSubject;
252 List<OriginTypeEnum> excludeTypes = null;
253 Either<Map<String, List<? extends Component>>, ResponseFormat> result;
256 testSubject = createTestSubject();
261 public void testGetFilteredCatalogComponents() throws Exception {
262 ElementBusinessLogic testSubject;
263 String assetType = "";
264 Map<FilterKeyEnum, String> filters = null;
266 Either<List<? extends Component>, ResponseFormat> result;
269 testSubject = createTestSubject();
273 testSubject = createTestSubject();
277 testSubject = createTestSubject();
285 public void testGetCatalogComponentsByUuidAndAssetType() throws Exception {
286 ElementBusinessLogic testSubject;
287 String assetType = "";
289 Either<List<? extends Component>, ResponseFormat> result;
292 testSubject = createTestSubject();
296 testSubject = createTestSubject();
300 testSubject = createTestSubject();
304 testSubject = createTestSubject();
310 public void testGetAllComponentTypesParamNames() throws Exception {
311 ElementBusinessLogic testSubject;
315 testSubject = createTestSubject();
316 result = testSubject.getAllComponentTypesParamNames();
321 public void testGetAllSupportedRoles() throws Exception {
322 ElementBusinessLogic testSubject;
326 testSubject = createTestSubject();
327 result = testSubject.getAllSupportedRoles();
332 public void testGetResourceTypesMap() throws Exception {
333 ElementBusinessLogic testSubject;
334 Either<Map<String, String>, ActionStatus> result;
337 testSubject = createTestSubject();
345 public void testGetFilteredResouces() throws Exception {
346 ElementBusinessLogic testSubject;
347 Map<FilterKeyEnum, String> filters = null;
348 boolean inTransaction = false;
349 Either<List<Component>, StorageOperationStatus> result;
352 testSubject = createTestSubject();