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