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