2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.mso.adapters.sdnc.impl;
23 import org.junit.AfterClass;
24 import org.junit.Before;
25 import org.junit.Test;
27 import org.openecomp.mso.properties.MsoJavaProperties;
28 import org.openecomp.mso.properties.MsoPropertiesException;
29 import org.openecomp.mso.properties.MsoPropertiesFactory;
31 public class RequestTunablesTest {
33 private static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory();
35 public static final String SDNC_PROP = MsoJavaProperties.class.getClassLoader().getResource("mso.sdnc.properties").toString().substring(5);
38 public final void initBeforeEachTest() throws MsoPropertiesException {
39 msoPropertiesFactory.removeAllMsoProperties();
40 msoPropertiesFactory.initializeMsoProperties("MSO_PROP_SDNC_ADAPTER", SDNC_PROP);
44 public static final void kill () throws MsoPropertiesException {
46 msoPropertiesFactory.removeMsoProperties("MSO_PROP_SDNC_ADAPTER");
51 * {@link org.openecomp.mso.adapters.sdnc.impl.RequestTunables#RequestTunables(java.lang.String, java.lang.String, java.lang.String, java.lang.String)}
55 public final void testRequestTunables () {
56 RequestTunables rt = new RequestTunables (null, null, "op", null,msoPropertiesFactory);
57 assert(rt.getReqId ().length ()==0);
58 rt = new RequestTunables ("reqId", "msoAction", null, "query",msoPropertiesFactory);
60 System.out.println(rt.toString ());
61 // assert (rt.getReqMethod ().equals ("toto"));
62 assert (rt.getTimeout () != null);
63 assert (rt.getAction ().equals ("query"));
64 assert (rt.getMsoAction ().equals ("msoAction"));
65 assert (rt.getHeaderName ().equals ("sdnc-request-header"));
66 assert (rt.getOperation ().length () == 0);
67 assert (rt.getAsyncInd ().equals ("N"));
68 assert (rt.getReqId ().equals ("reqId"));