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 java.lang.reflect.Constructor;
24 import java.lang.reflect.InvocationTargetException;
25 import java.lang.reflect.Method;
27 import org.junit.BeforeClass;
28 import org.junit.Test;
30 import org.openecomp.mso.properties.MsoJavaProperties;
31 import org.openecomp.mso.properties.MsoPropertiesException;
32 import org.openecomp.mso.properties.MsoPropertiesFactory;
34 public class RequestTunablesTest {
36 public static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory();
39 * This method is called before any test occurs.
40 * It creates a fake tree from scratch
41 * @throws MsoPropertiesException
44 public static final void prepare () throws MsoPropertiesException {
45 ClassLoader classLoader = RequestTunablesTest.class.getClassLoader ();
46 String path = classLoader.getResource ("mso.properties").toString ().substring (5);
48 msoPropertiesFactory.initializeMsoProperties(RequestTunables.MSO_PROP_SDNC_ADAPTER, path);
54 * {@link org.openecomp.mso.adapters.sdnc.impl.RequestTunables#RequestTunables(java.lang.String, java.lang.String, java.lang.String, java.lang.String)}
58 public final void testRequestTunables () {
59 RequestTunables rt = new RequestTunables (null, null, "op", null,msoPropertiesFactory);
60 assert(rt.getReqId ().length ()==0);
61 rt = new RequestTunables ("reqId", "msoAction", null, "query",msoPropertiesFactory);
63 System.out.println(rt.toString ());
64 // assert (rt.getReqMethod ().equals ("toto"));
65 assert (rt.getTimeout () != null);
66 assert (rt.getAction ().equals ("query"));
67 assert (rt.getMsoAction ().equals ("msoAction"));
68 assert (rt.getHeaderName ().equals ("sdnc-request-header"));
69 assert (rt.getOperation ().length () == 0);
70 assert (rt.getAsyncInd ().equals ("N"));
71 assert (rt.getReqId ().equals ("reqId"));