diff options
Diffstat (limited to 'adapters/mso-sdnc-adapter/src/test')
28 files changed, 828 insertions, 697 deletions
diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/BaseTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/BaseTest.java new file mode 100644 index 0000000000..29a1db89aa --- /dev/null +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/BaseTest.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.sdnc; + +import org.junit.After; +import org.junit.Rule; +import org.junit.rules.ExpectedException; +import org.junit.runner.RunWith; +import org.onap.so.cloud.Application; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.client.TestRestTemplate; +import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@ActiveProfiles("test") +@AutoConfigureWireMock(port = 0) +public abstract class BaseTest { + @Rule + public ExpectedException expectedException = ExpectedException.none(); + + protected TestRestTemplate restTemplate = new TestRestTemplate("test", "test"); + + @Value("${wiremock.server.port}") + protected String wireMockPort; + + @After + public void after() { + + } +} diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/FileUtil.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/FileUtil.java new file mode 100644 index 0000000000..f2fba5900f --- /dev/null +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/FileUtil.java @@ -0,0 +1,76 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.sdnc; + +import org.onap.so.logger.MsoLogger; + +import java.io.IOException; +import java.io.InputStream; + +/** + * file utility class + */ +public class FileUtil { + + private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, FileUtil.class); + + /** + * Read the specified resource file and return the contents as a String. + * + * @param fileName Name of the resource file + * @return the contents of the resource file as a String + * @throws IOException if there is a problem reading the file + */ + public static String readResourceFile(String fileName) { + InputStream stream; + try { + stream = getResourceAsStream(fileName); + byte[] bytes; + bytes = new byte[stream.available()]; + if(stream.read(bytes) > 0) { + stream.close(); + return new String(bytes); + } else { + stream.close(); + return ""; + } + } catch (IOException e) { + LOGGER.debug("Exception:", e); + return ""; + } + } + + /** + * Get an InputStream for the resource specified. + * + * @param resourceName Name of resource for which to get InputStream. + * @return an InputStream for the resource specified. + * @throws IOException If we can't get the InputStream for whatever reason. + */ + private static InputStream getResourceAsStream(String resourceName) throws IOException { + InputStream stream = + FileUtil.class.getClassLoader().getResourceAsStream(resourceName); + if (stream == null) { + throw new IOException("Can't access resource '" + resourceName + "'"); + } + return stream; + } +} diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/ObjectFactoryTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/ObjectFactoryTest.java index c3949a6a79..7a9b039089 100644 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/ObjectFactoryTest.java +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/ObjectFactoryTest.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.openecomp.mso.adapters.sdnc; +package org.onap.so.adapters.sdnc; import static org.assertj.core.api.Assertions.assertThat; import static org.hamcrest.CoreMatchers.containsString; @@ -45,7 +45,7 @@ public class ObjectFactoryTest { private Unmarshaller jaxbUnmarshaller; /** - * Test method for {@link org.openecomp.mso.adapters.sdnc.ObjectFactory#createRequestHeader()}. + * Test method for {@link org.onap.so.adapters.sdnc.ObjectFactory#createRequestHeader()}. */ @Test public final void testCreateRequestHeader () { @@ -94,7 +94,7 @@ public class ObjectFactoryTest { } /** - * Test method for {@link org.openecomp.mso.adapters.sdnc.ObjectFactory#createSDNCAdapterResponse()}. + * Test method for {@link org.onap.so.adapters.sdnc.ObjectFactory#createSDNCAdapterResponse()}. */ @Test public final void testCreateSDNCAdapterResponse () { diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterRequestTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/SDNCAdapterRequestTest.java index b9d88406f9..e0a1982db1 100644 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/SDNCAdapterRequestTest.java +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/SDNCAdapterRequestTest.java @@ -19,15 +19,15 @@ */ -package org.openecomp.mso.adapters.sdnc; +package org.onap.so.adapters.sdnc; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.BeforeClass; import org.junit.Test; -import org.openecomp.mso.adapters.sdnc.SDNCAdapterRequest; -import org.openecomp.mso.adapters.sdnc.RequestHeader; +import org.onap.so.adapters.sdnc.SDNCAdapterRequest; +import org.onap.so.adapters.sdnc.RequestHeader; public class SDNCAdapterRequestTest { diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/client/CallbackHeaderTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/client/CallbackHeaderTest.java index 39518e2081..dbb5c9aa44 100644 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/client/CallbackHeaderTest.java +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/client/CallbackHeaderTest.java @@ -1,24 +1,24 @@ /* * ============LICENSE_START======================================================= -* ONAP : SO -* ================================================================================ -* Copyright 2018 TechMahindra -*================================================================================= -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============LICENSE_END========================================================= + * ONAP : SO + * ================================================================================ + * Copyright (C) 2018 TechMahindra + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= */ -package org.openecomp.mso.adapters.sdnc.client; +package org.onap.so.adapters.sdnc.client; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/client/SDNCAdapterCallbackRequestTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/client/SDNCAdapterCallbackRequestTest.java index ecffd1c5ad..d7f4f8e6f7 100644 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/client/SDNCAdapterCallbackRequestTest.java +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/client/SDNCAdapterCallbackRequestTest.java @@ -19,14 +19,14 @@ */ -package org.openecomp.mso.adapters.sdnc.client; +package org.onap.so.adapters.sdnc.client; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.openecomp.mso.adapters.sdnc.client.CallbackHeader; -import org.openecomp.mso.adapters.sdnc.client.SDNCAdapterCallbackRequest; +import org.onap.so.adapters.sdnc.client.CallbackHeader; +import org.onap.so.adapters.sdnc.client.SDNCAdapterCallbackRequest; public class SDNCAdapterCallbackRequestTest { diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/MapRequestTunablesTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/MapRequestTunablesTest.java new file mode 100644 index 0000000000..cd93f6e71b --- /dev/null +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/MapRequestTunablesTest.java @@ -0,0 +1,128 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.sdnc.impl; + +import static com.shazam.shazamcrest.MatcherAssert.assertThat; +import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.so.adapters.sdnc.SDNCAdapterApplication; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = SDNCAdapterApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@ActiveProfiles("test") +public class MapRequestTunablesTest { + + @Autowired + private MapRequestTunables tunableMapper; + + @Test + public void test_setTunables(){ + RequestTunables expectedResult = new RequestTunables("testReqId", "","vnf-topology-operation","assign"); + expectedResult.setAsyncInd("N"); + expectedResult.setSdncUrl("https://localhost:8443/restconf/operations/VNF-API:vnf-topology-operation"); + expectedResult.setTimeout("270000"); + expectedResult.setReqMethod("POST"); + expectedResult.setHeaderName("sdnc-request-header"); + expectedResult.setNamespace("org:openecomp:sdnctl:vnf"); + + RequestTunables testMapper = new RequestTunables("testReqId", "","vnf-topology-operation","assign"); + + RequestTunables mappedTunable = tunableMapper.setTunables(testMapper); + + assertThat(mappedTunable, sameBeanAs(expectedResult)); + } + + @Test + public void test_setTunables_EmptyOperation_EmptyMSOAction(){ + RequestTunables expectedResult = new RequestTunables("testReqId", "","","query"); + expectedResult.setAsyncInd("N"); + expectedResult.setSdncUrl("http://localhost:8443/restconf/operations/GENERIC-RESOURCE-API:"); + expectedResult.setTimeout("60000"); + expectedResult.setReqMethod("GET"); + expectedResult.setHeaderName("sdnc-request-header"); + expectedResult.setNamespace(""); + + RequestTunables testMapper = new RequestTunables("testReqId", "","","query"); + + RequestTunables mappedTunable = tunableMapper.setTunables(testMapper); + + assertThat(mappedTunable, sameBeanAs(expectedResult)); + } + + @Test + public void test_setTunables_EmptyOperation(){ + RequestTunables expectedResult = new RequestTunables("testReqId", "infra","","query"); + expectedResult.setAsyncInd("N"); + expectedResult.setSdncUrl("https://localhost:8443/restconf/config"); + expectedResult.setTimeout("60000"); + expectedResult.setReqMethod("GET"); + expectedResult.setHeaderName("sdnc-request-header"); + expectedResult.setNamespace(""); + + RequestTunables testMapper = new RequestTunables("testReqId", "infra","","query"); + + RequestTunables mappedTunable = tunableMapper.setTunables(testMapper); + + assertThat(mappedTunable, sameBeanAs(expectedResult)); + } + + @Test + public void test_setTunables_EmptyOperation_EmptyMSOActionPUT(){ + RequestTunables expectedResult = new RequestTunables("testReqId", "","","put"); + expectedResult.setAsyncInd("N"); + expectedResult.setSdncUrl("https://localhost:8443/restconf/config"); + expectedResult.setTimeout("60000"); + expectedResult.setReqMethod("PUT"); + expectedResult.setHeaderName("sdnc-request-header"); + expectedResult.setNamespace(""); + + RequestTunables testMapper = new RequestTunables("testReqId", "","","put"); + + RequestTunables mappedTunable = tunableMapper.setTunables(testMapper); + + assertThat(mappedTunable, sameBeanAs(expectedResult)); + } + + + @Test + public void test_setTunables_EmptyOperation_EmptyMSOActionRESTDELETE(){ + RequestTunables expectedResult = new RequestTunables("testReqId", "","","restdelete"); + expectedResult.setAsyncInd("N"); + expectedResult.setSdncUrl("https://localhost:8443/restconf/config"); + expectedResult.setTimeout("60000"); + expectedResult.setReqMethod("DELETE"); + expectedResult.setHeaderName("sdnc-request-header"); + expectedResult.setNamespace(""); + + RequestTunables testMapper = new RequestTunables("testReqId", "","","restdelete"); + + RequestTunables mappedTunable = tunableMapper.setTunables(testMapper); + + assertThat(mappedTunable, sameBeanAs(expectedResult)); + } + +} diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/SDNCAdapterPortTypeImplTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/SDNCAdapterPortTypeImplTest.java new file mode 100644 index 0000000000..8f73c02285 --- /dev/null +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/SDNCAdapterPortTypeImplTest.java @@ -0,0 +1,111 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.sdnc.impl; + +import static org.junit.Assert.fail; + +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.so.adapters.sdnc.RequestHeader; +import org.onap.so.adapters.sdnc.SDNCAdapterApplication; +import org.onap.so.adapters.sdnc.SDNCAdapterPortType; +import org.onap.so.adapters.sdnc.SDNCAdapterRequest; +import org.onap.so.adapters.sdnc.SDNCAdapterResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringRunner; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = SDNCAdapterApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@ActiveProfiles({"test","non-async"}) +public class SDNCAdapterPortTypeImplTest { + + @Autowired + private SDNCAdapterPortType sdncAdapter; + + + SDNCAdapterRequest sdncAdapterRequest; + + public void setupTestEntities() throws ParserConfigurationException, SAXException, IOException, TransformerException { + buildTestRequest(); + } + + private void buildTestRequest() throws ParserConfigurationException, SAXException, IOException, TransformerException { + sdncAdapterRequest= new SDNCAdapterRequest(); + File fXmlFile = new File("src/test/resources/sdncTestPayload.xml"); + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); + Document doc = dBuilder.parse(fXmlFile); + StringWriter sw = new StringWriter(); + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer transformer = tf.newTransformer(); + transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no"); + transformer.setOutputProperty(OutputKeys.METHOD, "xml"); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); + + transformer.transform(new DOMSource(doc), new StreamResult(sw)); + System.out.println(sw.toString()); + sdncAdapterRequest.setRequestData(sw.toString()); + RequestHeader requestHeader = new RequestHeader(); + requestHeader.setCallbackUrl("http://localhost:9090/callback"); + requestHeader.setMsoAction("gammainternet"); + requestHeader.setRequestId("testReqId"); + requestHeader.setSvcAction("assign"); + requestHeader.setSvcInstanceId("servInstanceId"); + requestHeader.setSvcOperation("svc-topology-operation"); + sdncAdapterRequest.setRequestHeader(requestHeader ); + } + + + + @Test + public void sendRequest() throws ParserConfigurationException, SAXException, IOException, TransformerException { + // Given + setupTestEntities(); + + // When + SDNCAdapterResponse response = sdncAdapter.sdncAdapter(sdncAdapterRequest); + if(response ==null) + fail("Null infraRequest"); + + // Then + //assertThat(infraRequest, sameBeanAs(testRequest).ignoring("requestBody").ignoring("endTime").ignoring("startTime").ignoring("modifyTime")); + } +} diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/SDNCResponseTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/SDNCResponseTest.java new file mode 100644 index 0000000000..498fa3fa6d --- /dev/null +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/SDNCResponseTest.java @@ -0,0 +1,49 @@ +/* +* ============LICENSE_START======================================================= + * ONAP : SO + * ================================================================================ + * Copyright (C) 2018 TechMahindra + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= +*/ +package org.onap.so.adapters.sdnc.impl; + +import static org.junit.Assert.*; + +import org.junit.Test; + +public class SDNCResponseTest { + + private SDNCResponse sdncresponse = new SDNCResponse(null, 0, null); + + @Test + public void testSDNCResponse() + { + sdncresponse.setReqId("reqId"); + sdncresponse.setRespCode(0); + sdncresponse.setRespMsg("respMsg"); + sdncresponse.setSdncRespXml("sdncRespXml"); + assertEquals(sdncresponse.getReqId(), "reqId"); + assertEquals(sdncresponse.getRespCode(), 0); + assertEquals(sdncresponse.getRespMsg(), "respMsg"); + assertEquals(sdncresponse.getSdncRespXml(),"sdncRespXml"); + } + + @Test + public void testtoString() + { + assertNotNull(sdncresponse.toString()); + } +} + diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/SDNCRestClientTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/SDNCRestClientTest.java new file mode 100644 index 0000000000..076a9f3c6a --- /dev/null +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/SDNCRestClientTest.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.sdnc.impl; + +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.post; +import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; +import static org.junit.Assert.assertNotNull; + +import org.apache.http.HttpStatus; +import org.junit.Test; +import org.onap.so.adapters.sdnc.BaseTest; +import org.springframework.beans.factory.annotation.Autowired; +import static com.github.tomakehurst.wiremock.client.WireMock.*; + + +public class SDNCRestClientTest extends BaseTest { + + @Autowired + private SDNCRestClient sdncClient; + + @Test + public void getSdncRespTestException() { + + RequestTunables rt = new RequestTunables("", "", "", ""); + rt.setTimeout("1000"); + rt.setReqMethod("POST"); + rt.setSdncUrl("http://localhost:" + wireMockPort + "/sdnc"); + + stubFor(post(urlPathEqualTo("/sdnc")) + .willReturn(aResponse().withHeader("Content-Type", "application/xml").withBody("").withStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR))); + + SDNCResponse response = sdncClient.getSdncResp("", rt); + assertNotNull(response); + } +} diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/UtilsTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/UtilsTest.java new file mode 100644 index 0000000000..596f26caa6 --- /dev/null +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/impl/UtilsTest.java @@ -0,0 +1,64 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.sdnc.impl; + +import static org.junit.Assert.assertEquals; +import java.io.File; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; +import org.junit.Test; +import org.onap.so.adapters.sdnc.SDNCAdapterRequest; +import org.w3c.dom.Document; +import org.w3c.dom.Node; + +public class UtilsTest { + + @Test + public final void testUnmarshal () { + + String expectedXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><feature-list xmlns=\"com:att:sdnctl:l3api\"><feature-type>FIREWALL-LITE</feature-type><feature-instance-id>mtjnj40evbc0eceb</feature-instance-id><feature-sub-type>SHARED</feature-sub-type><feature-instance-xpath>/restconf/config/Firewall-API:feature-model/feature-list/FIREWALL-LITE/mtjnj40evbc0eceb/</feature-instance-xpath> </feature-list>"; + + try { + + File file = new File("src/test/resources/sdncBpmnAdiodFirewallRequest.xml"); + JAXBContext jaxbContext = JAXBContext.newInstance(SDNCAdapterRequest.class); + + Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); + SDNCAdapterRequest request = (SDNCAdapterRequest) jaxbUnmarshaller.unmarshal(file); + + RequestTunables rt = new RequestTunables("0460ba40-60c8-4b07-8878-c8e8d87cde04-1527983610512", + "", + "/L3SDN-API:services/layer3-service-list/MIS%2F1806%2F25057%2FSW_INTERNET/service-data/feature-list/FIREWALL-LITE/", + "put"); + + Node node = (Node) request.getRequestData(); + Document reqDoc = node.getOwnerDocument(); + String sdncReqBody = Utils.genSdncPutReq(reqDoc, rt); + assertEquals(sdncReqBody.replaceAll("[\\t\\n\\r]+", ""), expectedXml); + + } catch (JAXBException e) { + e.printStackTrace(); + } + + } + +} diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/sdncrest/ObjectMappingTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/ObjectMappingTest.java index 1746360af0..88849015e0 100644 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/sdncrest/ObjectMappingTest.java +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/ObjectMappingTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,7 +17,8 @@ * limitations under the License. * ============LICENSE_END========================================================= */ -package org.openecomp.mso.adapters.sdnc.sdncrest; + +package org.onap.so.adapters.sdnc.sdncrest; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -30,10 +31,10 @@ import java.io.Serializable; import java.util.Arrays; import org.junit.Test; -import org.openecomp.mso.adapters.sdncrest.SDNCEvent; -import org.openecomp.mso.adapters.sdncrest.SDNCServiceError; -import org.openecomp.mso.adapters.sdncrest.SDNCServiceRequest; -import org.openecomp.mso.adapters.sdncrest.SDNCServiceResponse; +import org.onap.so.adapters.sdncrest.SDNCEvent; +import org.onap.so.adapters.sdncrest.SDNCServiceError; +import org.onap.so.adapters.sdncrest.SDNCServiceRequest; +import org.onap.so.adapters.sdncrest.SDNCServiceResponse; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; @@ -125,11 +126,11 @@ public class ObjectMappingTest { assertEquals("IST15_0902_3003", object.getServiceInformation().getSubscriberGlobalId()); assertEquals("http://localhost:8080/mso/SDNCAdapterCallbackService", object.getBPNotificationUrl()); assertEquals("PT5M", object.getBPTimeout()); - assertEquals("413658f4-7f42-482e-b834-23a5c15657da-1474471336781", object.getSDNCRequestId()); - assertEquals("vhnf", object.getSDNCService()); - assertEquals("service-topology-cust-assign-operation", object.getSDNCOperation()); - assertEquals("XML", object.getSDNCServiceDataType()); - assertTrue(object.getSDNCServiceData().startsWith("<vhnf-cust-stage-information>")); + assertEquals("413658f4-7f42-482e-b834-23a5c15657da-1474471336781", object.getSdncRequestId()); + assertEquals("vhnf", object.getSdncService()); + assertEquals("service-topology-cust-assign-operation", object.getSdncOperation()); + assertEquals("XML", object.getSdncServiceDataType()); + assertTrue(object.getSdncServiceData().startsWith("<vhnf-cust-stage-information>")); } @Test @@ -153,11 +154,11 @@ public class ObjectMappingTest { assertEquals("IST15_0902_3003", object.getServiceInformation().getSubscriberGlobalId()); assertEquals("http://localhost:8080/mso/SDNCAdapterCallbackService", object.getBPNotificationUrl()); assertNull(object.getBPTimeout()); - assertEquals("413658f4-7f42-482e-b834-23a5c15657da-1474471336781", object.getSDNCRequestId()); - assertEquals("vhnf", object.getSDNCService()); - assertEquals("service-topology-cust-assign-operation", object.getSDNCOperation()); - assertEquals("XML", object.getSDNCServiceDataType()); - assertTrue(object.getSDNCServiceData().startsWith("<vhnf-cust-stage-information>")); + assertEquals("413658f4-7f42-482e-b834-23a5c15657da-1474471336781", object.getSdncRequestId()); + assertEquals("vhnf", object.getSdncService()); + assertEquals("service-topology-cust-assign-operation", object.getSdncOperation()); + assertEquals("XML", object.getSdncServiceDataType()); + assertTrue(object.getSdncServiceData().startsWith("<vhnf-cust-stage-information>")); } @Test @@ -222,7 +223,7 @@ public class ObjectMappingTest { json = json.replace(EOL + "((RESPONSE-PARAMS))", "," + EOL + " \"params\": " + PARAMS + EOL); SDNCServiceResponse object = mapper.readValue(json, SDNCServiceResponse.class); - assertEquals("413658f4-7f42-482e-b834-23a5c15657da-1474471336781", object.getSDNCRequestId()); + assertEquals("413658f4-7f42-482e-b834-23a5c15657da-1474471336781", object.getSdncRequestId()); assertEquals("200", object.getResponseCode()); assertEquals("OK", object.getResponseMessage()); assertEquals("Y", object.getAckFinalIndicator()); @@ -244,7 +245,7 @@ public class ObjectMappingTest { json = json.replace("((RESPONSE-PARAMS))", ""); SDNCServiceResponse object = mapper.readValue(json, SDNCServiceResponse.class); - assertEquals("413658f4-7f42-482e-b834-23a5c15657da-1474471336781", object.getSDNCRequestId()); + assertEquals("413658f4-7f42-482e-b834-23a5c15657da-1474471336781", object.getSdncRequestId()); assertEquals("200", object.getResponseCode()); assertNull(object.getResponseMessage()); assertEquals("Y", object.getAckFinalIndicator()); @@ -314,7 +315,7 @@ public class ObjectMappingTest { json = json.replace("((RESPONSE-MESSAGE))", "\"responseMessage\": \"" + "SOMETHING BAD" + "\"," + EOL); SDNCServiceError object = mapper.readValue(json, SDNCServiceError.class); - assertEquals("413658f4-7f42-482e-b834-23a5c15657da-1474471336781", object.getSDNCRequestId()); + assertEquals("413658f4-7f42-482e-b834-23a5c15657da-1474471336781", object.getSdncRequestId()); assertEquals("500", object.getResponseCode()); assertEquals("SOMETHING BAD", object.getResponseMessage()); assertEquals("Y", object.getAckFinalIndicator()); @@ -332,7 +333,7 @@ public class ObjectMappingTest { json = json.replace("((RESPONSE-MESSAGE))", ""); SDNCServiceError object = mapper.readValue(json, SDNCServiceError.class); - assertEquals("413658f4-7f42-482e-b834-23a5c15657da-1474471336781", object.getSDNCRequestId()); + assertEquals("413658f4-7f42-482e-b834-23a5c15657da-1474471336781", object.getSdncRequestId()); assertEquals("500", object.getResponseCode()); assertNull(object.getResponseMessage()); assertEquals("Y", object.getAckFinalIndicator()); diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnectorTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnectorTest.java new file mode 100644 index 0000000000..23830ae3f3 --- /dev/null +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnectorTest.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.sdnc.sdncrest; + +import org.apache.http.HttpStatus; +import org.junit.Test; +import org.onap.so.adapters.sdnc.BaseTest; +import org.onap.so.adapters.sdncrest.SDNCResponseCommon; +import org.springframework.beans.factory.annotation.Autowired; + +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static com.github.tomakehurst.wiremock.client.WireMock.post; +import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; +import static org.junit.Assert.assertNotNull; +import static com.github.tomakehurst.wiremock.client.WireMock.*; + +public class SDNCConnectorTest extends BaseTest { + + @Autowired + private SDNCConnector sdncConnector; + + @Test + public void sendTest() { + String content = "<dummy><service-instance-id>1234</service-instance-id></dummy>"; + + String response = "<errors xmlns=\"urn:ietf:params:xml:ns:yang:ietf-restconf\">\n" + + "\t\t// <error>\n" + + "\t\t// <error-type>protocol</error-type>\n" + + "\t\t// <error-tag>malformed-message</error-tag>\n" + + "\t\t// <error-message>Error parsing input: The element type \"input\" must be terminated by the matching end-tag \"</input>\".</error-message>\n" + + "\t\t// </error>\n" + + "\t\t// </errors>"; + + TypedRequestTunables rt = new TypedRequestTunables("", ""); + rt.setTimeout("1000"); + rt.setReqMethod("POST"); + rt.setSdncUrl("http://localhost:" + wireMockPort + "/sdnc"); + + stubFor(post(urlPathEqualTo("/sdnc")) + .willReturn(aResponse().withHeader("Content-Type", "application/xml").withBody(response).withStatus(HttpStatus.SC_MULTIPLE_CHOICES))); + + SDNCResponseCommon responseCommon = sdncConnector.send(content, rt); + assertNotNull(responseCommon); + } +} diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/sdncrest/BPRestCallbackTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnectorTest.java index 91cf2c91c7..eddd74b213 100644 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/sdncrest/BPRestCallbackTest.java +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestConnectorTest.java @@ -2,14 +2,14 @@ * ============LICENSE_START======================================================= * ONAP - SO * ================================================================================ - * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - *l + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -18,21 +18,22 @@ * ============LICENSE_END========================================================= */ -package org.openecomp.mso.adapters.sdnc.sdncrest; +package org.onap.so.adapters.sdnc.sdncrest; import org.junit.Test; +import org.onap.so.adapters.sdnc.FileUtil; +import org.onap.so.adapters.sdncrest.SDNCResponseCommon; -import static junit.framework.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; - -public class BPRestCallbackTest { +public class SDNCServiceRequestConnectorTest { @Test - public void testBPRestCallbackException() { + public void parseResponseContentTest() throws Exception { - BPRestCallback test = new BPRestCallback(); - test.send("workflow/","messageType","correlator","message"); - assertFalse(test.send("workflowMessageUrl/", "messageType", "correlator", "message")); + String content = FileUtil.readResourceFile("SdncServiceResponse.xml"); + SDNCResponseCommon responseCommon = SDNCServiceRequestConnector.parseResponseContent(content); + assertNotNull(responseCommon); } } diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/util/SDNCRequestIdUtilTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/util/SDNCRequestIdUtilTest.java index 77d22e44df..7ba8b68602 100644 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/util/SDNCRequestIdUtilTest.java +++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/util/SDNCRequestIdUtilTest.java @@ -18,18 +18,19 @@ * ============LICENSE_END========================================================= */ -package org.openecomp.mso.adapters.sdnc.util; +package org.onap.so.adapters.sdnc.util; import static org.junit.Assert.assertEquals; import java.util.UUID; + import org.junit.Test; public class SDNCRequestIdUtilTest { /** - * Test method for {@link org.openecomp.mso.adapters.sdnc.SDNCRequestIdUtil#getSDNCOriginalRequestId()}. + * Test method for {@link org.onap.so.adapters.sdnc.SDNCRequestIdUtil#getSDNCOriginalRequestId()}. */ @Test public final void testGetSDNCOriginalRequestId () { diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/InvestigationTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/InvestigationTest.java deleted file mode 100644 index 234a9d2272..0000000000 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/InvestigationTest.java +++ /dev/null @@ -1,114 +0,0 @@ -/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.openecomp.mso.adapters.sdnc.impl;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.Scanner;
-import java.util.UUID;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.Test;
-import org.openecomp.mso.properties.MsoJavaProperties;
-import org.openecomp.mso.properties.MsoPropertiesException;
-import org.openecomp.mso.properties.MsoPropertiesFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-public class InvestigationTest {
-
- private static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory();
-
- public static final String SDNC_PROP = MsoJavaProperties.class.getClassLoader().getResource("mso.sdnc.properties").toString().substring(5);
-
- @Before
- public final void initBeforeEachTest() throws MsoPropertiesException {
- msoPropertiesFactory.removeAllMsoProperties();
- msoPropertiesFactory.initializeMsoProperties("MSO_PROP_SDNC_ADAPTER", SDNC_PROP);
- }
-
- @AfterClass
- public static final void kill () throws MsoPropertiesException {
-
- msoPropertiesFactory.removeMsoProperties("MSO_PROP_SDNC_ADAPTER");
- }
-
- @Test
- public void run() throws ParserConfigurationException, IOException, SAXException {
-
- RequestTunables rt = new RequestTunables("reqid","","svc-topology-operation","delete", msoPropertiesFactory);
- rt.setTunables();
- /*Document reqDoc = parse();
- NodeList nodeList = reqDoc.getElementsByTagName("sdncadapterworkflow:SDNCRequestData");
- Node node = null;
- System.out.println("nodeList length: "+ nodeList.getLength());
- for (int i =0; i<nodeList.getLength();i++){
- node = nodeList.item(i);
- }
-
- Document doc = nodeToDocument(node);
- */
- Scanner scanner = new Scanner( new File("src/test/resources/sdnc_adapter_request.xml") );
- String input = scanner.useDelimiter("\\A").next();
- System.out.println("input: "+input);
- scanner.close();
- try {
- DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- InputSource is = new InputSource();
- is.setCharacterStream(new StringReader(input));
- Document reqDoc = db.parse(is);
- String sdncReqBody = Utils.genSdncReq(reqDoc, rt);
- System.out.println(sdncReqBody);
- String uuid = UUID.randomUUID().toString();
- System.out.println("uuid: "+uuid);
- }catch(Exception ex) {
- throw new IllegalStateException();
- }
-
- }
- public static Document parse() throws ParserConfigurationException, IOException, SAXException {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setValidating(true);
- factory.setIgnoringElementContentWhitespace(true);
- DocumentBuilder builder = factory.newDocumentBuilder();
- File file = new File("src/test/resources/sdnc_adapter_request.xml");
- Document doc = builder.parse(file);
- return doc;
- }
- public static Document nodeToDocument (Node node) throws ParserConfigurationException {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document newDocument = builder.newDocument();
- Node importedNode = newDocument.importNode(node, true);
- newDocument.appendChild(importedNode);
- return newDocument;
- }
-}
- diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/RequestTunablesTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/RequestTunablesTest.java deleted file mode 100644 index 72b11708e6..0000000000 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/RequestTunablesTest.java +++ /dev/null @@ -1,86 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.adapters.sdnc.impl; - -import static org.junit.Assert.*; - -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.Test; - -import org.openecomp.mso.properties.MsoJavaProperties; -import org.openecomp.mso.properties.MsoPropertiesException; -import org.openecomp.mso.properties.MsoPropertiesFactory; - -public class RequestTunablesTest { - - private static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory(); - - public static final String SDNC_PROP = MsoJavaProperties.class.getClassLoader().getResource("mso.sdnc.properties").toString().substring(5); - - @Before - public final void initBeforeEachTest() throws MsoPropertiesException { - msoPropertiesFactory.removeAllMsoProperties(); - msoPropertiesFactory.initializeMsoProperties("MSO_PROP_SDNC_ADAPTER", SDNC_PROP); - } - - @AfterClass - public static final void kill () throws MsoPropertiesException { - - msoPropertiesFactory.removeMsoProperties("MSO_PROP_SDNC_ADAPTER"); - } - - /** - * Test method for - * {@link org.openecomp.mso.adapters.sdnc.impl.RequestTunables#RequestTunables(java.lang.String, java.lang.String, java.lang.String, java.lang.String)} - * . - */ - @Test - public final void testRequestTunables () { - RequestTunables rt = new RequestTunables (null, null, "op", null,msoPropertiesFactory); - assertEquals(0, rt.getReqId ().length ()); - rt = new RequestTunables ("reqId", "msoAction", null, "query",msoPropertiesFactory); - rt.setTunables (); - System.out.println(rt.toString ()); - // assert (rt.getReqMethod ().equals ("toto")); - assertNotNull(rt.getTimeout ()); - assertEquals("query", rt.getAction ()); - assertEquals("msoAction", rt.getMsoAction ()); - assertEquals("sdnc-request-header", rt.getHeaderName ()); - assertEquals(0, rt.getOperation ().length ()); - assertEquals("N", rt.getAsyncInd ()); - assertEquals("reqId", rt.getReqId ()); - } - - @Test - public final void testRequestTunablesSet() { - RequestTunables rt = new RequestTunables("reqId", "gammainternet", "service-configuration-operation", "changeactivate", msoPropertiesFactory); - rt.setTunables (); - assertNotNull(rt.getTimeout ()); - assertEquals("changeactivate", rt.getAction ()); - assertEquals("gammainternet", rt.getMsoAction ()); - assertEquals("sdnc-request-header", rt.getHeaderName ()); - assertEquals("service-configuration-operation", rt.getOperation ()); - assertEquals("N", rt.getAsyncInd ()); - assertEquals("reqId", rt.getReqId ()); - } - -} diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImplTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImplTest.java deleted file mode 100644 index 98b368f5fa..0000000000 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/SDNCAdapterRestImplTest.java +++ /dev/null @@ -1,79 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.adapters.sdnc.impl; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.openecomp.mso.HealthCheckUtils; -import org.openecomp.mso.logger.MsoLogger; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -import javax.ws.rs.core.Response; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.any; -import static org.mockito.Mockito.when; - -@RunWith(PowerMockRunner.class) -@PrepareForTest(SDNCAdapterRestImpl.class) -public class SDNCAdapterRestImplTest { - - SDNCAdapterRestImpl test; - - @Before - public void init(){ - - test = new SDNCAdapterRestImpl(); - } - - @Test - public void testBadReqNoServiceRsp() { - - HealthCheckUtils hCU = PowerMockito.mock(HealthCheckUtils.class); - try { - PowerMockito.whenNew(HealthCheckUtils.class).withNoArguments().thenReturn(hCU); - when(hCU.siteStatusCheck(any(MsoLogger.class))).thenReturn(true); - - } catch (Exception e) { - e.printStackTrace(); - } - - String reqXML = "<xml>test</xml>"; - - Response response = test.MSORequest(reqXML); - assertEquals(400,response.getStatus()); - - response = test.healthcheck("1a25a7c0-4c91-4f74-9a78-8c11b7a57f1a"); - assertEquals(503,response.getStatus()); - - response = test.globalHealthcheck(true); - assertEquals(503,response.getStatus()); - - response = test.nodeHealthcheck(); - assertEquals(503,response.getStatus()); - - } - -} - diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/SDNCResponseTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/SDNCResponseTest.java deleted file mode 100644 index f9c885f0eb..0000000000 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/impl/SDNCResponseTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* -* ============LICENSE_START======================================================= -* ONAP : SO -* ================================================================================ -* Copyright 2018 TechMahindra -*================================================================================= -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* ============LICENSE_END========================================================= -*/ -package org.openecomp.mso.adapters.sdnc.impl; - -import static org.junit.Assert.*; - -import org.junit.Test; - -public class SDNCResponseTest { - - private SDNCResponse sdncresponse = new SDNCResponse(null, 0, null); - - @Test - public void testSDNCResponse() - { - sdncresponse.setReqId("reqId"); - sdncresponse.setRespCode(0); - sdncresponse.setRespMsg("respMsg"); - sdncresponse.setSdncRespXml("sdncRespXml"); - assertEquals(sdncresponse.getReqId(), "reqId"); - assertEquals(sdncresponse.getRespCode(), 0); - assertEquals(sdncresponse.getRespMsg(), "respMsg"); - assertEquals(sdncresponse.getSdncRespXml(),"sdncRespXml"); - } - - @Test - public void testtoString() - { - assertNotNull(sdncresponse.toString()); - } -} -
\ No newline at end of file diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/notify/SDNCNotifyResourceTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/notify/SDNCNotifyResourceTest.java deleted file mode 100644 index 75cd360663..0000000000 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/notify/SDNCNotifyResourceTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - *l - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.adapters.sdnc.notify; - -import org.junit.Test; -import org.mockito.Mock; - -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.Response; - -import static org.junit.Assert.assertEquals; - -public class SDNCNotifyResourceTest { - - @Mock - HttpServletRequest httpServletRequest; - - SDNCNotifyResource test = new SDNCNotifyResource(); - - @Test - public void testPrintMessage() { - - Response response = test.printMessage(); - assertEquals(200, response.getStatus()); - - response = test.printMessageParam("msg"); - assertEquals(200, response.getStatus()); - - String reqXML = "<xml>test</xml>"; - response = test.SDNCNotify(reqXML, httpServletRequest); - assertEquals(400, response.getStatus()); - - } -} diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/sdncrest/TypedRequestTunablesTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/sdncrest/TypedRequestTunablesTest.java deleted file mode 100644 index 5651f8adab..0000000000 --- a/adapters/mso-sdnc-adapter/src/test/java/org/openecomp/mso/adapters/sdnc/sdncrest/TypedRequestTunablesTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.adapters.sdnc.sdncrest; - -import org.junit.Assert; -import org.junit.Test; - -import static junit.framework.Assert.assertEquals; - -public class TypedRequestTunablesTest { - - @Test - public void testTypedRequestTunables() { - - TypedRequestTunables test = new TypedRequestTunables("reqId","myUrlSuffix"); - test.setServiceKey("service","operation"); - assertEquals(test.getReqId(),"reqId"); - Assert.assertNull(test.getError()); - Assert.assertNull(test.getReqMethod()); - Assert.assertNull(test.getTimeout()); - Assert.assertNull(test.getSdncUrl()); - Assert.assertNull(test.getHeaderName()); - Assert.assertNull(test.getNamespace()); - Assert.assertNull(test.getMyUrl()); - Assert.assertFalse(test.setTunables()); - - } - -} - diff --git a/adapters/mso-sdnc-adapter/src/test/resources/SdncServiceResponse.xml b/adapters/mso-sdnc-adapter/src/test/resources/SdncServiceResponse.xml new file mode 100644 index 0000000000..1aeda73bdf --- /dev/null +++ b/adapters/mso-sdnc-adapter/src/test/resources/SdncServiceResponse.xml @@ -0,0 +1,12 @@ +<input> + <configuration-response-common> + <svc-request-id>8ac1f688-70d1-4eb7-8422-5bf3ffe5c1ff-1525453645560</svc-request-id> + <response-code>200</response-code> + <response-message>Success: Activation Success</response-message> + <ack-final-indicator>Y</ack-final-indicator> + <response-parameters> + <tag-name>test</tag-name> + <tag-value>test</tag-value> + </response-parameters> + </configuration-response-common> +</input>
\ No newline at end of file diff --git a/adapters/mso-sdnc-adapter/src/test/resources/application-test.properties b/adapters/mso-sdnc-adapter/src/test/resources/application-test.properties new file mode 100644 index 0000000000..1ae9269ffa --- /dev/null +++ b/adapters/mso-sdnc-adapter/src/test/resources/application-test.properties @@ -0,0 +1,102 @@ +#MSO SDNCA Properties go here +### +### UNIQUE SDNCURLs for Requests supported by SDNCA. URLS have unique tags eg a format like sdncurlXY (XY is unique eg digits) +### +org.onap.so.adapters.sdnc.sdncurl5=https://localhost:8443/restconf/config +org.onap.so.adapters.sdnc.sdncurl6=https://localhost:8443/restconf/operations/VNF-API: +org.onap.so.adapters.sdnc.sdncurl9=https://localhost:8443/restconf/operations/NORTHBOUND-API:service-topology-operation +org.onap.so.adapters.sdnc.sdncurl10=https://localhost:8443/restconf/operations/GENERIC-RESOURCE-API: +org.onap.so.adapters.sdnc.sdncurl12=https://localhost:8443/ +org.onap.so.adapters.sdnc.sdncurl14=http://localhost:8443/restconf/operations/GENERIC-RESOURCE-API: +### BPEL ASYNC CALLBACK/NOTIFICATION URL +### +org.onap.so.adapters.sdnc.bpelurl=http://localhost:8089/mso/SDNCAdapterCallbackService +org.onap.so.adapters.sdnc.rest.bpelurl=http://localhost:${wiremock.server.port}/mso/WorkflowMessage +### +### SDNC ASYNC NOTIFICATION/RESPONSE URL +### +org.onap.so.adapters.sdnc.myurl=http://localhost:8080/adapters/rest/SDNCNotify +### Production value diff from other servers +org.onap.so.adapters.sdnc.sdncauth=406B2AE613211B6FB52466DE6E1769AC +org.onap.so.adapters.sdnc.bpelauth=F8E9452B55DDE4CCE77547B0E748105C54CF5EF1351B4E2CBAABF2981EFE776D +org.onap.so.adapters.sdnc.sdncconnecttime=5000 +### +### Distinct Requests Supported by SDNCA. sdncurls added on top of file. fields may be null eg msoaction,operation resulting in .. construct +### +###org.onap.so.adapters.sdnc.MSOACTION.OPERATION.ACTION=METHOD|TIMEOUT|URL|HEADERNAME|NAMESPACE +### +org.onap.so.adapters.sdnc.infra..query=GET|60000|sdncurl5| +org.onap.so.adapters.sdnc.vfmodule..query=GET|60000|sdncurl12| +org.onap.so.adapters.sdnc...query=GET|60000|sdncurl14| +org.onap.so.adapters.sdnc...put=PUT|60000|sdncurl5| +org.onap.so.adapters.sdnc...restdelete=DELETE|60000|sdncurl5| +org.onap.so.adapters.sdnc..vnf-topology-operation.assign=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf +org.onap.so.adapters.sdnc..vnf-topology-operation.activate=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf +org.onap.so.adapters.sdnc..vnf-topology-operation.rollback=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf +org.onap.so.adapters.sdnc..vnf-topology-operation.delete=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf +org.onap.so.adapters.sdnc..vnf-topology-operation.changeassign=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf +org.onap.so.adapters.sdnc..vnf-topology-operation.changedelete=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf +org.onap.so.adapters.sdnc..network-topology-operation.reserve=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf +org.onap.so.adapters.sdnc..network-topology-operation.assign=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf +org.onap.so.adapters.sdnc..network-topology-operation.activate=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf +org.onap.so.adapters.sdnc..network-topology-operation.rollback=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf +org.onap.so.adapters.sdnc..network-topology-operation.delete=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf +org.onap.so.adapters.sdnc..network-topology-operation.changeassign=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf +org.onap.so.adapters.sdnc..network-topology-operation.changedelete=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf + + +org.onap.so.adapters.sdnc..service-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..service-topology-operation.rollback=POST|270000|sdncur10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..service-topology-operation.delete=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..service-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.network-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.network-topology-operation.unassign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.network-topology-operation.activate=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.network-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vnf-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vnf-topology-operation.activate=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vnf-topology-operation.unassign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vnf-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vnf-topology-operation.rollback=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vnf-topology-operation.delete=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vnf-topology-operation.changeassign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vnf-topology-operation.changedelete=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vf-module-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vf-module-topology-operation.activate=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vf-module-topology-operation.unassign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vf-module-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vf-module-topology-operation.rollback=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vf-module-topology-operation.delete=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vf-module-topology-operation.changeassign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc.generic-resource.vf-module-topology-operation.changedelete=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..contrail-route-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..contrail-route-topology-operation.unassign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..contrail-route-topology-operation.create=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..contrail-route-topology-operation.delete=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..contrail-route-topology-operation.activate=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..contrail-route-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..security-zone-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..security-zone-topology-operation.unassign=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..security-zone-topology-operation.create=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..security-zone-topology-operation.delete=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..security-zone-topology-operation.activate=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource +org.onap.so.adapters.sdnc..security-zone-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|org:onap:sdnc:northbound:generic-resource + + +### Application-dev.yaml file entries below + +server.port=8080 +server.tomcat.max-threads=50 +ssl-enable: false +spring.security.usercredentials[0].username=test +spring.security.usercredentials[0].password=$2a$12$Zi3AuYcZoZO/gBQyUtST2.F5N6HqcTtaNci2Et.ufsQhski56srIu +spring.security.usercredentials[0].role=SDNC-Client +management.endpoints.enabled-by-default=false +management.endpoint.info.enabled=true +mso.logPath=/app/logs/sdnc +mso.site-name=dev +mso.async.core-pool-size=50 +mso.async.max-pool-size=50 +mso.async.queue-capacity=500 +mso.catalog.db.spring.endpoint="http://localhost:" +mso.db.auth:Basic YnBlbDptc28tZGItMTUwNyE= diff --git a/adapters/mso-sdnc-adapter/src/test/resources/logback-test.xml b/adapters/mso-sdnc-adapter/src/test/resources/logback-test.xml index a66a1e8cd3..3a3e57ac9d 100644 --- a/adapters/mso-sdnc-adapter/src/test/resources/logback-test.xml +++ b/adapters/mso-sdnc-adapter/src/test/resources/logback-test.xml @@ -20,28 +20,33 @@ <configuration > - <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> - <encoder> - <pattern>%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}||%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}||%X{Timer}|%msg%n</pattern> - </encoder> - </appender> + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> + <encoder> + <pattern>%d{HH:mm:ss.SSS} [%thread] |%X{RequestId}| %-5level + %logger{1024} - %msg%n + </pattern> + </encoder> + </appender> - <logger name="com.att.eelf.audit" level="info" additivity="false"> + <logger name="com.att.eelf.audit" level="INFO" additivity="false"> <appender-ref ref="STDOUT" /> </logger> - <logger name="com.att.eelf.metrics" level="info" additivity="false"> + <logger name="com.att.eelf.metrics" level="INFO" additivity="false"> <appender-ref ref="STDOUT" /> </logger> - <logger name="com.att.eelf.error" level="trace" additivity="false"> + <logger name="com.att.eelf.error" level="WARN" additivity="false"> <appender-ref ref="STDOUT" /> </logger> + + <logger name="org.onap" level="${so.log.level:-DEBUG}" additivity="false"> + <appender-ref ref="STDOUT" /> + </logger> - <root level="info"> + <root level="WARN"> <appender-ref ref="STDOUT" /> </root> - </configuration> diff --git a/adapters/mso-sdnc-adapter/src/test/resources/mso.properties b/adapters/mso-sdnc-adapter/src/test/resources/mso.properties deleted file mode 100644 index 2428b512b1..0000000000 --- a/adapters/mso-sdnc-adapter/src/test/resources/mso.properties +++ /dev/null @@ -1,42 +0,0 @@ -### -# ============LICENSE_START======================================================= -# ECOMP MSO -# ================================================================================ -# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= -### - -### SDNCURL -### -#EE# -org.openecomp.mso.adapters.sdnc.sdncgeturl=https://localhost:8443/restconf/config/L3SDN-API: -org.openecomp.mso.adapters.sdnc.sdncposturl=https://localhost:8443/restconf/operations/L3SDN-API: -### -### BPEL ASYNC CALLLBACK/NOTIFICATION URL -### -#EE# -org.openecomp.mso.adapters.sdnc.bpelurl=http://localhost:8080/active-bpel/services/SDNCAdapterCallbackV1 -### -### SDNC ASYNC NOTIFICATION/RESPONSE URL -### -#EE# -org.openecomp.mso.adapters.sdnc.myurl=https://localhost:8443/adapters/rest/SDNCNotify -### -org.openecomp.mso.adapters.sdnc.sdncauth=admin:admin -org.openecomp.mso.adapters.sdnc.bpelauth=avosAdmin:jboss123 -org.openecomp.mso.adapters.sdnc.sdncconnecttime=2000 -org.openecomp.mso.adapters.sdnc.sdncreadtime=5000 - -org.openecomp.mso.adapters.sdnc...query=toto diff --git a/adapters/mso-sdnc-adapter/src/test/resources/mso.sdnc.properties b/adapters/mso-sdnc-adapter/src/test/resources/mso.sdnc.properties deleted file mode 100644 index f53e2d2b65..0000000000 --- a/adapters/mso-sdnc-adapter/src/test/resources/mso.sdnc.properties +++ /dev/null @@ -1,152 +0,0 @@ -#MSO SDNCA Properties go here -### -### UNIQUE SDNCURLs for Requests supported by SDNCA. URLS have unique tags eg a format like sdncurlXY (XY is unique eg digits) -### -org.openecomp.mso.adapters.sdnc.sdncurl1=https://sdncodl.it.us.03.aic.cip.att.com:8443/restconf/operations/L3SDN-API: -org.openecomp.mso.adapters.sdnc.sdncurl2=https://sdncodl.it.us.03.aic.cip.att.com:8443/restconf/config/L3SDN-API: -org.openecomp.mso.adapters.sdnc.sdncurl3=https://sdncodl.it.us.03.aic.cip.att.com:8443/restconf/operations/AicHoming: -org.openecomp.mso.adapters.sdnc.sdncurl4=https://sdncodl.it.us.03.aic.cip.att.com:8443/restconf/operations/Firewall-API: -org.openecomp.mso.adapters.sdnc.sdncurl5=https://sdncodl.it.us.03.aic.cip.att.com:8443/restconf/config -org.openecomp.mso.adapters.sdnc.sdncurl6=https://sdncodl.it.us.03.aic.cip.att.com:8443/restconf/operations/VNF-API: -org.openecomp.mso.adapters.sdnc.sdncurl7=https://sdncodl.it.us.03.aic.cip.att.com:8443/restconf/operations/L3UCPE-API: -org.openecomp.mso.adapters.sdnc.sdncurl8=https://sdncodl.it.us.03.aic.cip.att.com:8443/restconf/operations/NBNC-API: -org.openecomp.mso.adapters.sdnc.sdncurl9=https://sdncodl.it.us.03.aic.cip.att.com:8443/restconf/operations/NORTHBOUND-API:service-topology-operation -org.openecomp.mso.adapters.sdnc.sdncurl10=https://sdncodl.it.us.03.aic.cip.att.com:8443/restconf/operations/GENERIC-RESOURCE-API: -org.openecomp.mso.adapters.sdnc.sdncurl11=https://sdncodl.it.us.03.aic.cip.att.com:8443/restconf/operations/VNFTOPOLOGYAIC-API: -org.openecomp.mso.adapters.sdnc.sdncurl12=https://sdncodl.it.us.03.aic.cip.att.com:8443/ -org.openecomp.mso.adapters.sdnc.sdncurl13=http://mtznjv1fcbc01.kvm.cip.att.com:8181/restconf/operations/SDNW-API: -#org.openecomp.mso.adapters.sdnc.sdncurl14=http://txcdtl01bb2697.itservices.sbc.com:8181/restconf/operations/GENERIC-RESOURCE-API:port-mirror-topology-operation -org.openecomp.mso.adapters.sdnc.sdncurl14=http://mtanjv9sdbc51-eth1-0.aic.cip.att.com:8443/restconf/operations/GENERIC-RESOURCE-API: -### BPEL ASYNC CALLBACK/NOTIFICATION URL -### -org.openecomp.mso.adapters.sdnc.bpelurl=http://mtanjv9mobp01-eth1-0.aic.cip.att.com:8080/mso/SDNCAdapterCallbackService -org.openecomp.mso.adapters.sdnc.rest.bpelurl=http://mtanjv9mobp01-eth1-0.aic.cip.att.com:8080/mso/WorkflowMessage -### -### SDNC ASYNC NOTIFICATION/RESPONSE URL -### -org.openecomp.mso.adapters.sdnc.myurl=http://mtanjv9moja02-eth1-0.aic.cip.att.com:8080/adapters/rest/SDNCNotify -### Production value diff from other servers -org.openecomp.mso.adapters.sdnc.sdncauth=406B2AE613211B6FB52466DE6E1769AC -org.openecomp.mso.adapters.sdnc.bpelauth=F8E9452B55DDE4CCE77547B0E748105C54CF5EF1351B4E2CBAABF2981EFE776D -org.openecomp.mso.adapters.sdnc.sdncconnecttime=5000 -### -### Distinct Requests Supported by SDNCA. sdncurls added on top of file. fields may be null eg msoaction,operation resulting in .. construct -### -###org.openecomp.mso.adapters.sdnc.MSOACTION.OPERATION.ACTION=METHOD|TIMEOUT|URL|HEADERNAME|NAMESPACE -### -org.openecomp.mso.adapters.sdnc..service-homing-operation.homing=POST|60000|sdncurl3|sdnc-homing-header|com:att:sdnctl:aicHoming -org.openecomp.mso.adapters.sdnc.infra..query=GET|60000|sdncurl5| -org.openecomp.mso.adapters.sdnc.mobility..query=GET|60000|sdncurl5| -org.openecomp.mso.adapters.sdnc.vfmodule..query=GET|60000|sdncurl12| -org.openecomp.mso.adapters.sdnc...query=GET|60000|sdncurl2| -org.openecomp.mso.adapters.sdnc...put=PUT|60000|sdncurl5| -org.openecomp.mso.adapters.sdnc...restdelete=DELETE|60000|sdncurl5| -org.openecomp.mso.adapters.sdnc.gammainternet.svc-topology-operation.assign=POST|60000|sdncurl1|sdnc-request-header|com:att:sdnctl:l3api -org.openecomp.mso.adapters.sdnc.gammainternet.svc-topology-operation.delete=POST|250000|sdncurl1|sdnc-request-header|com:att:sdnctl:l3api -org.openecomp.mso.adapters.sdnc.gammainternet.service-configuration-operation.reserve=POST|60000|sdncurl1|sdnc-request-header|com:att:sdnctl:l3api -org.openecomp.mso.adapters.sdnc.gammainternet.service-configuration-operation.activate=POST|90000|sdncurl1|sdnc-request-header|com:att:sdnctl:l3api -org.openecomp.mso.adapters.sdnc.gammainternet.service-configuration-operation.delete=POST|250000|sdncurl1|sdnc-request-header|com:att:sdnctl:l3api -org.openecomp.mso.adapters.sdnc.gammainternet.service-configuration-operation.turnup=POST|60000|sdncurl1|sdnc-request-header|com:att:sdnctl:l3api -org.openecomp.mso.adapters.sdnc.gammainternet.service-configuration-operation.changereserve=POST|60000|sdncurl1|sdnc-request-header|com:att:sdnctl:l3api -org.openecomp.mso.adapters.sdnc.gammainternet.service-configuration-operation.changedelete=POST|250000|sdncurl1|sdnc-request-header|com:att:sdnctl:l3api -org.openecomp.mso.adapters.sdnc.gammainternet.service-configuration-operation.changeactivate=POST|60000|sdncurl1|sdnc-request-header|com:att:sdnctl:l3api -org.openecomp.mso.adapters.sdnc..feature-configuration-operation.activate=POST|60000|sdncurl4|sdnc-feature-request-header|com:att:sdnctl:firewallapi -org.openecomp.mso.adapters.sdnc..feature-configuration-operation.changeactivate=POST|60000|sdncurl4|sdnc-feature-request-header|com:att:sdnctl:firewallapi -org.openecomp.mso.adapters.sdnc..feature-configuration-operation.delete=POST|60000|sdncurl4|sdnc-feature-request-header|com:att:sdnctl:firewallapi -org.openecomp.mso.adapters.sdnc..vnf-topology-operation.assign=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc..vnf-topology-operation.activate=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc..vnf-topology-operation.rollback=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc..vnf-topology-operation.delete=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc..vnf-topology-operation.changeassign=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc..vnf-topology-operation.changedelete=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc..network-topology-operation.reserve=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc..network-topology-operation.assign=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc..network-topology-operation.activate=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc..network-topology-operation.rollback=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc..network-topology-operation.delete=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc..network-topology-operation.changeassign=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc..network-topology-operation.changedelete=POST|270000|sdncurl6|sdnc-request-header|org:openecomp:sdnctl:vnf -org.openecomp.mso.adapters.sdnc.ucpe.service-configuration-operation.prepare=POST|360000|sdncurl7|sdnc-request-header|com:att:sdnctl:l3ucpe -org.openecomp.mso.adapters.sdnc.ucpe.service-configuration-operation.activate=POST|60000|sdncurl7|sdnc-request-header|com:att:sdnctl:l3ucpe -org.openecomp.mso.adapters.sdnc.ucpe.service-configuration-operation.delete=POST|360000|sdncurl7|sdnc-request-header|com:att:sdnctl:l3ucpe -org.openecomp.mso.adapters.sdnc.ucpe.service-configuration-operation.complete=POST|60000|sdncurl7|sdnc-request-header|com:att:sdnctl:l3ucpe -org.openecomp.mso.adapters.sdnc.ucpe.service-configuration-operation.activatevnf=POST|600000|sdncurl7|sdnc-request-header|com:att:sdnctl:l3ucpe -org.openecomp.mso.adapters.sdnc.ucpe.service-configuration-operation.designvnf=POST|60000|sdncurl7|sdnc-request-header|com:att:sdnctl:l3ucpe -org.openecomp.mso.adapters.sdnc.ucpe.service-configuration-operation.removevnf=POST|60000|sdncurl7|sdnc-request-header|com:att:sdnctl:l3ucpe -org.openecomp.mso.adapters.sdnc..svc-topology-operation.assign=POST|285000|sdncurl8|sdnc-request-header|com:att:sdnctl:nbncapi -org.openecomp.mso.adapters.sdnc..svc-topology-operation.activate=POST|285000|sdncurl8|sdnc-request-header|com:att:sdnctl:nbncapi -org.openecomp.mso.adapters.sdnc..svc-topology-operation.delete=POST|285000|sdncurl8|sdnc-request-header|com:att:sdnctl:nbncapi - -org.openecomp.mso.adapters.sdnc.service.ucpe.service-topology-assign-operation=POST|120000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.ucpe.service-topology-activate-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.ucpe-vnf.service-topology-cust-assign-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.ucpe-vnf.service-topology-cust-stage-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.ucpe-vnf.service-topology-cust-activate-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.ucpe-vnf.service-topology-cust-remove-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.dhv.service-topology-assign-operation=POST|120000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.infra.service-topology-infra-assign-operation=POST|120000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.infra.service-topology-infra-activate-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.vhnportal.service-topology-cust-assign-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.vhnportal.service-topology-cust-activate-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.vhngw.service-topology-cust-assign-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.vhngw.service-topology-infra-register-vnf-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.vhngw.service-topology-cust-activate-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.vvig.service-topology-cust-assign-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.vvig.service-topology-cust-activate-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.pe.service-topology-cust-assign-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.pe.service-topology-cust-stage-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 -org.openecomp.mso.adapters.sdnc.service.pe.service-topology-cust-activate-operation=POST|90000|sdncurl9|sdnc-request-header|com:att:sdnctl:northbound-api:v1 - -org.openecomp.mso.adapters.sdnc..service-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..service-topology-operation.rollback=POST|270000|sdncur10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..service-topology-operation.delete=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..service-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.network-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.network-topology-operation.unassign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.network-topology-operation.activate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.network-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vnf-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vnf-topology-operation.activate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vnf-topology-operation.unassign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vnf-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vnf-topology-operation.rollback=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vnf-topology-operation.delete=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vnf-topology-operation.changeassign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vnf-topology-operation.changedelete=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vf-module-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vf-module-topology-operation.activate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vf-module-topology-operation.unassign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vf-module-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vf-module-topology-operation.rollback=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vf-module-topology-operation.delete=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vf-module-topology-operation.changeassign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.generic-resource.vf-module-topology-operation.changedelete=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..contrail-route-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..contrail-route-topology-operation.unassign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..contrail-route-topology-operation.create=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..contrail-route-topology-operation.delete=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..contrail-route-topology-operation.activate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..contrail-route-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..security-zone-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..security-zone-topology-operation.unassign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..security-zone-topology-operation.create=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..security-zone-topology-operation.delete=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..security-zone-topology-operation.activate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..security-zone-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource - -org.openecomp.mso.adapters.sdnc..vnf-topology-aic-operation.assign=POST|270000|sdncurl11|sdnc-request-header|com:att:sdnctl:vnftopologyaic -org.openecomp.mso.adapters.sdnc..vnf-topology-aic-operation.activate=POST|270000|sdncurl11|sdnc-request-header|com:att:sdnctl:vnftopologyaic - -org.openecomp.mso.adapters.sdnc.TRANSPORT.service-topology-operation.assign=POST|270000|sdncurl13|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.TRANSPORT.service-topology-operation.rollback=POST|270000|sdncur13|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.TRANSPORT.service-topology-operation.delete=POST|270000|sdncurl13|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.TRANSPORT.service-topology-operation.deactivate=POST|270000|sdncurl13|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc.TRANSPORT.service-topology-operation.activate=POST|270000|sdncurl13|sdnc-request-header|com:att:sdnctl:generic-resource - -org.openecomp.mso.adapters.sdnc..port-mirror-topology-operation.assign=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..port-mirror-topology-operation.activate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..port-mirror-topology-operation.deactivate=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..port-mirror-topology-operation.enable=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..port-mirror-topology-operation.disable=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource -org.openecomp.mso.adapters.sdnc..port-mirror-topology-operation.delete=POST|270000|sdncurl10|sdnc-request-header|com:att:sdnctl:generic-resource - diff --git a/adapters/mso-sdnc-adapter/src/test/resources/sdncTestPayload.xml b/adapters/mso-sdnc-adapter/src/test/resources/sdncTestPayload.xml new file mode 100644 index 0000000000..643632ceed --- /dev/null +++ b/adapters/mso-sdnc-adapter/src/test/resources/sdncTestPayload.xml @@ -0,0 +1,34 @@ + <sdncadapterworkflow:SDNCRequestData xmlns:ns5="http://org.onap/so/request/types/v1" + xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1" + xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1"> + <request-information> + <request-id>b184fee2-3bda-4bb7-9475-e18dbeb994c0</request-id> + <source>MSO</source> + <notification-url/> + <order-number/> + <order-version/> + <request-action>CreateServiceInstance</request-action> + </request-information> + <service-information> + <service-id/> + <subscription-service-type>MSO-dev-service-type</subscription-service-type> + <onap-model-information> + <model-invariant-uuid>52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f</model-invariant-uuid> + <model-uuid>aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e</model-uuid> + <model-version>1.0</model-version> + <model-name>MSO Test Network</model-name> + </onap-model-information> + <service-instance-id>d46c06c9-dcb2-48c9-888f-35219a8c492e</service-instance-id> + <subscriber-name/> + <global-customer-id>MSO_1610_dev</global-customer-id> + </service-information> + <service-request-input> + <service-instance-name>MSO-DEV-SI-1802-v6-2-19-113</service-instance-name> + <service-input-parameters> + <param> + <name>someUserParam</name> + <value>someValue</value> + </param> + </service-input-parameters> + </service-request-input> + </sdncadapterworkflow:SDNCRequestData>
\ No newline at end of file diff --git a/adapters/mso-sdnc-adapter/src/test/resources/sdnc_adapter_request.xml b/adapters/mso-sdnc-adapter/src/test/resources/sdnc_adapter_request.xml index 16a0399262..f132aa7497 100644 --- a/adapters/mso-sdnc-adapter/src/test/resources/sdnc_adapter_request.xml +++ b/adapters/mso-sdnc-adapter/src/test/resources/sdnc_adapter_request.xml @@ -1,7 +1,7 @@ <sdncadapterworkflow:SDNCAdapterWorkflowRequest - xmlns:ns5="http://org.openecomp/mso/request/types/v1" - xmlns:sdncadapterworkflow="http://org.openecomp/mso/workflow/schema/v1" - xmlns:sdncadapter="http://org.openecomp/workflow/sdnc/adapter/schema/v1"> + xmlns:ns5="http://org.onap/so/request/types/v1" + xmlns:sdncadapterworkflow="http://org.onap/so/workflow/schema/v1" + xmlns:sdncadapter="http://org.onap/workflow/sdnc/adapter/schema/v1"> <sdncadapter:RequestHeader> <sdncadapter:RequestId>sdncRequestId-test</sdncadapter:RequestId> <sdncadapter:SvcInstanceId>serviceInstanceId-test @@ -25,12 +25,12 @@ <service-id>serviceId-test</service-id> <subscription-service-type>subscriptionServiceType-test </subscription-service-type> - <ecomp-model-information> + <onap-model-information> <model-invariant-uuid>modelInvariantUuid-test</model-invariant-uuid> <model-uuid>modelUuid-test</model-uuid> <model-version>modelVersion-test</model-version> <model-name>modelName-test</model-name> - </ecomp-model-information> + </onap-model-information> <service-instance-id>serviceInstanceId-test</service-instance-id> <subscriber-name /> <global-customer-id>globalSubscriberId-test</global-customer-id> |