Fix for radio buttons
[sdc.git] / asdc-tests / src / main / java / org / openecomp / sdc / ci / tests / execute / general / BasicHttpAuthenticationTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 //US505653
22 package org.openecomp.sdc.ci.tests.execute.general;
23
24 import static org.testng.AssertJUnit.assertEquals;
25 import static org.testng.AssertJUnit.assertFalse;
26 import static org.testng.AssertJUnit.assertTrue;
27
28 import java.util.ArrayList;
29 import java.util.HashMap;
30 import java.util.List;
31 import java.util.Map;
32
33 import org.apache.commons.codec.binary.Base64;
34 import org.junit.Rule;
35 import org.junit.rules.TestName;
36 import org.openecomp.sdc.be.dao.api.ActionStatus;
37 import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition;
38 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
39 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
40 import org.openecomp.sdc.be.model.Resource;
41 import org.openecomp.sdc.be.model.Service;
42 import org.openecomp.sdc.be.model.User;
43 import org.openecomp.sdc.ci.tests.api.ComponentBaseTest;
44 import org.openecomp.sdc.ci.tests.api.Urls;
45 import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails;
46 import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails;
47 import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
48 import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
49 import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum;
50 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
51 import org.openecomp.sdc.ci.tests.datatypes.expected.ExpectedAuthenticationAudit;
52 import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum;
53 import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
54 import org.openecomp.sdc.ci.tests.utils.DbUtils;
55 import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
56 import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
57 import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils;
58 import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils;
59 import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils;
60 import org.openecomp.sdc.ci.tests.utils.rest.ConsumerRestUtils;
61 import org.openecomp.sdc.ci.tests.utils.rest.LifecycleRestUtils;
62 import org.openecomp.sdc.ci.tests.utils.validation.AuditValidationUtils;
63 import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils;
64 import org.openecomp.sdc.common.util.ValidationUtils;
65 import org.testng.AssertJUnit;
66 import org.testng.annotations.AfterMethod;
67 import org.testng.annotations.BeforeMethod;
68 import org.testng.annotations.Test;
69
70 public class BasicHttpAuthenticationTest extends ComponentBaseTest {
71
72         protected static final String AUTH_FAILED_INVALID_AUTHENTICATION_HEADER = "AUTH_FAILED_INVALID_AUTHENTICATION_HEADER";
73
74         protected static final String AUTH_SUCCESS = "AUTH_SUCCESS";
75
76         protected static final String AUTH_FAILED_INVALID_PASSWORD = "AUTH_FAILED_INVALID_PASSWORD";
77
78         protected static final String AUTH_FAILED_USER_NOT_FOUND = "AUTH_FAILED_USER_NOT_FOUND";
79
80         protected static final String AUTH_REQUIRED = "AUTH_REQUIRED";
81
82         protected static final String WWW_AUTHENTICATE = "WWW-Authenticate";
83
84         // user ci password 123456
85         // protected final String authorizationHeader = "Basic Y2k6MTIzNDU2";
86         // user ci password 123456
87         protected final String USER = "ci";
88
89         protected final String PASSWORD = "123456";
90
91         protected final String SALT = "2a1f887d607d4515d4066fe0f5452a50";
92
93         protected final String HASHED_PASSWORD = "0a0dc557c3bf594b1a48030e3e99227580168b21f44e285c69740b8d5b13e33b";
94
95         protected User sdncAdminUserDetails;
96
97         protected ConsumerDataDefinition consumerDataDefinition;
98         protected ResourceReqDetails resourceDetails;
99         protected ServiceReqDetails serviceDetails;
100         protected User sdncUserDetails;
101
102         protected ArtifactReqDetails deploymentArtifact;
103
104         protected ExpectedAuthenticationAudit expectedAuthenticationAudit;
105
106         protected final String auditAction = "HttpAuthentication";
107
108         protected String expectedDownloadServiceUrl;
109         protected String expectedDownloadResourceUrl;
110         protected ComponentInstanceReqDetails componentInstanceReqDetails;
111
112         @Rule
113         public static TestName name = new TestName();
114
115         public BasicHttpAuthenticationTest() {
116                 super(name, BasicHttpAuthenticationTest.class.getName());
117         }
118
119         @BeforeMethod
120         public void init() throws Exception {
121
122                 sdncUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
123                 Resource resourceObject = AtomicOperationUtils
124                                 .createResourceByType(ResourceTypeEnum.VFC, UserRoleEnum.DESIGNER, true).left().value();
125                 resourceDetails = new ResourceReqDetails(resourceObject);
126                 Service serviceObject = AtomicOperationUtils.createDefaultService(UserRoleEnum.DESIGNER, true).left().value();
127                 serviceDetails = new ServiceReqDetails(serviceObject);
128
129                 deploymentArtifact = ElementFactory.getDefaultDeploymentArtifactForType(ArtifactTypeEnum.HEAT.getType());
130                 RestResponse response = ArtifactRestUtils.addInformationalArtifactToResource(deploymentArtifact,
131                                 sdncUserDetails, resourceDetails.getUniqueId());
132                 AssertJUnit.assertTrue("add HEAT artifact to resource request returned status:" + response.getErrorCode(),
133                                 response.getErrorCode() == 200);
134
135                 componentInstanceReqDetails = ElementFactory.getDefaultComponentInstance();
136                 // certified resource
137                 response = LifecycleRestUtils.certifyResource(resourceDetails);
138                 AssertJUnit.assertTrue("certify resource request returned status:" + response.getErrorCode(),
139                                 response.getErrorCode() == 200);
140
141                 // add resource instance with HEAT deployment artifact to the service
142                 componentInstanceReqDetails.setComponentUid(resourceDetails.getUniqueId());
143                 response = ComponentInstanceRestUtils.createComponentInstance(componentInstanceReqDetails, sdncUserDetails,
144                                 serviceDetails.getUniqueId(), ComponentTypeEnum.SERVICE);
145                 AssertJUnit.assertTrue("response code is not 201, returned: " + response.getErrorCode(),
146                                 response.getErrorCode() == 201);
147                 expectedAuthenticationAudit = new ExpectedAuthenticationAudit();
148
149                 // RestResponse addDeploymentArtifactResponse =
150                 // ArtifactRestUtils.addInformationalArtifactToService(deploymentArtifact,
151                 // sdncUserDetails, serviceDetails.getUniqueId());
152                 // assertEquals("didn't succeed to upload deployment artifact", 200,
153                 // addDeploymentArtifactResponse.getErrorCode().intValue());
154                 //
155                 // downloadUrl =
156                 // String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL,
157                 // ValidationUtils.convertToSystemName(serviceDetails.getServiceName()),
158                 // serviceDetails.getVersion(),
159                 // ValidationUtils.normalizeFileName(deploymentArtifact.getArtifactName()));
160
161                 expectedDownloadResourceUrl = String.format(Urls.DISTRIB_DOWNLOAD_RESOURCE_ARTIFACT_RELATIVE_URL,
162                                 ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceDetails.getVersion(),
163                                 ValidationUtils.convertToSystemName(resourceDetails.getName()), resourceDetails.getVersion(),
164                                 ValidationUtils.normalizeFileName(deploymentArtifact.getArtifactName()));
165                 expectedDownloadResourceUrl = expectedDownloadResourceUrl.substring("/sdc/".length(),
166                                 expectedDownloadResourceUrl.length());
167
168                 expectedDownloadServiceUrl = String.format(Urls.DISTRIB_DOWNLOAD_SERVICE_ARTIFACT_RELATIVE_URL,
169                                 ValidationUtils.convertToSystemName(serviceDetails.getName()), serviceDetails.getVersion(),
170                                 ValidationUtils.normalizeFileName(deploymentArtifact.getArtifactName()));
171                 expectedDownloadServiceUrl = expectedDownloadServiceUrl.substring("/sdc/".length(),
172                                 expectedDownloadServiceUrl.length());
173
174                 sdncAdminUserDetails = ElementFactory.getDefaultUser(UserRoleEnum.ADMIN);
175                 consumerDataDefinition = createConsumer();
176                 RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
177                 BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
178                 ;
179
180                 RestResponse createResponse = ConsumerRestUtils.createConsumer(consumerDataDefinition, sdncAdminUserDetails);
181                 BaseRestUtils.checkCreateResponse(createResponse);
182
183         }
184
185         @AfterMethod
186         public void tearDown() throws Exception {
187                 RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumerDataDefinition, sdncAdminUserDetails);
188                 BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
189                 ;
190         }
191
192         @Test
193         public void sendAuthenticatedRequestTest_success() throws Exception, Exception {
194                 DbUtils.cleanAllAudits();
195                 Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(USER, PASSWORD);
196                 // RestResponse restResponse =
197                 // ArtifactRestUtils.downloadServiceArtifact(serviceDetails,
198                 // deploymentArtifact, sdncUserDetails, authorizationHeader);
199                 RestResponse restResponse = ArtifactRestUtils.downloadResourceArtifact(serviceDetails, resourceDetails,
200                                 deploymentArtifact, sdncUserDetails, authorizationHeader);
201                 AssertJUnit.assertEquals("Check response code after download artifact", 200,
202                                 restResponse.getErrorCode().intValue());
203                 AssertJUnit.assertFalse(restResponse.getHeaderFields().containsKey(HttpHeaderEnum.WWW_AUTHENTICATE.getValue()));
204
205                 validateAuditAuthentication(USER, AUTH_SUCCESS, ComponentTypeEnum.RESOURCE);
206
207         }
208
209         protected void validateAuditAuthentication(String userName, String AuthStatus, ComponentTypeEnum compType)
210                         throws Exception {
211                 if (compType.equals(ComponentTypeEnum.RESOURCE)) {
212                         expectedAuthenticationAudit = new ExpectedAuthenticationAudit(expectedDownloadResourceUrl, userName,
213                                         auditAction, AuthStatus);
214                 } else {
215                         expectedAuthenticationAudit = new ExpectedAuthenticationAudit(expectedDownloadServiceUrl, userName,
216                                         auditAction, AuthStatus);
217                 }
218                 AuditValidationUtils.validateAuthenticationAudit(expectedAuthenticationAudit);
219         }
220
221         protected ConsumerDataDefinition createConsumer() {
222                 ConsumerDataDefinition consumer = new ConsumerDataDefinition();
223                 consumer.setConsumerName(USER);
224                 consumer.setConsumerSalt(SALT);
225                 consumer.setConsumerPassword(HASHED_PASSWORD);
226                 return consumer;
227
228         }
229
230         @Test
231         public void sendAuthenticatedRequestWithoutHeadersTest() throws Exception, Exception {
232                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
233                                 sdncUserDetails, new HashMap<String, String>());
234                 assertEquals("Check response code after download artifact", 401, restResponse.getErrorCode().intValue());
235                 ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.AUTH_REQUIRED.name(), new ArrayList<String>(),
236                                 restResponse.getResponse());
237                 assertTrue(restResponse.getHeaderFields().containsKey(WWW_AUTHENTICATE));
238                 List<String> getAuthenticateHeader = restResponse.getHeaderFields().get(WWW_AUTHENTICATE);
239                 assertEquals("www-authenticate header contains more then one value", 1, getAuthenticateHeader.size());
240                 assertTrue(getAuthenticateHeader.get(0).equals("Basic realm=" + "\"ASDC\""));
241
242                 validateAuditAuthentication("", AUTH_REQUIRED, ComponentTypeEnum.SERVICE);
243         }
244
245         @Test
246         public void sendAuthenticatedRequestTest_userIsNotProvsioned() throws Exception, Exception {
247                 String userName = "shay";
248                 Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(userName, "123456");
249                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
250                                 sdncUserDetails, authorizationHeader);
251                 assertEquals("Check response code after download artifact", 403, restResponse.getErrorCode().intValue());
252                 ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.AUTH_FAILED.name(), new ArrayList<String>(),
253                                 restResponse.getResponse());
254                 assertFalse(restResponse.getHeaderFields().containsKey(WWW_AUTHENTICATE));
255
256                 validateAuditAuthentication(userName, AUTH_FAILED_USER_NOT_FOUND, ComponentTypeEnum.SERVICE);
257         }
258
259         @Test
260         public void sendAuthenticatedRequestTest_userIsNull() throws Exception, Exception {
261                 String userName = "";
262                 Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(userName, "123456");
263                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
264                                 sdncUserDetails, authorizationHeader);
265                 assertEquals("Check response code after download artifact", 403, restResponse.getErrorCode().intValue());
266                 ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.AUTH_FAILED.name(), new ArrayList<String>(),
267                                 restResponse.getResponse());
268                 assertFalse(restResponse.getHeaderFields().containsKey(WWW_AUTHENTICATE));
269
270                 validateAuditAuthentication(userName, AUTH_FAILED_USER_NOT_FOUND, ComponentTypeEnum.SERVICE);
271         }
272
273         @Test
274         public void sendAuthenticatedRequestTest_passwordIsNull() throws Exception, Exception {
275                 String userName = "ci";
276                 Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(userName, "");
277                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
278                                 sdncUserDetails, authorizationHeader);
279                 assertEquals("Check response code after download artifact", 403, restResponse.getErrorCode().intValue());
280                 ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.AUTH_FAILED.name(), new ArrayList<String>(),
281                                 restResponse.getResponse());
282                 assertFalse(restResponse.getHeaderFields().containsKey(WWW_AUTHENTICATE));
283
284                 validateAuditAuthentication(userName, AUTH_FAILED_INVALID_PASSWORD, ComponentTypeEnum.SERVICE);
285         }
286
287         @Test
288         public void sendAuthenticatedRequestTest_passowrdIsNotValidated() throws Exception, Exception {
289                 String userCi = "ci";
290                 Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(userCi, "98765");
291                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
292                                 sdncUserDetails, authorizationHeader);
293                 assertEquals("Check response code after download artifact", 403, restResponse.getErrorCode().intValue());
294                 ErrorValidationUtils.checkBodyResponseOnError(ActionStatus.AUTH_FAILED.name(), new ArrayList<String>(),
295                                 restResponse.getResponse());
296                 assertFalse(restResponse.getHeaderFields().containsKey(HttpHeaderEnum.WWW_AUTHENTICATE.getValue()));
297
298                 validateAuditAuthentication(userCi, AUTH_FAILED_INVALID_PASSWORD, ComponentTypeEnum.SERVICE);
299         }
300
301         @Test
302         public void sendAuthenticatedRequestTest_InvalidHeader() throws Exception, Exception {
303                 String userCredentials = USER + ":" + PASSWORD;
304                 byte[] encodeBase64 = Base64.encodeBase64(userCredentials.getBytes());
305                 String encodedUserCredentials = new String(encodeBase64);
306                 Map<String, String> authorizationHeader = new HashMap<String, String>();
307                 authorizationHeader.put(HttpHeaderEnum.AUTHORIZATION.getValue(), encodedUserCredentials);
308                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
309                                 sdncUserDetails, authorizationHeader);
310                 assertEquals("Check response code after download artifact", 400, restResponse.getErrorCode().intValue());
311                 assertFalse(restResponse.getHeaderFields().containsKey(HttpHeaderEnum.WWW_AUTHENTICATE.getValue()));
312
313                 validateAuditAuthentication("", AUTH_FAILED_INVALID_AUTHENTICATION_HEADER, ComponentTypeEnum.SERVICE);
314         }
315
316         @Test(enabled = false)
317         public void sendTwoAuthenticatedRequestsTest() throws Exception, Exception {
318                 Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(USER, PASSWORD);
319                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
320                                 sdncUserDetails, authorizationHeader);
321                 assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
322
323                 RestResponse secondRestResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
324                                 sdncUserDetails, authorizationHeader);
325                 assertEquals("Check response code after second download artifact", 200,
326                                 secondRestResponse.getErrorCode().intValue());
327         }
328
329         @Test(enabled = false)
330         public void sendAuthenticatedRequestTest_userValidation_1() throws Exception, Exception {
331
332                 ConsumerDataDefinition consumer = new ConsumerDataDefinition();
333                 consumer.setConsumerName("cI2468");
334                 consumer.setConsumerPassword(HASHED_PASSWORD);
335                 consumer.setConsumerSalt(SALT);
336                 RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumer, sdncAdminUserDetails);
337                 BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
338
339                 RestResponse createResponse = ConsumerRestUtils.createConsumer(consumer, sdncAdminUserDetails);
340                 BaseRestUtils.checkCreateResponse(createResponse);
341
342                 Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(consumer.getConsumerName(),
343                                 PASSWORD);
344                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
345                                 sdncUserDetails, authorizationHeader);
346                 assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
347
348                 deleteResponse = ConsumerRestUtils.deleteConsumer(consumer, sdncAdminUserDetails);
349                 BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
350         }
351
352         // ECOMP Consumer Name - UTF-8 string up to 255 characters containing the
353         // following characters : ( maybe to limit 4-64 chars ? )
354         // Lowercase characters {a-z}
355         // Uppercase characters {A-Z}
356         // Numbers {0-9}
357         // Dash {-}; this character is not supported as the first character in the
358         // user name
359         // Period {.}; this character is not supported as the first character in the
360         // user name
361         // Underscore {_}
362         // @Ignore("add manually user:password 24-!68:123456 to
363         // users-configuration.yaml in runtime")
364         @Test(enabled = false)
365         public void sendAuthenticatedRequestTest_userValidation_2() throws Exception, Exception {
366                 ConsumerDataDefinition consumer = new ConsumerDataDefinition();
367                 consumer.setConsumerName("24-!68");
368                 consumer.setConsumerPassword(HASHED_PASSWORD);
369                 consumer.setConsumerSalt(SALT);
370                 RestResponse deleteResponse = ConsumerRestUtils.deleteConsumer(consumer, sdncAdminUserDetails);
371                 BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
372
373                 RestResponse createResponse = ConsumerRestUtils.createConsumer(consumer, sdncAdminUserDetails);
374                 BaseRestUtils.checkCreateResponse(createResponse);
375                 Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader(consumer.getConsumerName(),
376                                 PASSWORD);
377                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
378                                 sdncUserDetails, authorizationHeader);
379                 assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
380
381                 deleteResponse = ConsumerRestUtils.deleteConsumer(consumer, sdncAdminUserDetails);
382                 BaseRestUtils.checkStatusCode(deleteResponse, "delete operation filed", false, 404, 200);
383         }
384
385         // this is invalide becouse we do not use the : any more
386         // @Ignore("can't exectue, yaml file does not allow to enter more then one
387         // colon continuously (\":\") ")
388         @Test(enabled = false)
389         public void sendAuthenticatedRequestTest_userValidation_3() throws Exception, Exception {
390                 Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader("a:", "123456");
391                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
392                                 sdncUserDetails, authorizationHeader);
393                 assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
394         }
395
396         //
397         // * ECOMP Consumer Password - expected to be SHA-2 256 encrypted value (
398         // SALT + "real" password ) => maximal length 256 bytes = 32 characters
399         // Before storing/comparing please convert upper case letter to lower.
400         // The "normalized" encrypted password should match the following format :
401         // [a-z0-9]
402         // @Ignore("add manually user:password 2468:123:456 to
403         // users-configuration.yaml in runtime")
404         @Test(enabled = false)
405         public void sendAuthenticatedRequestTest_passwordValidation_1() throws Exception, Exception {
406                 Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader("A1", "123:456");
407                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
408                                 sdncUserDetails, authorizationHeader);
409                 assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
410         }
411
412         // * ECOMP Consumer Password - expected to be SHA-2 256 encrypted value (
413         // SALT + "real" password ) => maximal length 256 bytes = 32 characters
414         // Before storing/comparing please convert upper case letter to lower.
415         // The "normalized" encrypted password should match the following format :
416         // [a-z0-9]
417         @Test(enabled = false)
418         // @Ignore("add manually user:password 2468:Sq123a456B to
419         // users-configuration.yaml in runtime")
420         public void sendAuthenticatedRequestTest_passwordValidation_2() throws Exception, Exception {
421                 Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader("B2", "Sq123a456B");
422                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
423                                 sdncUserDetails, authorizationHeader);
424                 assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
425         }
426
427         // * ECOMP Consumer Password - expected to be SHA-2 256 encrypted value (
428         // SALT + "real" password ) => maximal length 256 bytes = 32 characters
429         // Before storing/comparing please convert upper case letter to lower.
430         // The "normalized" encrypted password should match the following format :
431         // [a-z0-9]
432         @Test
433         // @Ignore("add C3:111T-0-*# to file")
434         public void sendAuthenticatedRequestTest_passwordValidation_3() throws Exception, Exception {
435                 Map<String, String> authorizationHeader = BaseRestUtils.addAuthorizeHeader("C3", "111T-0-*#");
436                 RestResponse restResponse = ArtifactRestUtils.downloadServiceArtifact(serviceDetails, deploymentArtifact,
437                                 sdncUserDetails, authorizationHeader);
438                 assertEquals("Check response code after download artifact", 200, restResponse.getErrorCode().intValue());
439         }
440
441 }