27d8ac2a28d670d9fa50e541c0e9a592325d44bd
[policy/pap.git] / main / src / test / java / org / onap / policy / pap / main / parameters / CommonTestData.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2019 Nordix Foundation.
4  *  Modifications Copyright (C) 2019 AT&T Intellectual Property.
5  * ================================================================================
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * SPDX-License-Identifier: Apache-2.0
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.policy.pap.main.parameters;
23
24 /**
25  * Class to hold/create all parameters for test cases.
26  *
27  * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
28  */
29 public class CommonTestData {
30
31     private static final String REST_SERVER_PASSWORD = "zb!XztG34";
32     private static final String REST_SERVER_USER = "healthcheck";
33     private static final int REST_SERVER_PORT = 6969;
34     private static final String REST_SERVER_HOST = "0.0.0.0";
35     private static final boolean REST_SERVER_HTTPS = true;
36     private static final boolean REST_SERVER_AAF = false;
37     public static final String PAP_GROUP_NAME = "PapGroup";
38
39     /**
40      * Returns an instance of RestServerParameters for test cases.
41      *
42      * @param isEmpty boolean value to represent that object created should be empty or not
43      * @return the restServerParameters object
44      */
45     public RestServerParameters getRestServerParameters(final boolean isEmpty) {
46         final RestServerParameters restServerParameters;
47         if (!isEmpty) {
48             restServerParameters = new RestServerParameters(REST_SERVER_HOST, REST_SERVER_PORT, REST_SERVER_USER,
49                     REST_SERVER_PASSWORD, REST_SERVER_HTTPS, REST_SERVER_AAF);
50         } else {
51             restServerParameters = new RestServerParameters(null, 0, null, null, REST_SERVER_HTTPS, REST_SERVER_AAF);
52         }
53         return restServerParameters;
54     }
55
56 }