1 package org.openecomp.sdc.be.components.impl;
6 import javax.annotation.Generated;
8 import org.apache.commons.math3.stat.descriptive.summary.Product;
9 import org.junit.Assert;
10 import org.junit.Test;
11 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
12 import org.openecomp.sdc.be.model.Component;
13 import org.openecomp.sdc.be.model.ComponentInstance;
14 import org.openecomp.sdc.be.model.User;
15 import org.openecomp.sdc.be.model.operations.api.ICacheMangerOperation;
16 import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
17 import org.openecomp.sdc.be.ui.model.UiComponentDataTransfer;
18 import org.openecomp.sdc.exception.ResponseFormat;
20 import fj.data.Either;
23 public class ProductBusinessLogicTest {
25 private ProductBusinessLogic createTestSubject() {
26 return new ProductBusinessLogic();
30 public void testValidateProductNameExists() throws Exception {
31 ProductBusinessLogic testSubject;
32 String productName = "";
34 Either<Map<String, Boolean>, ResponseFormat> result;
37 testSubject = createTestSubject();
41 public void testSetDeploymentArtifactsPlaceHolder() throws Exception {
42 ProductBusinessLogic testSubject;
43 Component component = null;
47 testSubject = createTestSubject();
48 testSubject.setDeploymentArtifactsPlaceHolder(component, user);
52 public void testDeleteMarkedComponents() throws Exception {
53 ProductBusinessLogic testSubject;
54 Either<List<String>, ResponseFormat> result;
57 testSubject = createTestSubject();
62 public void testGetComponentInstanceBL() throws Exception {
63 ProductBusinessLogic testSubject;
64 ComponentInstanceBusinessLogic result;
67 testSubject = createTestSubject();
72 public void testGetComponentInstancesFilteredByPropertiesAndInputs() throws Exception {
73 ProductBusinessLogic testSubject;
74 String componentId = "";
75 ComponentTypeEnum componentTypeEnum = null;
77 String searchText = "";
78 Either<List<ComponentInstance>, ResponseFormat> result;
81 testSubject = createTestSubject();
86 public void testGetCacheManagerOperation() throws Exception {
87 ProductBusinessLogic testSubject;
88 ICacheMangerOperation result;
91 testSubject = createTestSubject();
96 public void testSetCacheManagerOperation() throws Exception {
97 ProductBusinessLogic testSubject;
98 ICacheMangerOperation cacheManagerOperation = null;
101 testSubject = createTestSubject();
102 testSubject.setCacheManagerOperation(cacheManagerOperation);
106 public void testGetUiComponentDataTransferByComponentId() throws Exception {
107 ProductBusinessLogic testSubject;
108 String componentId = "";
109 List<String> dataParamsToReturn = null;
110 Either<UiComponentDataTransfer, ResponseFormat> result;
113 testSubject = createTestSubject();
119 public void testCreateProduct() throws Exception {
120 ProductBusinessLogic testSubject;
121 Product product = null;
123 Either<Product, ResponseFormat> result;
126 testSubject = createTestSubject();
133 public void testCheckUnupdatableProductFields() throws Exception {
134 ProductBusinessLogic testSubject;
135 Product product = null;
138 testSubject = createTestSubject();
143 public void testValidateProductBeforeCreate() throws Exception {
144 ProductBusinessLogic testSubject;
145 Product product = null;
147 AuditingActionEnum actionEnum = null;
148 Either<Product, ResponseFormat> result;
151 testSubject = createTestSubject();
157 public void testValidateProductFieldsBeforeCreate() throws Exception {
158 ProductBusinessLogic testSubject;
160 Product product = null;
161 AuditingActionEnum actionEnum = null;
162 Either<Boolean, ResponseFormat> result;
165 testSubject = createTestSubject();
171 public void testValidateAndUpdateProductContactsList() throws Exception {
172 ProductBusinessLogic testSubject;
174 Product product = null;
175 AuditingActionEnum actionEnum = null;
176 Either<Boolean, ResponseFormat> result;
179 testSubject = createTestSubject();
185 public void testValidateGrouping() throws Exception {
186 ProductBusinessLogic testSubject;
188 Product product = null;
189 AuditingActionEnum actionEnum = null;
190 Either<Boolean, ResponseFormat> result;
193 testSubject = createTestSubject();
199 public void testGetProduct() throws Exception {
200 ProductBusinessLogic testSubject;
201 String productId = "";
203 Either<Product, ResponseFormat> result;
206 testSubject = createTestSubject();
212 public void testDeleteProduct() throws Exception {
213 ProductBusinessLogic testSubject;
214 String productId = "";
216 Either<Product, ResponseFormat> result;
219 testSubject = createTestSubject();
225 public void testValidateProductFullNameAndCleanup() throws Exception {
226 ProductBusinessLogic testSubject;
228 Product product = null;
229 AuditingActionEnum actionEnum = null;
230 Either<Boolean, ResponseFormat> result;
233 testSubject = createTestSubject();
239 public void testValidateProductNameAndCleanup() throws Exception {
240 ProductBusinessLogic testSubject;
242 Product product = null;
243 AuditingActionEnum actionEnum = null;
244 Either<Boolean, ResponseFormat> result;
247 testSubject = createTestSubject();
252 public void testValidateTagsListAndRemoveDuplicates() throws Exception {
253 ProductBusinessLogic testSubject;
255 Product product = null;
256 String oldProductName = "";
257 AuditingActionEnum actionEnum = null;
258 Either<Boolean, ResponseFormat> result;
261 testSubject = createTestSubject();
266 public void testUpdateProductMetadata() throws Exception {
267 ProductBusinessLogic testSubject;
268 String productId = "";
269 Product updatedProduct = null;
271 Either<Product, ResponseFormat> result;
274 testSubject = createTestSubject();
275 updatedProduct = null;
280 public void testValidateAndUpdateProductMetadata() throws Exception {
281 ProductBusinessLogic testSubject;
283 Product currentProduct = null;
284 Product updatedProduct = null;
285 Either<Product, ResponseFormat> result;
288 testSubject = createTestSubject();
294 public void testValidateAndUpdateProductName() throws Exception {
295 ProductBusinessLogic testSubject;
297 Product currentProduct = null;
298 Product updatedProduct = null;
299 Either<Boolean, ResponseFormat> result;
302 testSubject = createTestSubject();
308 public void testValidateAndUpdateFullName() throws Exception {
309 ProductBusinessLogic testSubject;
311 Product currentProduct = null;
312 Product updatedProduct = null;
313 Either<Boolean, ResponseFormat> result;
316 testSubject = createTestSubject();
322 public void testValidateAndUpdateCategory() throws Exception {
323 ProductBusinessLogic testSubject;
325 Product currentProduct = null;
326 Product updatedProduct = null;
327 Either<Boolean, ResponseFormat> result;
330 testSubject = createTestSubject();
336 public void testValidateAndUpdateContactList() throws Exception {
337 ProductBusinessLogic testSubject;
339 Product currentProduct = null;
340 Product updatedProduct = null;
341 Either<Boolean, ResponseFormat> result;
344 testSubject = createTestSubject();
350 public void testValidateAndUpdateTags() throws Exception {
351 ProductBusinessLogic testSubject;
353 Product currentProduct = null;
354 Product updatedProduct = null;
355 Either<Boolean, ResponseFormat> result;
358 testSubject = createTestSubject();
364 public void testValidateTagPattern() throws Exception {
365 ProductBusinessLogic testSubject;
370 testSubject = createTestSubject();
376 public void testGetProductByNameAndVersion() throws Exception {
377 ProductBusinessLogic testSubject;
378 String productName = "";
379 String productVersion = "";
381 Either<Product, ResponseFormat> result;
384 testSubject = createTestSubject();