1 package org.openecomp.sdc.be.components.impl;
7 import org.openecomp.sdc.be.dao.api.ActionStatus;
8 import org.openecomp.sdc.be.datatypes.enums.FilterKeyEnum;
9 import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
10 import org.openecomp.sdc.be.model.ArtifactType;
11 import org.openecomp.sdc.be.model.Component;
12 import org.openecomp.sdc.be.model.PropertyScope;
13 import org.openecomp.sdc.be.model.User;
14 import org.openecomp.sdc.be.model.category.CategoryDefinition;
15 import org.openecomp.sdc.be.model.category.GroupingDefinition;
16 import org.openecomp.sdc.be.model.category.SubCategoryDefinition;
17 import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
18 import org.openecomp.sdc.be.ui.model.UiCategories;
19 import org.openecomp.sdc.exception.ResponseFormat;
21 import fj.data.Either;
24 public class ElementBusinessLogicTest {
26 private ElementBusinessLogic createTestSubject() {
27 return new ElementBusinessLogic();
32 public void testGetFollowed() throws Exception {
33 ElementBusinessLogic testSubject;
35 Either<Map<String, List<? extends Component>>, ResponseFormat> result;
38 testSubject = createTestSubject();
45 public void testGetAllResourceCategories() throws Exception {
46 ElementBusinessLogic testSubject;
47 Either<List<CategoryDefinition>, ActionStatus> result;
50 testSubject = createTestSubject();
55 public void testGetAllServiceCategories() throws Exception {
56 ElementBusinessLogic testSubject;
57 Either<List<CategoryDefinition>, ActionStatus> result;
60 testSubject = createTestSubject();
65 public void testCreateCategory() throws Exception {
66 ElementBusinessLogic testSubject;
67 CategoryDefinition category = null;
68 String componentTypeParamName = "";
70 Either<CategoryDefinition, ResponseFormat> result;
73 testSubject = createTestSubject();
79 public void testCreateSubCategory() throws Exception {
80 ElementBusinessLogic testSubject;
81 SubCategoryDefinition subCategory = null;
82 String componentTypeParamName = "";
83 String parentCategoryId = "";
85 Either<SubCategoryDefinition, ResponseFormat> result;
88 testSubject = createTestSubject();
94 public void testCreateGrouping() throws Exception {
95 ElementBusinessLogic testSubject;
96 GroupingDefinition grouping = null;
97 String componentTypeParamName = "";
98 String grandParentCategoryId = "";
99 String parentSubCategoryId = "";
101 Either<GroupingDefinition, ResponseFormat> result;
104 testSubject = createTestSubject();
110 public void testGetAllCategories() throws Exception {
111 ElementBusinessLogic testSubject;
112 String componentType = "";
114 Either<List<CategoryDefinition>, ResponseFormat> result;
117 testSubject = createTestSubject();
121 testSubject = createTestSubject();
127 public void testGetAllCategories_1() throws Exception {
128 ElementBusinessLogic testSubject;
130 Either<UiCategories, ResponseFormat> result;
133 testSubject = createTestSubject();
138 public void testDeleteCategory() throws Exception {
139 ElementBusinessLogic testSubject;
140 String categoryId = "";
141 String componentTypeParamName = "";
143 Either<CategoryDefinition, ResponseFormat> result;
146 testSubject = createTestSubject();
151 public void testDeleteSubCategory() throws Exception {
152 ElementBusinessLogic testSubject;
153 String grandParentCategoryId = "";
154 String parentSubCategoryId = "";
155 String componentTypeParamName = "";
157 Either<SubCategoryDefinition, ResponseFormat> result;
160 testSubject = createTestSubject();
165 public void testDeleteGrouping() throws Exception {
166 ElementBusinessLogic testSubject;
167 String grandParentCategoryId = "";
168 String parentSubCategoryId = "";
169 String groupingId = "";
170 String componentTypeParamName = "";
172 Either<GroupingDefinition, ResponseFormat> result;
175 testSubject = createTestSubject();
182 public void testGetAllPropertyScopes() throws Exception {
183 ElementBusinessLogic testSubject;
185 Either<List<PropertyScope>, ActionStatus> result;
188 testSubject = createTestSubject();
193 public void testGetAllArtifactTypes() throws Exception {
194 ElementBusinessLogic testSubject;
196 Either<List<ArtifactType>, ActionStatus> result;
199 testSubject = createTestSubject();
204 public void testGetAllDeploymentArtifactTypes() throws Exception {
205 ElementBusinessLogic testSubject;
206 Either<Map<String, Object>, ActionStatus> result;
209 testSubject = createTestSubject();
214 public void testGetDefaultHeatTimeout() throws Exception {
215 ElementBusinessLogic testSubject;
216 Either<Integer, ActionStatus> result;
219 testSubject = createTestSubject();
224 public void testGetCatalogComponents() throws Exception {
225 ElementBusinessLogic testSubject;
227 List<OriginTypeEnum> excludeTypes = null;
228 Either<Map<String, List<? extends Component>>, ResponseFormat> result;
231 testSubject = createTestSubject();
236 public void testGetFilteredCatalogComponents() throws Exception {
237 ElementBusinessLogic testSubject;
238 String assetType = "";
239 Map<FilterKeyEnum, String> filters = null;
241 Either<List<? extends Component>, ResponseFormat> result;
244 testSubject = createTestSubject();
248 testSubject = createTestSubject();
252 testSubject = createTestSubject();
260 public void testGetCatalogComponentsByUuidAndAssetType() throws Exception {
261 ElementBusinessLogic testSubject;
262 String assetType = "";
264 Either<List<? extends Component>, ResponseFormat> result;
267 testSubject = createTestSubject();
271 testSubject = createTestSubject();
275 testSubject = createTestSubject();
279 testSubject = createTestSubject();
285 public void testGetAllComponentTypesParamNames() throws Exception {
286 ElementBusinessLogic testSubject;
290 testSubject = createTestSubject();
291 result = testSubject.getAllComponentTypesParamNames();
296 public void testGetAllSupportedRoles() throws Exception {
297 ElementBusinessLogic testSubject;
301 testSubject = createTestSubject();
302 result = testSubject.getAllSupportedRoles();
307 public void testGetResourceTypesMap() throws Exception {
308 ElementBusinessLogic testSubject;
309 Either<Map<String, String>, ActionStatus> result;
312 testSubject = createTestSubject();
320 public void testGetFilteredResouces() throws Exception {
321 ElementBusinessLogic testSubject;
322 Map<FilterKeyEnum, String> filters = null;
323 boolean inTransaction = false;
324 Either<List<Component>, StorageOperationStatus> result;
327 testSubject = createTestSubject();