Initial TCA commit into DCAEGEN2
[dcaegen2/analytics/tca.git] / dcae-analytics-cdap-tca / src / test / java / org / openecomp / dcae / apod / analytics / cdap / tca / it / TCAnalyticsAppConfigIT.java
1 /*
2  * ===============================LICENSE_START======================================
3  *  dcae-analytics
4  * ================================================================================
5  *    Copyright © 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 package org.openecomp.dcae.apod.analytics.cdap.tca.it;
22
23 import org.junit.Test;
24 import org.openecomp.dcae.apod.analytics.cdap.tca.BaseAnalyticsCDAPTCAIT;
25 import org.openecomp.dcae.apod.analytics.cdap.tca.settings.TCATestAppConfig;
26 import org.openecomp.dcae.apod.analytics.cdap.tca.settings.TCATestAppConfigHolder;
27 import org.openecomp.dcae.apod.analytics.cdap.tca.settings.TCATestAppPreferences;
28
29 /**
30  * @author Rajiv Singla . Creation Date: 10/25/2016.
31  */
32 public class TCAnalyticsAppConfigIT extends BaseAnalyticsCDAPTCAIT {
33
34
35     @Test
36     public void createTestAppConfigJson() throws Exception {
37         final TCATestAppConfig tcaTestAppConfig = getTCATestAppConfig();
38         final TCATestAppConfigHolder appConfigHolder = new TCATestAppConfigHolder(tcaTestAppConfig);
39         final String appConfigJson = serializeModelToJson(appConfigHolder);
40         LOG.info("AppConfigJson: \n{}", appConfigJson);
41         writeToOutputTextFile("appSettings/tca_app_config.json", appConfigJson, TCAnalyticsAppConfigIT.class);
42     }
43
44     @Test
45     public void createTestAppPreferencesJson() throws Exception {
46         final TCATestAppPreferences tcaTestAppPreferences = getTCATestAppPreferences();
47         final String appPreferencesJson = serializeModelToJson(tcaTestAppPreferences);
48         LOG.info("AppPreferences: \n{}", appPreferencesJson);
49         writeToOutputTextFile("appSettings/tca_app_preferences.json",
50                 appPreferencesJson, TCAnalyticsAppConfigIT.class);
51     }
52 }