Sonar Critical Fix
[dcaegen2/analytics/tca.git] / dcae-analytics-cdap-tca / src / test / java / org / openecomp / dcae / apod / analytics / cdap / tca / it / TCAnalyticsAppConfigIT.java
1 /*\r
2  * ===============================LICENSE_START======================================\r
3  *  dcae-analytics\r
4  * ================================================================================\r
5  *    Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  *  Licensed under the Apache License, Version 2.0 (the "License");\r
8  *  you may not use this file except in compliance with the License.\r
9  *   You may obtain a copy of the License at\r
10  *\r
11  *          http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  *  Unless required by applicable law or agreed to in writing, software\r
14  *  distributed under the License is distributed on an "AS IS" BASIS,\r
15  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  *  See the License for the specific language governing permissions and\r
17  *  limitations under the License.\r
18  *  ============================LICENSE_END===========================================\r
19  */\r
20 \r
21 package org.openecomp.dcae.apod.analytics.cdap.tca.it;\r
22 \r
23 import org.junit.Test;\r
24 import org.openecomp.dcae.apod.analytics.cdap.tca.BaseAnalyticsCDAPTCAIT;\r
25 import org.openecomp.dcae.apod.analytics.cdap.tca.settings.TCATestAppConfig;\r
26 import org.openecomp.dcae.apod.analytics.cdap.tca.settings.TCATestAppConfigHolder;\r
27 import org.openecomp.dcae.apod.analytics.cdap.tca.settings.TCATestAppPreferences;\r
28 \r
29 /**\r
30  * @author Rajiv Singla . Creation Date: 10/25/2016.\r
31  */\r
32 public class TCAnalyticsAppConfigIT extends BaseAnalyticsCDAPTCAIT {\r
33 \r
34 \r
35     @Test\r
36     public void createTestAppConfigJson() throws Exception {\r
37         final TCATestAppConfig tcaTestAppConfig = getTCATestAppConfig();\r
38         final TCATestAppConfigHolder appConfigHolder = new TCATestAppConfigHolder(tcaTestAppConfig);\r
39         final String appConfigJson = serializeModelToJson(appConfigHolder);\r
40         LOG.info("AppConfigJson: \n{}", appConfigJson);\r
41         writeToOutputTextFile("appSettings/tca_app_config.json", appConfigJson, TCAnalyticsAppConfigIT.class);\r
42     }\r
43 \r
44     @Test\r
45     public void createTestAppPreferencesJson() throws Exception {\r
46         final TCATestAppPreferences tcaTestAppPreferences = getTCATestAppPreferences();\r
47         final String appPreferencesJson = serializeModelToJson(tcaTestAppPreferences);\r
48         LOG.info("AppPreferences: \n{}", appPreferencesJson);\r
49         writeToOutputTextFile("appSettings/tca_app_preferences.json",\r
50                 appPreferencesJson, TCAnalyticsAppConfigIT.class);\r
51     }\r
52 }\r