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
42 * @throws MsoPropertiesException
45 public static final void prepare() throws MsoPropertiesException {
46 ClassLoader classLoader = RequestTunablesTest.class.getClassLoader();
47 String path = classLoader.getResource("mso.properties").toString().substring(5);
49 msoPropertiesFactory.initializeMsoProperties(RequestTunables.MSO_PROP_SDNC_ADAPTER, path);
55 * {@link org.openecomp.mso.adapters.sdnc.impl.RequestTunables#RequestTunables(java.lang.String, java.lang.String, java.lang.String, java.lang.String)}
59 public final void testRequestTunables() {
60 RequestTunables rt = new RequestTunables(null, null, "op", null, msoPropertiesFactory);
61 assert (rt.getReqId().length() == 0);
62 rt = new RequestTunables("reqId", "msoAction", null, "query", msoPropertiesFactory);
64 System.out.println(rt.toString());
65 // assert (rt.getReqMethod ().equals ("toto"));
66 assert (rt.getTimeout() != null);
67 assert (rt.getAction().equals("query"));
68 assert (rt.getMsoAction().equals("msoAction"));
69 assert (rt.getHeaderName().equals("sdnc-request-header"));
70 assert (rt.getOperation().length() == 0);
71 assert (rt.getAsyncInd().equals("N"));
72 assert (rt.getReqId().equals("reqId"));