[SDC] Onboarding 1710 rebase.
[sdc.git] / openecomp-be / backend / openecomp-sdc-vendor-software-product-manager / src / test / java / org / openecomp / sdc / vendorsoftwareproduct / DeploymentFlavorTest.java
1 package org.openecomp.sdc.vendorsoftwareproduct;
2
3 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.CREATE_DEPLOYMENT_FLAVOR_NOT_ALLOWED_IN_HEAT_ONBOARDING;
4 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.DUPLICATE_DEPLOYMENT_FLAVOR_MODEL_NOT_ALLOWED;
5 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.FEATURE_GROUP_NOT_EXIST_FOR_VSP;
6 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.INVALID_COMPONENT_COMPUTE_ASSOCIATION;
7 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.INVALID_COMPUTE_FLAVOR_ID;
8 import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST;
9 import static org.openecomp.sdc.versioning.errors.VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND;
10
11 import org.openecomp.core.utilities.CommonMethods;
12 import org.openecomp.sdc.common.errors.CoreException;
13 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao;
14 import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory;
15 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity;
16 import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl;
17 import org.openecomp.sdc.vendorsoftwareproduct.services.schemagenerator.SchemaGenerator;
18 import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse;
19 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation;
20 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData;
21 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor;
22 import org.openecomp.sdc.versioning.dao.types.Version;
23 import org.testng.Assert;
24 import org.testng.annotations.BeforeClass;
25 import org.testng.annotations.Test;
26
27 import java.util.ArrayList;
28 import java.util.Collection;
29 import java.util.List;
30
31 public class DeploymentFlavorTest {
32   /*private static final String USER1 = "deploymentTestUser1";
33   private static final String USER2 = "deploymentTestUser2";
34   private static final Version VERSION01 = new Version(0, 1);
35   private static final VendorSoftwareProductManager vendorSoftwareProductManager =
36       new VendorSoftwareProductManagerImpl();
37   private static final VendorSoftwareProductDao vendorSoftwareProductDao =
38       VendorSoftwareProductDaoFactory.getInstance().createInterface();
39
40   private static String vsp1Id;
41   private static String vsp2Id;
42   private static String vsp3Id;
43   private static String component11Id;
44   private static String component21Id;
45   private static String deployment1Id = "deployment1";
46   private static String deployment2Id = "deployment2";
47
48   @BeforeClass
49   private void init() {
50     List<String> featureGroups = new ArrayList<>();
51     featureGroups.add("fg01");
52     featureGroups.add("fg02");
53     vsp1Id = vendorSoftwareProductManager.createNewVsp(VSPCommon
54         .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp1", "vendorName1",
55             "vlm1Id", "icon", "category", "subCategory", "123", featureGroups,
56             VSPCommon.OnboardingMethod.
57                 Manual.name()), USER1).getId();
58     component11Id = ComponentsTest.createComponent(vsp1Id, VERSION01, "component11").getId();
59
60     vsp2Id = vendorSoftwareProductManager.createNewVsp(VSPCommon
61         .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp2", "vendorName1",
62             "vlm1Id", "icon", "category", "subCategory", "123", null,
63             VSPCommon.OnboardingMethod.Manual.name()), USER1).getId();
64     component21Id = ComponentsTest.createComponent(vsp2Id, VERSION01, "component21").getId();
65
66     vsp3Id = vendorSoftwareProductManager.createNewVsp(VSPCommon
67         .createVspDetails(null, null, "VSP_" + CommonMethods.nextUuId(), "Test-vsp3forDeployment",
68             "vendorName1",
69             "vlm1Id", "icon", "category", "subCategory", "123", null,
70             VSPCommon.OnboardingMethod.HEAT.name()), USER1).getId();
71   }
72
73     static DeploymentFlavorEntity createDeploymentFlavor(String vspId, Version version, String deploymentFlavorId) {
74         DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity(vspId, version, deploymentFlavorId);
75         DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
76         deploymentFlavor.setModel(deploymentFlavorId + " name");
77         deploymentFlavor.setDescription(deploymentFlavorId + " desc");
78         deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
79         DeploymentFlavorEntity createdDeployment = vendorSoftwareProductManager
80                 .createDeploymentFlavor(deploymentFlavorEntity, USER1);
81         deployment2Id = createdDeployment.getId();
82         return deploymentFlavorEntity;
83     }
84
85   @Test
86   public void testCreate() {
87     DeploymentFlavorEntity deploymentFlavorEntity =
88         new DeploymentFlavorEntity(vsp2Id, VERSION01, deployment1Id);
89     DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
90     deploymentFlavor.setModel("TestDeploymentcreatewithoutFG");
91     deploymentFlavor.setDescription("creating a deployment flavor without any FG and any " +
92         "association");
93     deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
94     DeploymentFlavorEntity createddeployment = vendorSoftwareProductManager.createDeploymentFlavor
95         (deploymentFlavorEntity, USER1);
96     Assert.assertEquals((createddeployment.getId() != null), true);
97     deployment1Id = createddeployment.getId();
98   }
99
100   @Test(dependsOnMethods = "testCreate")
101   public void testUniqueModelCreate() {
102     DeploymentFlavorEntity deploymentFlavorEntity =
103         new DeploymentFlavorEntity(vsp2Id, VERSION01, deployment1Id);
104     DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
105     deploymentFlavor.setModel("TestDeploymentcreatewithoutFG");
106     deploymentFlavor.setDescription("creating a deployment flavor without any FG and any " +
107         "association");
108     deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
109     try {
110       vendorSoftwareProductManager.createDeploymentFlavor
111           (deploymentFlavorEntity, USER1);
112     } catch (CoreException exception) {
113       Assert.assertEquals(exception.code().id(), DUPLICATE_DEPLOYMENT_FLAVOR_MODEL_NOT_ALLOWED);
114     }
115   }
116
117   @Test
118   public void testInvalidFeatureGroup() {
119     DeploymentFlavorEntity deploymentFlavorEntity =
120         new DeploymentFlavorEntity(vsp2Id, VERSION01, deployment1Id);
121     DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
122     deploymentFlavor.setModel("TestInvalidFeatureGroup");
123     deploymentFlavor.setDescription("creating a deployment flavor with invalid FG and without any" +
124         " " +
125         "association");
126     deploymentFlavor.setFeatureGroupId("fg01");
127     deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
128     try {
129       vendorSoftwareProductManager.createDeploymentFlavor
130           (deploymentFlavorEntity, USER1);
131     } catch (CoreException exception) {
132       Assert.assertEquals(exception.code().id(), FEATURE_GROUP_NOT_EXIST_FOR_VSP);
133     }
134   }
135
136   @Test
137   public void testInvalidAssociation() {
138     DeploymentFlavorEntity deploymentFlavorEntity =
139         new DeploymentFlavorEntity(vsp2Id, VERSION01, deployment1Id);
140     DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
141     deploymentFlavor.setModel("testInvalidAssociation");
142     deploymentFlavor.setDescription("creating a deployment flavor with wrong association with " +
143         "null compute flavor id");
144     List<ComponentComputeAssociation> componentComputeAssociationList = new ArrayList<>();
145     ComponentComputeAssociation componentComputeAssociation = new ComponentComputeAssociation();
146     componentComputeAssociation.setComputeFlavorId("72138712");
147     componentComputeAssociationList.add(componentComputeAssociation);
148     deploymentFlavor.setComponentComputeAssociations(componentComputeAssociationList);
149     deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
150     try {
151       vendorSoftwareProductManager.createDeploymentFlavor
152           (deploymentFlavorEntity, USER1);
153     } catch (CoreException exception) {
154       Assert.assertEquals(exception.code().id(), INVALID_COMPONENT_COMPUTE_ASSOCIATION);
155     }
156
157   }
158
159   @Test
160   public void testInvalidComputeFlavorIdAssociation() {
161     DeploymentFlavorEntity deploymentFlavorEntity =
162         new DeploymentFlavorEntity(vsp2Id, VERSION01, deployment1Id);
163     DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
164     deploymentFlavor.setModel("testInvalidComputeFlavorIdAssociation");
165     deploymentFlavor.setDescription("creating a deployment flavor with wrong compute flavor id in" +
166         " assocation");
167     List<ComponentComputeAssociation> componentComputeAssociationList = new ArrayList<>();
168     ComponentComputeAssociation componentComputeAssociation = new ComponentComputeAssociation();
169     componentComputeAssociation.setComponentId(component21Id);
170     componentComputeAssociation.setComputeFlavorId("123123");
171     componentComputeAssociationList.add(componentComputeAssociation);
172     deploymentFlavor.setComponentComputeAssociations(componentComputeAssociationList);
173     deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
174     try {
175       vendorSoftwareProductManager.createDeploymentFlavor
176           (deploymentFlavorEntity, USER1);
177     } catch (CoreException exception) {
178       Assert.assertEquals(exception.code().id(), INVALID_COMPUTE_FLAVOR_ID);
179     }
180
181   }
182
183   @Test
184   public void testInvalidVfcIdAssociation() {
185     DeploymentFlavorEntity deploymentFlavorEntity =
186         new DeploymentFlavorEntity(vsp2Id, VERSION01, deployment1Id);
187     DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
188     deploymentFlavor.setModel("testInvalidVfcIdAssociation");
189     deploymentFlavor.setDescription("creating a deployment flavor with invalid vfcid association");
190     List<ComponentComputeAssociation> componentComputeAssociationList = new ArrayList<>();
191     ComponentComputeAssociation componentComputeAssociation = new ComponentComputeAssociation();
192     componentComputeAssociation.setComponentId("WRONGVFCID");
193     componentComputeAssociation.setComputeFlavorId("123123");
194     componentComputeAssociationList.add(componentComputeAssociation);
195     deploymentFlavor.setComponentComputeAssociations(componentComputeAssociationList);
196     deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
197     try {
198       vendorSoftwareProductManager.createDeploymentFlavor
199           (deploymentFlavorEntity, USER1);
200     } catch (CoreException exception) {
201       Assert.assertEquals(exception.code().id(), VERSIONABLE_SUB_ENTITY_NOT_FOUND);
202     }
203   }
204
205   @Test
206   public void testNegativeforVspHeatOnboarded() {
207     DeploymentFlavorEntity deploymentFlavorEntity =
208         new DeploymentFlavorEntity(vsp3Id, VERSION01, deployment1Id);
209     DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
210     deploymentFlavor.setModel("TestDeploymentcreatewithoutFG");
211     deploymentFlavor.setDescription("creating a deployment flavor for VSP onboarded with HEAT");
212     deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
213     try {
214       vendorSoftwareProductManager.createDeploymentFlavor
215           (deploymentFlavorEntity, USER1);
216     } catch (CoreException exception) {
217       Assert.assertEquals(exception.code().id(),
218           CREATE_DEPLOYMENT_FLAVOR_NOT_ALLOWED_IN_HEAT_ONBOARDING);
219     }
220   }
221
222   @Test
223   public void testGetNegative_InvalidVspId(){
224       testGetNegative("InvalidVspId", VERSION01, deployment1Id, USER1, VERSIONABLE_ENTITY_NOT_EXIST);
225   }
226
227   @Test
228   public void testGetNegative_InvalidDeploymentFlavorId(){
229       testGetNegative(vsp1Id, VERSION01, deployment1Id, USER1, VERSIONABLE_SUB_ENTITY_NOT_FOUND);
230   }
231
232   @Test
233   public void testGet(){
234       DeploymentFlavorEntity expected = createDeploymentFlavor(vsp1Id, VERSION01,deployment2Id);
235       testGet(vsp1Id, VERSION01, deployment2Id, USER1, expected);
236   }
237
238   private void testGet(String vspId, Version version, String componentId, String user,
239                        DeploymentFlavorEntity expected) {
240       CompositionEntityResponse<DeploymentFlavor> response = vendorSoftwareProductManager
241               .getDeploymentFlavor(vspId, null, componentId, user);
242       Assert.assertEquals(response.getId(), expected.getId());
243       Assert.assertEquals(response.getData().getDescription(),
244               expected.getDeploymentFlavorCompositionData().getDescription());
245       Assert.assertEquals(response.getData().getModel(),
246               expected.getDeploymentFlavorCompositionData().getModel());
247       Assert.assertEquals(response.getData().getFeatureGroupId(),
248               expected.getDeploymentFlavorCompositionData().getFeatureGroupId());
249       Assert.assertEquals(response.getData().getComponentComputeAssociations(),
250               expected.getDeploymentFlavorCompositionData().getComponentComputeAssociations());
251       Assert.assertNotNull(response.getSchema());
252   }
253
254   private void testGetNegative(String vspId, Version version, String deploymentFlavorId, String User,
255                                String expectedErrorCode){
256       try{
257           vendorSoftwareProductManager.getDeploymentFlavor(vspId, version, deploymentFlavorId, User);
258           Assert.fail();
259       } catch (CoreException exception){
260           Assert.assertEquals(exception.code().id(), expectedErrorCode);
261       }
262   }
263
264   @Test
265   public void testUpdateNegative_InvalidVspId(){
266     DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity("InvalidVspId",
267             VERSION01,deployment2Id);
268     DeploymentFlavor deploymentFlavorData = new DeploymentFlavor();
269     deploymentFlavorData.setModel(deployment2Id);
270     deploymentFlavorData.setDescription("updating a deployment flavor with invalid VspId and without any" +
271             "association");
272     deploymentFlavorData.setFeatureGroupId("fg01");
273     deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavorData);
274
275     testUpdateNegative(deploymentFlavorEntity, USER1, VERSIONABLE_ENTITY_NOT_EXIST);
276   }
277
278   @Test
279   public void testUpdateNegative_InvalidDeploymentFlavorId(){
280     DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity(vsp1Id,
281             VERSION01,"InvalidDeploymentFlavorId");
282     testUpdateNegative(deploymentFlavorEntity, USER1, VERSIONABLE_SUB_ENTITY_NOT_FOUND);
283   }
284
285   @Test(dependsOnMethods = "testCreate")
286   public void testUpdateNegative_InvalidFeatureGroup(){
287     DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity(vsp2Id,
288             VERSION01,deployment1Id);
289     DeploymentFlavor deploymentFlavorData = new DeploymentFlavor();
290     deploymentFlavorData.setModel("TestDeploymentCreateWithoutFG");
291     deploymentFlavorData.setDescription("updating a deployment flavor with invalid FeatureGroupId and without any" +
292             "association");
293     deploymentFlavorData.setFeatureGroupId("fg01");
294     deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavorData);
295     String expectedError = "#/featureGroupId: "
296             +deploymentFlavorData.getFeatureGroupId()+" is not a valid value. Possible values: ";
297
298       final CompositionEntityValidationData validationData = vendorSoftwareProductManager
299               .updateDeploymentFlavor(deploymentFlavorEntity, USER1);
300       final Collection<String> errors = validationData.getErrors();
301       final Object[] objects = errors.toArray();
302       Assert.assertEquals(errors.size(), 1);
303       Assert.assertEquals(objects[0], expectedError);
304   }
305
306   @Test(dependsOnMethods = "testCreate")
307   public void testUpdateNegative_InvalidComputeFlavorIdAssociation(){
308     DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity(vsp2Id,
309             VERSION01,deployment1Id);
310     DeploymentFlavor deploymentFlavorData = new DeploymentFlavor();
311     deploymentFlavorData.setModel("TestDeploymentcreatewithInvalidComputFlavorId");
312     deploymentFlavorData.setDescription("updating a deployment flavor with wrong compute flavor id in" +
313             " assocation");
314     List<ComponentComputeAssociation> componentComputeAssociationList = new ArrayList<>();
315     ComponentComputeAssociation componentComputeAssociation = new ComponentComputeAssociation();
316     componentComputeAssociation.setComponentId(component21Id);
317     componentComputeAssociation.setComputeFlavorId("123123");
318     componentComputeAssociationList.add(componentComputeAssociation);
319     deploymentFlavorData.setComponentComputeAssociations(componentComputeAssociationList);
320     deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavorData);
321
322     testUpdateNegative(deploymentFlavorEntity, USER1, INVALID_COMPUTE_FLAVOR_ID);
323   }
324
325   @Test
326   public void testUpdate(){
327     //Creating a separate deployment flavor for testing deletion
328     DeploymentFlavorEntity deploymentFlavorEntity =
329             new DeploymentFlavorEntity(vsp1Id, VERSION01, deployment2Id);
330     DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
331     deploymentFlavor.setModel("TestDeploymentCreateforUpdate");
332     deploymentFlavor.setDescription("creating a deployment flavor for updation");
333     deploymentFlavor.setFeatureGroupId("fg01");
334     deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
335     DeploymentFlavorEntity createdDeployment = vendorSoftwareProductManager.createDeploymentFlavor
336             (deploymentFlavorEntity, USER1);
337     deployment2Id = createdDeployment.getId();
338
339     final DeploymentFlavor deploymentFlavorCompositionData = createdDeployment.getDeploymentFlavorCompositionData();
340     deploymentFlavorCompositionData.setModel("TestDeploymentCreateforUpdate"); //no change
341     deploymentFlavorCompositionData.setDescription("updating deployment flavor"); //allow change
342     deploymentFlavorCompositionData.setFeatureGroupId("fg01"); //no change
343     createdDeployment.setDeploymentFlavorCompositionData(deploymentFlavorCompositionData);
344
345     vendorSoftwareProductManager.updateDeploymentFlavor(createdDeployment, USER1);
346     CompositionEntityResponse<DeploymentFlavor> deploymentFlavorCompositionEntityResponse = vendorSoftwareProductManager
347             .getDeploymentFlavor(vsp1Id, VERSION01, deployment2Id, USER1);
348     final DeploymentFlavor data = deploymentFlavorCompositionEntityResponse.getData();
349
350     Assert.assertEquals(
351             data.getDescription(),createdDeployment.getDeploymentFlavorCompositionData().getDescription());
352   }
353
354   @Test
355   public void testUpdateVspWithNoFeatureGroup(){
356       //Creating a separate deployment flavor for testing deletion
357       DeploymentFlavorEntity deploymentFlavorEntity = new DeploymentFlavorEntity(vsp2Id, VERSION01, deployment1Id);
358       DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
359       deploymentFlavor.setModel("TestDeploymentCreateforUpdate");
360       deploymentFlavor.setDescription("creating a deployment flavor for updation");
361       deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
362       DeploymentFlavorEntity createdDeployment = vendorSoftwareProductManager
363               .createDeploymentFlavor(deploymentFlavorEntity, USER1);
364       deployment1Id = createdDeployment.getId();
365
366       final DeploymentFlavor deploymentFlavorCompositionData = createdDeployment.getDeploymentFlavorCompositionData();
367       deploymentFlavorCompositionData.setModel("TestDeploymentCreateforUpdate"); //no change
368       deploymentFlavorCompositionData.setDescription("updating deployment flavor"); //allow change
369       createdDeployment.setDeploymentFlavorCompositionData(deploymentFlavorCompositionData);
370
371       vendorSoftwareProductManager.updateDeploymentFlavor(createdDeployment, USER1);
372       CompositionEntityResponse<DeploymentFlavor> deploymentFlavorCompositionEntityResponse =
373               vendorSoftwareProductManager.getDeploymentFlavor(vsp2Id, VERSION01, deployment1Id, USER1);
374       final DeploymentFlavor data = deploymentFlavorCompositionEntityResponse.getData();
375
376       Assert.assertEquals(data.getDescription(),createdDeployment.getDeploymentFlavorCompositionData()
377               .getDescription());
378     }
379
380   private void testUpdateNegative(DeploymentFlavorEntity deploymentFlavorEntity, String user,
381                                    String expectedErrorCode) {
382     try {
383       vendorSoftwareProductManager
384               .updateDeploymentFlavor(deploymentFlavorEntity, user);
385       System.out.print("updated");
386       Assert.fail();
387     } catch (CoreException exception) {
388       Assert.assertEquals(exception.code().id(), expectedErrorCode);
389     }
390   }
391
392   @Test
393   public void testDelete(){
394       //Creating a separate deployment flavor for testing deletion
395       DeploymentFlavorEntity deploymentFlavorEntity =
396               new DeploymentFlavorEntity(vsp2Id, VERSION01, deployment2Id);
397       DeploymentFlavor deploymentFlavor = new DeploymentFlavor();
398       deploymentFlavor.setModel("TestDeploymentcreateWithoutFG");
399       deploymentFlavor.setDescription("creating a deployment flavor without any FG and any " +
400               "association");
401       deploymentFlavorEntity.setDeploymentFlavorCompositionData(deploymentFlavor);
402       DeploymentFlavorEntity createddeployment = vendorSoftwareProductManager.createDeploymentFlavor
403               (deploymentFlavorEntity, USER1);
404       deployment2Id = createddeployment.getId();
405       vendorSoftwareProductManager.deleteDeploymentFlavor(vsp2Id, deployment2Id, USER1);
406       testDeleteNegative(vsp2Id, deployment2Id, USER1,
407               VERSIONABLE_SUB_ENTITY_NOT_FOUND);
408   }
409
410   @Test
411   public void testDeleteNegative_InvalidVspId(){
412     testDeleteNegative("InvalidVspId", deployment2Id, USER1,
413             VERSIONABLE_ENTITY_NOT_EXIST);
414   }
415
416   @Test
417   public void testDeleteNegative_NonExistingDeploymentFlavorId(){
418     testDeleteNegative(vsp2Id, "NonExistingDeploymentFlavorId", USER1,
419             VERSIONABLE_SUB_ENTITY_NOT_FOUND);
420   }
421
422   private void testDeleteNegative(String vspId, String deploymentId, String user,
423                                    String expectedErrorCode) {
424     try {
425       vendorSoftwareProductManager
426               .deleteDeploymentFlavor(vspId, deploymentId, user);
427       Assert.fail();
428     } catch (CoreException exception) {
429       Assert.assertEquals(exception.code().id(), expectedErrorCode);
430     }
431   }*/
432 }