summaryrefslogtreecommitdiffstats
path: root/adapters
diff options
context:
space:
mode:
Diffstat (limited to 'adapters')
-rw-r--r--adapters/mso-adapter-utils/pom.xml2
-rw-r--r--adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java6
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java2
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsRefactorTest.java92
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsTest.java140
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsWithUpdateTest.java133
-rw-r--r--adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsWithUpdateTest.java12
-rw-r--r--adapters/mso-adapter-utils/src/test/resources/application-test.yaml2
-rw-r--r--adapters/mso-adapters-rest-interface/pom.xml2
-rw-r--r--adapters/mso-catalog-db-adapter/pom.xml35
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java2
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml8
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/application.yaml23
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql4
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.12.1__UpdateAutoScaleOutRefData.sql (renamed from adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.12__UpdateAutoScaleOutRefData.sql)0
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.12__add_second_column_to_rainy_day_handler_for_after_retry.sql3
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/EmbeddedMariaDbConfig.java2
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java2
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CloudConfigTest.java6
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java2
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java11
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/resources/application-test.yaml25
-rw-r--r--adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql5
-rw-r--r--adapters/mso-openstack-adapters/mvnw225
-rw-r--r--adapters/mso-openstack-adapters/mvnw.cmd143
-rw-r--r--adapters/mso-openstack-adapters/pom.xml6
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java5
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/db/migration/V4_2__DummyMigration.java32
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/BpelRestClient.java4
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java8
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java6
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java6
-rw-r--r--adapters/mso-openstack-adapters/src/main/resources/application-local.yaml10
-rw-r--r--adapters/mso-openstack-adapters/src/main/resources/application.yaml30
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/msoopenstackadapters/EmbeddedMariaDbConfig.java2
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/BpelRestClientTest.java2
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/MsoTenantAdapterImplTest.java2
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BaseRestTestUtils.java4
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BpelRestClientTest.java2
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImplTest.java2
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java2
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/QueryTest.java2
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/application-nomigrate.yaml18
-rw-r--r--adapters/mso-openstack-adapters/src/test/resources/application-test.yaml40
-rw-r--r--adapters/mso-requests-db-adapter/pom.xml25
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java5
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java4
-rw-r--r--adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java2
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml5
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/application.yaml36
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.13__Add_Rollback_Status_Message_To_Infra_Active_Reqests.sql4
-rw-r--r--adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.1__Add_Column_Request_url_varchar500.sql9
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestdb/rest/RequestProcessingDataRequestDbQueryTest.java2
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsSchedulerTest.java29
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java45
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/HealthCheckHandlerTest.java2
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java3
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/application/EmbeddedMariaDbConfig.java2
-rw-r--r--adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java13
-rw-r--r--adapters/mso-requests-db-adapter/src/test/resources/application-test.yaml22
-rw-r--r--adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql14
-rw-r--r--adapters/mso-sdnc-adapter/pom.xml24
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java3
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Constants.java9
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java4
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java4
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java7
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java4
-rw-r--r--adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml8
-rw-r--r--adapters/mso-sdnc-adapter/src/main/resources/application.yaml18
-rw-r--r--adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallbackTest.java54
-rw-r--r--adapters/mso-sdnc-adapter/src/test/resources/application-test.properties4
-rw-r--r--adapters/mso-vfc-adapter/pom.xml6
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/CXFConfiguration.java13
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/RequestDBConfig.java2
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/WebSecurityConfigImpl.java51
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcManager.java6
-rw-r--r--adapters/mso-vfc-adapter/src/main/resources/application-local.yaml2
-rw-r--r--adapters/mso-vfc-adapter/src/main/resources/application.yaml22
-rw-r--r--adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/EmbeddedMariaDbConfig.java2
-rw-r--r--adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/HealthCheckHandlerTest.java2
-rw-r--r--adapters/mso-vfc-adapter/src/test/resources/application-test.yaml19
-rw-r--r--adapters/pom.xml4
83 files changed, 496 insertions, 1064 deletions
diff --git a/adapters/mso-adapter-utils/pom.xml b/adapters/mso-adapter-utils/pom.xml
index b0687edc62..f94d5d60b8 100644
--- a/adapters/mso-adapter-utils/pom.xml
+++ b/adapters/mso-adapter-utils/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.onap.so</groupId>
<artifactId>adapters</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.so.adapters</groupId>
<artifactId>mso-adapter-utils</artifactId>
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
index d44857ce72..e36d0ff30e 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
@@ -119,9 +119,9 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin{
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, MsoHeatUtils.class);
// Properties names and variables (with default values)
- protected String createPollIntervalProp = "ecomp.mso.adapters.po.pollInterval";
- private String deletePollIntervalProp = "ecomp.mso.adapters.po.pollInterval";
- private String deletePollTimeoutProp = "ecomp.mso.adapters.po.pollTimeout";
+ protected String createPollIntervalProp = "onap.so.adapters.po.pollInterval";
+ private String deletePollIntervalProp = "onap.so.adapters.po.pollInterval";
+ private String deletePollTimeoutProp = "onap.so.adapters.po.pollTimeout";
protected static final String createPollIntervalDefault = "15";
private static final String deletePollIntervalDefault = "15";
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java
index d688960a1c..c1705508ce 100644
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java
+++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/EmbeddedMariaDbConfig.java
@@ -24,7 +24,7 @@ import ch.vorburger.exec.ManagedProcessException;
import ch.vorburger.mariadb4j.DBConfigurationBuilder;
import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
+import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsRefactorTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsRefactorTest.java
deleted file mode 100644
index c3777ca810..0000000000
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsRefactorTest.java
+++ /dev/null
@@ -1,92 +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.onap.so.adapter_utils.tests;
-
-
-import org.apache.http.HttpHeaders;
-import org.apache.http.HttpStatus;
-import org.junit.Before;
-import org.junit.Test;
-import org.onap.so.BaseTest;
-import org.onap.so.db.catalog.beans.AuthenticationType;
-import org.onap.so.db.catalog.beans.CloudIdentity;
-import org.onap.so.db.catalog.beans.CloudSite;
-import org.onap.so.db.catalog.beans.ServerType;
-import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
-import org.onap.so.openstack.utils.MsoHeatUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import javax.ws.rs.core.MediaType;
-import java.io.IOException;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.*;
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
-import static org.junit.Assert.assertEquals;
-
-/**PoConfigTest
- * This class implements test methods of the MsoHeatUtils
- *
- *
- */
-public class MsoHeatUtilsRefactorTest extends BaseTest {
-
- @Autowired
- private MsoHeatUtils msoHeatUtils;
-
- @Before
- public void init() throws IOException {
- CloudIdentity identity = new CloudIdentity();
-
- identity.setId("MTN13");
- identity.setMsoId("m93945");
- identity.setMsoPass("93937EA01B94A10A49279D4572B48369");
- identity.setAdminTenant("admin");
- identity.setMemberRole("admin");
- identity.setTenantMetadata(true);
- identity.setIdentityUrl("http://localhost:28090/v2.0");
- identity.setIdentityAuthenticationType(AuthenticationType.USERNAME_PASSWORD);
-
- CloudSite cloudSite = new CloudSite();
- cloudSite.setId("MTN13");
- cloudSite.setCloudVersion("3.0");
- cloudSite.setClli("MDT13");
- cloudSite.setRegionId("MTN13");
- identity.setIdentityServerType(ServerType.KEYSTONE);
- cloudSite.setIdentityService(identity);
-
-
- stubFor(get(urlPathEqualTo("/cloudSite/DEFAULT")).willReturn(aResponse()
- .withBody(getBody(mapper.writeValueAsString(cloudSite),wireMockPort, ""))
- .withHeader(HttpHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON)
- .withStatus(HttpStatus.SC_OK)));
- stubFor(get(urlPathEqualTo("/cloudIdentity/MTN13")).willReturn(aResponse()
- .withBody(getBody(mapper.writeValueAsString(identity),wireMockPort, ""))
- .withHeader(HttpHeaders.CONTENT_TYPE,MediaType.APPLICATION_JSON)
- .withStatus(HttpStatus.SC_OK)));
- }
-
- @Test
- public final void testGetKeystoneUrl() throws MsoCloudSiteNotFound {
- String keyUrl = msoHeatUtils.getCloudSiteKeystoneUrl("DAN");
- assertEquals("http://localhost:28090/v2.0", keyUrl);
- }
-}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsTest.java
deleted file mode 100644
index abb0a10af5..0000000000
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsTest.java
+++ /dev/null
@@ -1,140 +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.onap.so.adapter_utils.tests;
-
-import java.util.HashMap;
-
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.onap.so.TestApplication;
-import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
-import org.onap.so.openstack.exceptions.MsoException;
-import org.onap.so.openstack.exceptions.MsoIOException;
-import org.onap.so.openstack.exceptions.MsoStackAlreadyExists;
-import org.onap.so.openstack.exceptions.MsoTenantNotFound;
-import org.onap.so.openstack.utils.MsoCommonUtils;
-import org.onap.so.openstack.utils.MsoHeatUtils;
-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 com.woorea.openstack.heat.model.CreateStackParam;
-
-/**
- * This class implements test methods of the MsoHeatUtils
- *
- *
- */
-@RunWith(SpringRunner.class)
-@SpringBootTest(classes = TestApplication.class)
-@ActiveProfiles("test")
-@Ignore
-public class MsoHeatUtilsTest extends MsoCommonUtils {
- @Autowired
- private MsoHeatUtils msoHeatUtils;
-
- @Test
- public final void testCreateStackBadCloudConfig()
- throws MsoStackAlreadyExists, MsoTenantNotFound, MsoException, MsoCloudSiteNotFound {
- try {
- msoHeatUtils.createStack("DOESNOTEXIST", "test", "stackName", "test", new HashMap<String, Object>(),
- Boolean.TRUE, 10);
- } catch (MsoCloudSiteNotFound e) {
-
- } catch (java.lang.NullPointerException npe) {
-
- }
-
- }
-
- @Test
- public final void testCreateStackFailedConnectionHeatClient()
- throws MsoStackAlreadyExists, MsoTenantNotFound, MsoException, MsoCloudSiteNotFound {
- try {
- msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE,
- 10);
- } catch (MsoIOException e) {
-
- }
-
- }
-
- @Test
- public final void testCreateStackFailedConnection()
- throws MsoStackAlreadyExists, MsoTenantNotFound, MsoException, MsoCloudSiteNotFound {
- try {
- msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE,
- 10);
- } catch (MsoIOException e) {
-
- }
-
- }
-
- @Test
- public final void createStackSuccessWithEnvironment() throws MsoException {
- try {
- msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE, 10,
- "environment");
- } catch (MsoIOException e) {
-
- }
-
- }
-
- @Test
- public final void createStackSuccessWithFiles() throws MsoException {
- try {
- msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE, 10,
- "environment", new HashMap<String, Object>());
- } catch (MsoIOException e) {
-
- }
-
- }
-
- @Test
- public final void createStackSuccessWithHeatFiles() throws MsoException {
- try {
- msoHeatUtils.createStack("MT", "test", "stackName", "test", new HashMap<String, Object>(), Boolean.TRUE, 10,
- "environment", new HashMap<String, Object>(), new HashMap<String, Object>());
- } catch (MsoIOException e) {
-
- }
- }
-
- @Test
- public final void requestToStringBuilderTest() {
- CreateStackParam param = new CreateStackParam();
- param.setDisableRollback(false);
- param.setEnvironment("environment");
- param.setFiles(new HashMap<String, Object>());
- param.setParameters(new HashMap<>());
- param.setStackName("stackName");
- param.setTemplate("template");
- param.setTemplateUrl("http://templateUrl");
- param.setTimeoutMinutes(1);
-
- msoHeatUtils.requestToStringBuilder(param);
- }
-}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsWithUpdateTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsWithUpdateTest.java
deleted file mode 100644
index 50fc17511b..0000000000
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/adapter_utils/tests/MsoHeatUtilsWithUpdateTest.java
+++ /dev/null
@@ -1,133 +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.onap.so.adapter_utils.tests;
-
-import static org.junit.Assert.fail;
-import static org.mockito.Mockito.when;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import java.util.Optional;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
-import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
-import org.onap.so.cloud.CloudConfig;
-import org.onap.so.db.catalog.beans.CloudIdentity;
-import org.onap.so.db.catalog.beans.CloudSite;
-import org.onap.so.db.catalog.beans.ServerType;
-import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
-import org.onap.so.openstack.exceptions.MsoException;
-import org.onap.so.openstack.exceptions.MsoIOException;
-import org.onap.so.openstack.utils.MsoHeatUtilsWithUpdate;
-import org.onap.so.utils.CryptoUtils;
-
-import com.woorea.openstack.base.client.OpenStackConnectException;
-
-@RunWith(MockitoJUnitRunner.class)
-public class MsoHeatUtilsWithUpdateTest {
-
-
- @Mock
- private CloudConfig cloudConfig;
- @InjectMocks
- private MsoHeatUtilsWithUpdate util=new MsoHeatUtilsWithUpdate();
-
- private CloudSite cloudSite;
-
- @Before
- public void init () {
- cloudSite = new CloudSite ();
- cloudSite.setRegionId("cloud");
- CloudIdentity cloudIdentity = new CloudIdentity ();
- cloudIdentity.setIdentityServerType(ServerType.KEYSTONE);
- cloudIdentity.setIdentityUrl("toto");
- cloudIdentity.setMsoPass (CryptoUtils.encryptCloudConfigPassword("mockId"));
- cloudSite.setIdentityService (cloudIdentity);
- when(cloudConfig.getCloudSite("cloud")).thenReturn (Optional.of(cloudSite));
- when(cloudConfig.getCloudSite("none")).thenReturn (Optional.empty());
- }
-
- @Test
- @Ignore
- public void testUpdateStack () {
- // Heat heat = Mockito.mock (Heat.class);
- Map <String, Object> stackInputs = new HashMap <> ();
- try {
- util.updateStack ("none", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1);
- } catch (MsoException e) {
- if (e instanceof MsoCloudSiteNotFound) {
- // Ok
- } else {
- e.printStackTrace ();
- fail ("Exception caught");
- }
- }
- try {
- util.updateStack ("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1);
- } catch (MsoException e) {
- if (e instanceof MsoIOException && e.getCause () != null
- && e.getCause () instanceof OpenStackConnectException) {
- // Ok, we were able to go up to the connection to OpenStack
- } else {
- e.printStackTrace ();
- fail ("Exception caught");
- }
- }
- try {
- util.updateStack ("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1, "environment");
- } catch (MsoException e) {
- if (e instanceof MsoIOException && e.getCause () != null
- && e.getCause () instanceof OpenStackConnectException) {
- // Ok, we were able to go up to the connection to OpenStack
- } else {
- e.printStackTrace ();
- fail ("Exception caught");
- }
- }
- try {
- util.updateStack ("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1, "environment", null);
- } catch (MsoException e) {
- if (e instanceof MsoIOException && e.getCause () != null
- && e.getCause () instanceof OpenStackConnectException) {
- // Ok, we were able to go up to the connection to OpenStack
- } else {
- e.printStackTrace ();
- fail ("Exception caught");
- }
- }
- try {
- util.updateStack ("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1, "environment", null, null);
- } catch (MsoException e) {
- if (e instanceof MsoIOException && e.getCause () != null
- && e.getCause () instanceof OpenStackConnectException) {
- // Ok, we were able to go up to the connection to OpenStack
- } else {
- e.printStackTrace ();
- fail ("Exception caught");
- }
- }
- }
-}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsWithUpdateTest.java b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsWithUpdateTest.java
index 1a8f4fb098..b735e735c9 100644
--- a/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsWithUpdateTest.java
+++ b/adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoHeatUtilsWithUpdateTest.java
@@ -22,8 +22,8 @@ package org.onap.so.openstack.utils;
import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs;
import static org.junit.Assert.assertThat;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.isA;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
@@ -40,7 +40,7 @@ import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockito.Spy;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.TestDataSetup;
import org.onap.so.cloud.CloudConfig;
import org.onap.so.db.catalog.beans.CloudSite;
@@ -100,7 +100,6 @@ public class MsoHeatUtilsWithUpdateTest extends TestDataSetup {
doReturn(Optional.of(cloudSite)).when(cloudConfig).getCloudSite(isA(String.class));
doReturn(heatClient).when(heatUtils).getHeatClient(isA(CloudSite.class), isA(String.class));
- doReturn(heatStack).when(heatUtils).queryHeatStack(isA(Heat.class), isA(String.class));
doReturn(null).when(heatUtils).executeAndRecordOpenstackRequest(isA(OpenStackRequest.class));
doReturn("0").when(environment).getProperty(isA(String.class), isA(String.class));
doReturn(updateStack).when(heatUtils).queryHeatStack(isA(Heat.class), isA(String.class));
@@ -125,7 +124,7 @@ public class MsoHeatUtilsWithUpdateTest extends TestDataSetup {
doReturn(Optional.of(cloudSite)).when(cloudConfig).getCloudSite(isA(String.class));
doReturn(heatClient).when(heatUtils).getHeatClient(isA(CloudSite.class), isA(String.class));
- doReturn(heatStack).when(heatUtils).queryHeatStack(isA(Heat.class), isA(String.class));
+
doReturn(null).when(heatUtils).executeAndRecordOpenstackRequest(isA(OpenStackRequest.class));
doReturn("0").when(environment).getProperty(isA(String.class), isA(String.class));
doReturn(updateStack).when(heatUtils).queryHeatStack(isA(Heat.class), isA(String.class));
@@ -151,8 +150,7 @@ public class MsoHeatUtilsWithUpdateTest extends TestDataSetup {
expectedStackInfo.setCanonicalName("stackName/id");
doReturn(Optional.of(cloudSite)).when(cloudConfig).getCloudSite(isA(String.class));
- doReturn(heatClient).when(heatUtils).getHeatClient(isA(CloudSite.class), isA(String.class));
- doReturn(heatStack).when(heatUtils).queryHeatStack(isA(Heat.class), isA(String.class));
+ doReturn(heatClient).when(heatUtils).getHeatClient(isA(CloudSite.class), isA(String.class));
doReturn(null).when(heatUtils).executeAndRecordOpenstackRequest(isA(OpenStackRequest.class));
doReturn("0").when(environment).getProperty(isA(String.class), isA(String.class));
doReturn(updateStack).when(heatUtils).queryHeatStack(isA(Heat.class), isA(String.class));
diff --git a/adapters/mso-adapter-utils/src/test/resources/application-test.yaml b/adapters/mso-adapter-utils/src/test/resources/application-test.yaml
index f9467d3c12..011bb1416b 100644
--- a/adapters/mso-adapter-utils/src/test/resources/application-test.yaml
+++ b/adapters/mso-adapter-utils/src/test/resources/application-test.yaml
@@ -61,7 +61,7 @@ mso:
queue-capacity: 500
spring:
datasource:
- url: jdbc:mariadb://localhost:3307/catalogdb
+ jdbc-url: jdbc:mariadb://localhost:3307/catalogdb
username: root
password: password
driver-class-name: org.mariadb.jdbc.Driver
diff --git a/adapters/mso-adapters-rest-interface/pom.xml b/adapters/mso-adapters-rest-interface/pom.xml
index 7e341f0952..a23cb62e1e 100644
--- a/adapters/mso-adapters-rest-interface/pom.xml
+++ b/adapters/mso-adapters-rest-interface/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.onap.so</groupId>
<artifactId>adapters</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.so.adapters</groupId>
<artifactId>mso-adapters-rest-interface</artifactId>
diff --git a/adapters/mso-catalog-db-adapter/pom.xml b/adapters/mso-catalog-db-adapter/pom.xml
index e8db6be2f9..916abd3763 100644
--- a/adapters/mso-catalog-db-adapter/pom.xml
+++ b/adapters/mso-catalog-db-adapter/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.onap.so</groupId>
<artifactId>adapters</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.so.adapters</groupId>
@@ -50,6 +50,19 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.3</version>
+ <configuration>
+ <source>1.8</source>
+ <target>1.8</target>
+ <fork>true</fork>
+ <compilerArgs>
+ <arg>-parameters</arg>
+ </compilerArgs>
+ </configuration>
+ </plugin>
</plugins>
<pluginManagement>
<plugins>
@@ -114,16 +127,6 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>tomcat-jdbc</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-dbcp2</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
@@ -169,17 +172,15 @@
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
- <artifactId>flyway-core</artifactId>
+ <artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
- <artifactId>micrometer-spring-legacy</artifactId>
- <version>1.0.5</version>
+ <artifactId>micrometer-core</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
- <version>1.0.5</version>
</dependency>
- </dependencies>
-</project> \ No newline at end of file
+ </dependencies>
+</project>
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java
index eaf3e125a1..7ac23352a7 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java
@@ -518,7 +518,7 @@ public class CatalogDbAdapterRest {
try {
if (smUuid != null && !"".equals(smUuid)) {
logger.debug("Query Csar by service model uuid: {}",smUuid);
- ToscaCsar toscaCsar = toscaCsarRepo.findOne(smUuid);
+ ToscaCsar toscaCsar = toscaCsarRepo.findById(smUuid).orElseGet(() -> null);
if (toscaCsar != null) {
QueryServiceCsar serviceCsar = new QueryServiceCsar(toscaCsar);
entity = serviceCsar.JSON2(false, false);
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml b/adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml
index dbf09a898d..e896d9460f 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/application-local.yaml
@@ -11,11 +11,11 @@ mso:
# H2
spring:
datasource:
- url: jdbc:mariadb://localhost:3306/catalogdb
+ jdbc-url: jdbc:mariadb://localhost:3306/catalogdb
username: catalog
password: catalog123
driver-class-name: org.mariadb.jdbc.Driver
- initialize: true
+ initialization-mode: always
jpa:
show-sql: true
@@ -39,10 +39,6 @@ server:
tomcat:
max-threads: 50
-
-#Actuator
-management:
- context-path: /manage
flyway:
baseline-on-migrate: true
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml b/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml
index 94705861f9..ff6f2378fa 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/application.yaml
@@ -17,15 +17,11 @@ mso:
# CatalogDB
spring:
datasource:
- url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/catalogdb
+ jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/catalogdb
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: org.mariadb.jdbc.Driver
- dbcp2:
- initial-size: 5
- max-total: 20
- validation-query: select 1
- test-on-borrow: true
+ initialization-mode: never
jpa:
show-sql: true
hibernate:
@@ -38,18 +34,23 @@ spring:
fail-on-empty-beans: false
flyway:
baseline-on-migrate: false
- url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/catalogdb
+ jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/catalogdb
user: ${DB_ADMIN_USERNAME}
password: ${DB_ADMIN_PASSWORD}
outOfOrder: true
validateOnMigrate: false
-#Actuator
-management:
- context-path: /manage
+management:
+ endpoints:
+ web:
+ base-path: /manage
+ server:
+ servlet:
+ context-path: /manage
metrics:
se-global-registry: false
export:
prometheus:
enabled: true # Whether exporting of metrics to Prometheus is enabled.
- step: 1m # Step size (i.e. reporting frequency) to use. \ No newline at end of file
+ step: 1m # Step size (i.e. reporting frequency) to use.
+ \ No newline at end of file
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql
index 9992f5531a..454547a72e 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V2.15__Orchestration_Status_Valid_Action_State_Transition_Table_Updates.sql
@@ -40,11 +40,11 @@ DELETE FROM orchestration_flow_reference
WHERE FLOW_NAME = 'DeactivateNetworkCollectionBB';
UPDATE orchestration_flow_reference
-SET SEQ_NO = SEQ_NO - 1
+SET SEQ_NO = SEQ_NO - 1
WHERE COMPOSITE_ACTION = 'Service-Macro-Delete' AND SEQ_NO > 8;
UPDATE orchestration_flow_reference
-SET SEQ_NO = SEQ_NO - 1
+SET SEQ_NO = SEQ_NO - 1
WHERE COMPOSITE_ACTION = 'NetworkCollection-Macro-Delete' AND SEQ_NO > 4;
UPDATE building_block_detail
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.12__UpdateAutoScaleOutRefData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.12.1__UpdateAutoScaleOutRefData.sql
index 5e60f23965..5e60f23965 100644
--- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.12__UpdateAutoScaleOutRefData.sql
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.12.1__UpdateAutoScaleOutRefData.sql
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.12__add_second_column_to_rainy_day_handler_for_after_retry.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.12__add_second_column_to_rainy_day_handler_for_after_retry.sql
new file mode 100644
index 0000000000..f533e6842f
--- /dev/null
+++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V4.12__add_second_column_to_rainy_day_handler_for_after_retry.sql
@@ -0,0 +1,3 @@
+use catalogdb;
+
+ALTER TABLE rainy_day_handler_macro ADD SECONDARY_POLICY varchar(200);
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/EmbeddedMariaDbConfig.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/EmbeddedMariaDbConfig.java
index 7f0c07bdf6..5d9eedb20f 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/EmbeddedMariaDbConfig.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/EmbeddedMariaDbConfig.java
@@ -23,7 +23,7 @@ import ch.vorburger.exec.ManagedProcessException;
import ch.vorburger.mariadb4j.DBConfigurationBuilder;
import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
+import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java
index e15311eb0e..077b4ea6d5 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CatalogDBRestTest.java
@@ -40,7 +40,7 @@ import org.onap.so.adapters.catalogdb.CatalogDBApplication;
import org.onap.so.logger.MsoLogger;
import org.skyscreamer.jsonassert.JSONAssert;
import org.skyscreamer.jsonassert.JSONCompareMode;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.HttpEntity;
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CloudConfigTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CloudConfigTest.java
index 0606848b04..05d1928a17 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CloudConfigTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CloudConfigTest.java
@@ -31,7 +31,7 @@ import org.onap.so.db.catalog.beans.AuthenticationType;
import org.onap.so.db.catalog.beans.CloudIdentity;
import org.onap.so.db.catalog.beans.CloudSite;
import org.onap.so.db.catalog.beans.ServerType;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.HttpEntity;
@@ -89,7 +89,9 @@ public class CloudConfigTest {
builder = UriComponentsBuilder.fromHttpUrl("http://localhost:"+ port + uri +"/" + cloudSite.getId());
HttpEntity<String> entity = new HttpEntity<String>(null, headers);
ResponseEntity<CloudSite> actualCloudSite = restTemplate.exchange(builder.toUriString(),HttpMethod.GET, entity, CloudSite.class);
-
+ builder = UriComponentsBuilder.fromHttpUrl("http://localhost:"+ port + uri);
+ ResponseEntity<String> cloudSiteString = restTemplate.exchange(builder.toUriString(),HttpMethod.GET, entity, String.class);
+ System.out.println(cloudSiteString.getBody());
assertEquals(Response.Status.OK.getStatusCode(), actualCloudSite.getStatusCode().value());
assertThat(actualCloudSite.getBody(), sameBeanAs(cloudSite).ignoring("created").ignoring("updated")
.ignoring("identityService.created").ignoring("identityService.updated"));
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java
index fcc3eb4d66..3154603292 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/NetworkCollectionCatalogDbQueryTest.java
@@ -42,7 +42,7 @@ import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization;
import org.onap.so.db.catalog.client.CatalogDbClientPortChanger;
import org.onap.so.logger.MsoLogger;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
index 5e2bd82776..ec9ad8c29c 100644
--- a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
+++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/db/catalog/client/CatalogDbClientTest.java
@@ -47,7 +47,7 @@ import org.onap.so.db.catalog.beans.VnfResourceCustomization;
import org.onap.so.db.catalog.beans.macro.RainyDayHandlerStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
@@ -462,6 +462,15 @@ public class CatalogDbClientTest {
}
@Test
+ public void testFindExternalToInternalServiceByServiceName() {
+ ExternalServiceToInternalService externalServiceToInternalService = client.findExternalToInternalServiceByServiceName("MySpecialServiceName");
+ Assert.assertNotNull(externalServiceToInternalService);
+ Assert.assertNotNull(externalServiceToInternalService.getServiceName());
+ Assert.assertNotNull(externalServiceToInternalService.getServiceModelUUID());
+ Assert.assertEquals("MySpecialServiceName", externalServiceToInternalService.getServiceName());
+ }
+
+ @Test
public void testFindExternalToInternalServiceByServiceNameNotFound() {
ExternalServiceToInternalService externalServiceToInternalService = client.findExternalToInternalServiceByServiceName("Not_Found");
Assert.assertNull(externalServiceToInternalService);
diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/application-test.yaml b/adapters/mso-catalog-db-adapter/src/test/resources/application-test.yaml
index a59ea0ef65..f84e194962 100644
--- a/adapters/mso-catalog-db-adapter/src/test/resources/application-test.yaml
+++ b/adapters/mso-catalog-db-adapter/src/test/resources/application-test.yaml
@@ -14,11 +14,11 @@ mso:
spring:
datasource:
- url: jdbc:mariadb://localhost:3307/catalogdb
+ jdbc-url: jdbc:mariadb://localhost:3307/catalogdb
username: root
password: password
driver-class-name: org.mariadb.jdbc.Driver
- initialize: true
+ initialization-mode: always
data: classpath*:data.sql
jpa:
generate-ddl: false
@@ -55,16 +55,23 @@ server:
max-threads: 50
-#Actuator
-management:
+management:
endpoints:
- enabled-by-default: false
- endpoint:
- info:
- enabled: true
+ web:
+ base-path: /manage
+ server:
+ servlet:
+ context-path: /manage
+ metrics:
+ se-global-registry: false
+ export:
+ prometheus:
+ enabled: true # Whether exporting of metrics to Prometheus is enabled.
+ step: 1m # Step size (i.e. reporting frequency) to use.
+
flyway:
baseline-on-migrate: false
- url: jdbc:mariadb://localhost:3307/catalogdb
+ jdbc-url: jdbc:mariadb://localhost:3307/catalogdb
user: root
password: password
diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
index c8475564a4..b4916bd46c 100644
--- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
+++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql
@@ -63,6 +63,9 @@ insert into service(model_uuid, model_name, model_invariant_uuid, model_version,
insert into service(model_uuid, model_name, model_invariant_uuid, model_version, description, creation_timestamp, tosca_csar_artifact_uuid, service_type, service_role, environment_context, workload_context) values
('5df8b6de-2083-11e7-93ae-92361f002679', 'MSOTADevInfra_Test_Service', '9647dfc4-2083-11e7-93ae-92361f002673', '3.0', 'MSO aLaCarte Vfmodule with addon', '2017-04-14 13:42:39', '0513f839-459d-46b6-aa3d-2edfef89a079', 'NA', 'NA', 'Luna', 'Oxygen');
+INSERT INTO external_service_to_internal_model_mapping(id,SERVICE_NAME,PRODUCT_FLAVOR,SUBSCRIPTION_SERVICE_TYPE,SERVICE_MODEL_UUID) VALUES
+(3,'MySpecialServiceName','Gold','Test','c94b1098-3c71-11e8-b467-0ed5f89f7199');
+
insert into tosca_csar(ARTIFACT_UUID,NAME,VERSION,DESCRIPTION,ARTIFACT_CHECKSUM,URL,CREATION_TIMESTAMP) values
('266eaf78-af74-45cd-83ec-9c477f189dc1','service-NetworkCollectionSvc0106-csar.csar','1','TOSCA definition package of the asset','OGQ1M2QyYjU0OWMzZTY4MWVlYTNhOWIxNmQ2NjEyZDQ=','/sdc/v1/catalog/services/NetworkCollectionSvc0106/1.0/artifacts/service-NetworkCollectionSvc0106-csar.csar','2018-06-01 16:06:52');
insert into service(model_uuid, model_name, model_invariant_uuid, model_version, description, creation_timestamp, tosca_csar_artifact_uuid, service_type, service_role, environment_context, workload_context) values
@@ -203,4 +206,4 @@ VALUES
INSERT INTO vnf_components_recipe (VNF_COMPONENT_TYPE, ACTION, VERSION, DESCRIPTION, ORCHESTRATION_URI, RECIPE_TIMEOUT, VF_MODULE_MODEL_UUID)
VALUES
-('volumeGroup', 'createInstance', '1', 'Gr api recipe to create volume-group', '/mso/async/services/WorkflowActionBB', 180, '20c4431c-246d-11e7-93ae-92361f002671'); \ No newline at end of file
+('volumeGroup', 'createInstance', '1', 'Gr api recipe to create volume-group', '/mso/async/services/WorkflowActionBB', 180, '20c4431c-246d-11e7-93ae-92361f002671');
diff --git a/adapters/mso-openstack-adapters/mvnw b/adapters/mso-openstack-adapters/mvnw
deleted file mode 100644
index 5bf251c077..0000000000
--- a/adapters/mso-openstack-adapters/mvnw
+++ /dev/null
@@ -1,225 +0,0 @@
-#!/bin/sh
-# ----------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you 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.
-# ----------------------------------------------------------------------------
-
-# ----------------------------------------------------------------------------
-# Maven2 Start Up Batch script
-#
-# Required ENV vars:
-# ------------------
-# JAVA_HOME - location of a JDK home dir
-#
-# Optional ENV vars
-# -----------------
-# M2_HOME - location of maven2's installed home dir
-# MAVEN_OPTS - parameters passed to the Java VM when running Maven
-# e.g. to debug Maven itself, use
-# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-# ----------------------------------------------------------------------------
-
-if [ -z "$MAVEN_SKIP_RC" ] ; then
-
- if [ -f /etc/mavenrc ] ; then
- . /etc/mavenrc
- fi
-
- if [ -f "$HOME/.mavenrc" ] ; then
- . "$HOME/.mavenrc"
- fi
-
-fi
-
-# OS specific support. $var _must_ be set to either true or false.
-cygwin=false;
-darwin=false;
-mingw=false
-case "`uname`" in
- CYGWIN*) cygwin=true ;;
- MINGW*) mingw=true;;
- Darwin*) darwin=true
- # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
- # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
- if [ -z "$JAVA_HOME" ]; then
- if [ -x "/usr/libexec/java_home" ]; then
- export JAVA_HOME="`/usr/libexec/java_home`"
- else
- export JAVA_HOME="/Library/Java/Home"
- fi
- fi
- ;;
-esac
-
-if [ -z "$JAVA_HOME" ] ; then
- if [ -r /etc/gentoo-release ] ; then
- JAVA_HOME=`java-config --jre-home`
- fi
-fi
-
-if [ -z "$M2_HOME" ] ; then
- ## resolve links - $0 may be a link to maven's home
- PRG="$0"
-
- # need this for relative symlinks
- while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG="`dirname "$PRG"`/$link"
- fi
- done
-
- saveddir=`pwd`
-
- M2_HOME=`dirname "$PRG"`/..
-
- # make it fully qualified
- M2_HOME=`cd "$M2_HOME" && pwd`
-
- cd "$saveddir"
- # echo Using m2 at $M2_HOME
-fi
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --unix "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For Migwn, ensure paths are in UNIX format before anything is touched
-if $mingw ; then
- [ -n "$M2_HOME" ] &&
- M2_HOME="`(cd "$M2_HOME"; pwd)`"
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
- # TODO classpath?
-fi
-
-if [ -z "$JAVA_HOME" ]; then
- javaExecutable="`which javac`"
- if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
- if $darwin ; then
- javaHome="`dirname \"$javaExecutable\"`"
- javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
- else
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- fi
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- JAVA_HOME="$javaHome"
- export JAVA_HOME
- fi
- fi
-fi
-
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
- JAVACMD="`which java`"
- fi
-fi
-
-if [ ! -x "$JAVACMD" ] ; then
- echo "Error: JAVA_HOME is not defined correctly." >&2
- echo " We cannot execute $JAVACMD" >&2
- exit 1
-fi
-
-if [ -z "$JAVA_HOME" ] ; then
- echo "Warning: JAVA_HOME environment variable is not set."
-fi
-
-CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
-
-# traverses directory structure from process work directory to filesystem root
-# first directory with .mvn subdirectory is considered project base directory
-find_maven_basedir() {
-
- if [ -z "$1" ]
- then
- echo "Path not specified to find_maven_basedir"
- return 1
- fi
-
- basedir="$1"
- wdir="$1"
- while [ "$wdir" != '/' ] ; do
- if [ -d "$wdir"/.mvn ] ; then
- basedir=$wdir
- break
- fi
- # workaround for JBEAP-8937 (on Solaris 10/Sparc)
- if [ -d "${wdir}" ]; then
- wdir=`cd "$wdir/.."; pwd`
- fi
- # end of workaround
- done
- echo "${basedir}"
-}
-
-# concatenates all lines of a file
-concat_lines() {
- if [ -f "$1" ]; then
- echo "$(tr -s '\n' ' ' < "$1")"
- fi
-}
-
-BASE_DIR=`find_maven_basedir "$(pwd)"`
-if [ -z "$BASE_DIR" ]; then
- exit 1;
-fi
-
-export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
-echo $MAVEN_PROJECTBASEDIR
-MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
- [ -n "$M2_HOME" ] &&
- M2_HOME=`cygpath --path --windows "$M2_HOME"`
- [ -n "$JAVA_HOME" ] &&
- JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
- [ -n "$CLASSPATH" ] &&
- CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
- [ -n "$MAVEN_PROJECTBASEDIR" ] &&
- MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
-fi
-
-WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-exec "$JAVACMD" \
- $MAVEN_OPTS \
- -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
- "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
- ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/adapters/mso-openstack-adapters/mvnw.cmd b/adapters/mso-openstack-adapters/mvnw.cmd
deleted file mode 100644
index 019bd74d76..0000000000
--- a/adapters/mso-openstack-adapters/mvnw.cmd
+++ /dev/null
@@ -1,143 +0,0 @@
-@REM ----------------------------------------------------------------------------
-@REM Licensed to the Apache Software Foundation (ASF) under one
-@REM or more contributor license agreements. See the NOTICE file
-@REM distributed with this work for additional information
-@REM regarding copyright ownership. The ASF licenses this file
-@REM to you under the Apache License, Version 2.0 (the
-@REM "License"); you may not use this file except in compliance
-@REM with the License. You may obtain a copy of the License at
-@REM
-@REM http://www.apache.org/licenses/LICENSE-2.0
-@REM
-@REM Unless required by applicable law or agreed to in writing,
-@REM software distributed under the License is distributed on an
-@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-@REM KIND, either express or implied. See the License for the
-@REM specific language governing permissions and limitations
-@REM under the License.
-@REM ----------------------------------------------------------------------------
-
-@REM ----------------------------------------------------------------------------
-@REM Maven2 Start Up Batch script
-@REM
-@REM Required ENV vars:
-@REM JAVA_HOME - location of a JDK home dir
-@REM
-@REM Optional ENV vars
-@REM M2_HOME - location of maven2's installed home dir
-@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
-@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
-@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
-@REM e.g. to debug Maven itself, use
-@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
-@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
-@REM ----------------------------------------------------------------------------
-
-@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
-@echo off
-@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
-@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
-
-@REM set %HOME% to equivalent of $HOME
-if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
-
-@REM Execute a user defined script before this one
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
-@REM check for pre script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
-if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
-:skipRcPre
-
-@setlocal
-
-set ERROR_CODE=0
-
-@REM To isolate internal variables from possible post scripts, we use another setlocal
-@setlocal
-
-@REM ==== START VALIDATION ====
-if not "%JAVA_HOME%" == "" goto OkJHome
-
-echo.
-echo Error: JAVA_HOME not found in your environment. >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-:OkJHome
-if exist "%JAVA_HOME%\bin\java.exe" goto init
-
-echo.
-echo Error: JAVA_HOME is set to an invalid directory. >&2
-echo JAVA_HOME = "%JAVA_HOME%" >&2
-echo Please set the JAVA_HOME variable in your environment to match the >&2
-echo location of your Java installation. >&2
-echo.
-goto error
-
-@REM ==== END VALIDATION ====
-
-:init
-
-@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
-@REM Fallback to current working directory if not found.
-
-set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
-IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
-
-set EXEC_DIR=%CD%
-set WDIR=%EXEC_DIR%
-:findBaseDir
-IF EXIST "%WDIR%"\.mvn goto baseDirFound
-cd ..
-IF "%WDIR%"=="%CD%" goto baseDirNotFound
-set WDIR=%CD%
-goto findBaseDir
-
-:baseDirFound
-set MAVEN_PROJECTBASEDIR=%WDIR%
-cd "%EXEC_DIR%"
-goto endDetectBaseDir
-
-:baseDirNotFound
-set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
-cd "%EXEC_DIR%"
-
-:endDetectBaseDir
-
-IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
-
-@setlocal EnableExtensions EnableDelayedExpansion
-for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
-@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
-
-:endReadAdditionalConfig
-
-SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
-
-set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
-set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
-
-%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
-if ERRORLEVEL 1 goto error
-goto end
-
-:error
-set ERROR_CODE=1
-
-:end
-@endlocal & set ERROR_CODE=%ERROR_CODE%
-
-if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
-@REM check for post script, once with legacy .bat ending and once with .cmd ending
-if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
-if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
-:skipRcPost
-
-@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
-if "%MAVEN_BATCH_PAUSE%" == "on" pause
-
-if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
-
-exit /B %ERROR_CODE%
diff --git a/adapters/mso-openstack-adapters/pom.xml b/adapters/mso-openstack-adapters/pom.xml
index db25f5c721..743c50dc75 100644
--- a/adapters/mso-openstack-adapters/pom.xml
+++ b/adapters/mso-openstack-adapters/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.onap.so</groupId>
<artifactId>adapters</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
</parent>
<artifactId>mso-openstack-adapters</artifactId>
<packaging>jar</packaging>
@@ -188,10 +188,6 @@
</exclusions>
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-dbcp2</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>${cxf.version}</version>
diff --git a/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java b/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java
index 3ec02bfb0e..10dbbf1396 100644
--- a/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java
+++ b/adapters/mso-openstack-adapters/src/main/java/db/migration/R__CloudConfigMigration.java
@@ -53,6 +53,11 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA, R__CloudConfigMigration.class);
@JsonProperty("cloud_config")
private CloudConfig cloudConfig;
+
+ @Override
+ public boolean isUndo(){
+ return false;
+ }
@Override
public void migrate(Connection connection) throws Exception {
diff --git a/adapters/mso-openstack-adapters/src/main/java/db/migration/V4_2__DummyMigration.java b/adapters/mso-openstack-adapters/src/main/java/db/migration/V4_2__DummyMigration.java
deleted file mode 100644
index 6c6366904f..0000000000
--- a/adapters/mso-openstack-adapters/src/main/java/db/migration/V4_2__DummyMigration.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*-
- * ============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 db.migration;
-
-import org.flywaydb.core.api.migration.jdbc.JdbcMigration;
-
-import java.sql.Connection;
-
-public class V4_2__DummyMigration implements JdbcMigration {
- @Override
- public void migrate(Connection connection) throws Exception {
- //does nothing
- }
-}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/BpelRestClient.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/BpelRestClient.java
index cf11ab94c1..6c646f3e63 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/BpelRestClient.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/BpelRestClient.java
@@ -69,7 +69,7 @@ public class BpelRestClient {
private static final String RETRY_COUNT_PROPERTY = PROPERTY_DOMAIN+".retrycount";
private static final String RETRY_INTERVAL_PROPERTY = PROPERTY_DOMAIN+".retryinterval";
private static final String RETRY_LIST_PROPERTY = PROPERTY_DOMAIN+".retrylist";
- private static final String ENCRYPTION_KEY = "aa3871669d893c7fb8abbcda31b88b4f";
+ private static final String ENCRYPTION_KEY_PROP = PROPERTY_DOMAIN + ".encryptionKey";
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, BpelRestClient.class);
@Autowired
@@ -123,7 +123,7 @@ public class BpelRestClient {
retryCount = env.getProperty(RETRY_COUNT_PROPERTY, Integer.class, DEFAULT_RETRY_COUNT);
retryInterval = env.getProperty(RETRY_INTERVAL_PROPERTY, Integer.class, DEFAULT_RETRY_INTERVAL);
setRetryList(env.getProperty(RETRY_LIST_PROPERTY, DEFAULT_RETRY_LIST));
- credentials = getEncryptedProperty(BPEL_AUTH_PROPERTY, DEFAULT_CREDENTIALS, ENCRYPTION_KEY);
+ credentials = getEncryptedProperty(BPEL_AUTH_PROPERTY, DEFAULT_CREDENTIALS, env.getProperty(ENCRYPTION_KEY_PROP));
}
public int getSocketTimeout() {
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java
index b47905d134..6578912b9a 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterAsyncImpl.java
@@ -65,14 +65,14 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA,MsoNetworkAdapterAsyncImpl.class);
private static final MsoAlarmLogger alarmLogger = new MsoAlarmLogger ();
private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.network.bpelauth";
- private static final String ENCRYPTION_KEY = "aa3871669d893c7fb8abbcda31b88b4f";
+ private static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey";
private static final String NETWORK_EXCEPTION_MSG="Got a NetworkException on createNetwork: ";
private static final String CREATE_NETWORK_ERROR_MSG="Error sending createNetwork notification ";
private static final String CREATE_NETWORK_EXCEPTON_MSG="Exception sending createNetwork notification";
private static final String MSO_INTERNAL_ERROR_MSG="MsoInternalError";
@Autowired
private Environment environment;
-
+
@Autowired
private MsoNetworkAdapter networkAdapter;
/**
@@ -619,7 +619,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
Map <String, Object> reqCtx = bp.getRequestContext ();
Map <String, List <String>> headers = new HashMap <> ();
- String userCredentials = this.getEncryptedProperty (BPEL_AUTH_PROP, "", ENCRYPTION_KEY);
+ String userCredentials = this.getEncryptedProperty (BPEL_AUTH_PROP, "", ENCRYPTION_KEY_PROP);
String basicAuth = "Basic " + DatatypeConverter.printBase64Binary (userCredentials.getBytes ());
reqCtx.put (MessageContext.HTTP_REQUEST_HEADERS, headers);
@@ -635,7 +635,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync {
public String getEncryptedProperty(String key, String defaultValue, String encryptionKey) {
try {
- return CryptoUtils.decrypt(this.environment.getProperty(key), encryptionKey);
+ return CryptoUtils.decrypt(this.environment.getProperty(key), this.environment.getProperty(encryptionKey));
} catch (GeneralSecurityException e) {
LOGGER.debug("Exception while decrypting property: " + this.environment.getProperty(key), e);
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java
index 6383f57693..5fa21c64b1 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/BpelRestClient.java
@@ -68,7 +68,7 @@ public class BpelRestClient {
private static final String RETRY_COUNT_PROPERTY = PROPERTY_DOMAIN+".retrycount";
private static final String RETRY_INTERVAL_PROPERTY = PROPERTY_DOMAIN+".retryinterval";
private static final String RETRY_LIST_PROPERTY = PROPERTY_DOMAIN+".retrylist";
- private static final String ENCRYPTION_KEY = "aa3871669d893c7fb8abbcda31b88b4f";
+ private static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey";
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, BpelRestClient.class);
/** Default socket timeout (in seconds) */
@@ -122,7 +122,7 @@ public class BpelRestClient {
retryCount = env.getProperty(RETRY_COUNT_PROPERTY, Integer.class, DEFAULT_RETRY_COUNT);
retryInterval = env.getProperty(RETRY_INTERVAL_PROPERTY, Integer.class, DEFAULT_RETRY_INTERVAL);
setRetryList(env.getProperty(RETRY_LIST_PROPERTY, DEFAULT_RETRY_LIST));
- credentials = getEncryptedProperty(BPEL_AUTH_PROPERTY, DEFAULT_CREDENTIALS, ENCRYPTION_KEY);
+ credentials = getEncryptedProperty(BPEL_AUTH_PROPERTY, DEFAULT_CREDENTIALS, ENCRYPTION_KEY_PROP);
}
public int getSocketTimeout() {
@@ -285,7 +285,7 @@ public class BpelRestClient {
private String getEncryptedProperty(String key, String defaultValue, String encryptionKey) {
if (env.getProperty(key) != null) {
try {
- return CryptoUtils.decrypt(env.getProperty(key), encryptionKey);
+ return CryptoUtils.decrypt(env.getProperty(key), env.getProperty(encryptionKey));
} catch (GeneralSecurityException e) {
LOGGER.debug("Exception while decrypting property: " + env.getProperty(key), e);
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java
index 95135f579d..bd0dc378d2 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImpl.java
@@ -62,7 +62,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, MsoVnfAdapterAsyncImpl.class);
private static MsoAlarmLogger alarmLogger = new MsoAlarmLogger ();
private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.vnf.bpelauth";
- private static final String ENCRYPTION_KEY = "aa3871669d893c7fb8abbcda31b88b4f";
+ private static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey";
@Autowired
private Environment environment;
@@ -640,7 +640,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
Map <String, Object> reqCtx = bp.getRequestContext ();
Map <String, List <String>> headers = new HashMap <> ();
- String userCredentials = this.getEncryptedProperty(BPEL_AUTH_PROP, "", ENCRYPTION_KEY);
+ String userCredentials = this.getEncryptedProperty(BPEL_AUTH_PROP, "", ENCRYPTION_KEY_PROP);
String basicAuth = "Basic " + DatatypeConverter.printBase64Binary (userCredentials.getBytes ());
reqCtx.put (MessageContext.HTTP_REQUEST_HEADERS, headers);
@@ -655,7 +655,7 @@ public class MsoVnfAdapterAsyncImpl implements MsoVnfAdapterAsync {
public String getEncryptedProperty(String key, String defaultValue, String encryptionKey) {
try {
- return CryptoUtils.decrypt(this.environment.getProperty(key), encryptionKey);
+ return CryptoUtils.decrypt(this.environment.getProperty(key), this.environment.getProperty(encryptionKey));
} catch (GeneralSecurityException e) {
LOGGER.debug("Exception while decrypting property: " + this.environment.getProperty(key), e);
}
diff --git a/adapters/mso-openstack-adapters/src/main/resources/application-local.yaml b/adapters/mso-openstack-adapters/src/main/resources/application-local.yaml
index 469744d2de..e07492e56c 100644
--- a/adapters/mso-openstack-adapters/src/main/resources/application-local.yaml
+++ b/adapters/mso-openstack-adapters/src/main/resources/application-local.yaml
@@ -7,7 +7,7 @@ org:
default_keystone_url_version: /v2.0
default_keystone_reg_ex: "/[vV][0-9]"
vnf:
- bpelauth: d95a1aa9bd4d39f3ec23cb5ed2358f5f75fa14bc8c978664355661c0858d2505
+ bpelauth: 1DDAD7A55A230BB446AA2125053EFB46455F43E48B60155E1C53236E175DFC722A6BE120F6DB390C60034C7564AEB653EA
checkRequiredParameters: true
addGetFilesOnVolumeReq: false
sockettimeout: 30
@@ -16,12 +16,13 @@ org:
retryinterval: -15
retrylist: 408,429,500,502,503,504,900
network:
- bpelauth: d95a1aa9bd4d39f3ec23cb5ed2358f5f75fa14bc8c978664355661c0858d2505
+ bpelauth: 1DDAD7A55A230BB446AA2125053EFB46455F43E48B60155E1C53236E175DFC722A6BE120F6DB390C60034C7564AEB653EA
sockettimeout: 5
connecttimeout: 5
retrycount: 5
retryinterval: -15
retrylist: 408,429,500,502,503,504,900
+ encryptionKey: aa3871669d893c7fb8abbcda31b88b4f
tenant:
default_x_aic_orm_client_string: ECOMP-MSO
default_keystone_url_version: /v2.0
@@ -66,7 +67,7 @@ mso:
# H2
spring:
datasource:
- url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;
+ jdbc-url: jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;
username: sa
password: sa
driver-class-name: org.h2.Driver
@@ -110,9 +111,6 @@ spring:
password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
role: ACTUATOR
-#Actuator
-management:
- context-path: /manage
flyway:
outOfOrder: true
diff --git a/adapters/mso-openstack-adapters/src/main/resources/application.yaml b/adapters/mso-openstack-adapters/src/main/resources/application.yaml
index 4b2cf8eb60..88099be07f 100644
--- a/adapters/mso-openstack-adapters/src/main/resources/application.yaml
+++ b/adapters/mso-openstack-adapters/src/main/resources/application.yaml
@@ -17,15 +17,10 @@ mso:
# CatalogDB
spring:
datasource:
- url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/catalogdb
+ jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/catalogdb
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: org.mariadb.jdbc.Driver
- dbcp2:
- initial-size: 5
- max-total: 20
- validation-query: select 1
- test-on-borrow: true
jpa:
show-sql: true
hibernate:
@@ -36,11 +31,30 @@ spring:
#Actuator
-management:
- context-path: /manage
+management:
+ endpoints:
+ web:
+ base-path: /manage
+ server:
+ servlet:
+ context-path: /manage
+ metrics:
+ se-global-registry: false
+ export:
+ prometheus:
+ enabled: true # Whether exporting of metrics to Prometheus is enabled.
+ step: 1m # Step size (i.e. reporting frequency) to use.
+
flyway:
outOfOrder: true
ignoreMissingMigrations: true
baseline-on-migrate: true
validate-on-migrate: false
+
+org:
+ onap:
+ so:
+ adapters:
+ network:
+ encryptionKey: aa3871669d893c7fb8abbcda31b88b4f
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/msoopenstackadapters/EmbeddedMariaDbConfig.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/msoopenstackadapters/EmbeddedMariaDbConfig.java
index f1ee0eae78..d552f8d893 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/msoopenstackadapters/EmbeddedMariaDbConfig.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/msoopenstackadapters/EmbeddedMariaDbConfig.java
@@ -23,7 +23,7 @@ import ch.vorburger.exec.ManagedProcessException;
import ch.vorburger.mariadb4j.DBConfigurationBuilder;
import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
+import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/BpelRestClientTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/BpelRestClientTest.java
index 845155f7f0..02a5f25b41 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/BpelRestClientTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/network/BpelRestClientTest.java
@@ -28,7 +28,7 @@ import org.junit.Test;
import org.onap.so.adapters.vnf.BaseRestTestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
public class BpelRestClientTest extends BaseRestTestUtils {
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/MsoTenantAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/MsoTenantAdapterImplTest.java
index 8a55177f1e..df7e415724 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/MsoTenantAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/tenant/MsoTenantAdapterImplTest.java
@@ -28,7 +28,7 @@ import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.adapters.tenantrest.TenantRollback;
import org.onap.so.cloud.CloudConfig;
import org.onap.so.entity.MsoRequest;
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BaseRestTestUtils.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BaseRestTestUtils.java
index 9ead28b577..017aa26758 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BaseRestTestUtils.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BaseRestTestUtils.java
@@ -37,7 +37,7 @@ import org.onap.so.db.catalog.beans.ServerType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock;
@@ -61,7 +61,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
@SpringBootTest(classes = MsoOpenstackAdaptersApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ActiveProfiles("test")
@AutoConfigureWireMock(port = 0)
-public class BaseRestTestUtils {
+public abstract class BaseRestTestUtils {
@Value("${wiremock.server.port}")
protected int wireMockPort;
@Autowired
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BpelRestClientTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BpelRestClientTest.java
index 1038299190..20a3e62ade 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BpelRestClientTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/BpelRestClientTest.java
@@ -27,7 +27,7 @@ import javax.inject.Provider;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
public class BpelRestClientTest extends BaseRestTestUtils{
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImplTest.java
index d0425371bb..4f1c2c8707 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsyncImplTest.java
@@ -43,7 +43,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.stubFor;
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo;
import static com.github.tomakehurst.wiremock.client.WireMock.verify;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackGetStackVfModule_200;
import static org.onap.so.bpmn.mock.StubOpenStack.mockOpenStackResponseAccess;
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java
index b6f1ad1dcd..f958a5b140 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/MsoVnfMulticloudAdapterImplTest.java
@@ -32,7 +32,7 @@ import org.onap.so.cloud.CloudConfig;
import org.onap.so.db.catalog.beans.CloudSite;
import org.onap.so.entity.MsoRequest;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import javax.xml.ws.Holder;
import java.util.HashMap;
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/QueryTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/QueryTest.java
index d6cdbdfccd..2740e254e1 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/QueryTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/vnf/QueryTest.java
@@ -37,7 +37,7 @@ import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
-import org.mockito.runners.MockitoJUnitRunner;
+import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.adapters.vnf.exceptions.VnfException;
import org.onap.so.openstack.beans.HeatStatus;
import org.onap.so.openstack.beans.StackInfo;
diff --git a/adapters/mso-openstack-adapters/src/test/resources/application-nomigrate.yaml b/adapters/mso-openstack-adapters/src/test/resources/application-nomigrate.yaml
index c508b6e2d6..95b48cd8aa 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/application-nomigrate.yaml
+++ b/adapters/mso-openstack-adapters/src/test/resources/application-nomigrate.yaml
@@ -7,7 +7,7 @@ org:
default_keystone_url_version: /v2.0
default_keystone_reg_ex: "/[vV][0-9]"
vnf:
- bpelauth: 481E6A95CE97E393A53363750D5E1E75
+ bpelauth: 4771D91C24BB25366730561D630B131818CD9FF8D686AA8807F4CB30E1324C46ED16197C07
checkRequiredParameters: true
addGetFilesOnVolumeReq: false
sockettimeout: 30
@@ -16,7 +16,7 @@ org:
retryinterval: -15
retrylist: 408,429,500,502,503,504,900
network:
- bpelauth: 481E6A95CE97E393A53363750D5E1E75
+ bpelauth: 4771D91C24BB25366730561D630B131818CD9FF8D686AA8807F4CB30E1324C46ED16197C07
sockettimeout: 5
connecttimeout: 5
retrycount: 5
@@ -81,12 +81,11 @@ mso:
queue-capacity: 500
spring:
datasource:
- url: jdbc:mariadb://localhost:3307/catalogdb
+ jdbc-url: jdbc:mariadb://localhost:3307/catalogdb
username: root
password: password
driver-class-name: org.mariadb.jdbc.Driver
- initialize: true
- initialization-mode: never
+ initialization-mode: always
jpa:
generate-ddl: false
show-sql: false
@@ -95,6 +94,10 @@ spring:
naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
enable-lazy-load-no-trans: true
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+ flyway:
+ baseline-on-migrate: true
+ out-of-order: true
+ ignore-missing-migrations: true
security:
usercredentials:
-
@@ -115,8 +118,3 @@ management:
endpoint:
info:
enabled: true
-
-flyway:
- baseline-on-migrate: true
- outOfOrder: true
- ignoreMissingMigrations: true \ No newline at end of file
diff --git a/adapters/mso-openstack-adapters/src/test/resources/application-test.yaml b/adapters/mso-openstack-adapters/src/test/resources/application-test.yaml
index d15978357a..58bde2ef14 100644
--- a/adapters/mso-openstack-adapters/src/test/resources/application-test.yaml
+++ b/adapters/mso-openstack-adapters/src/test/resources/application-test.yaml
@@ -7,7 +7,7 @@ org:
default_keystone_url_version: /v2.0
default_keystone_reg_ex: "/[vV][0-9]"
vnf:
- bpelauth: 481E6A95CE97E393A53363750D5E1E75
+ bpelauth: 4771D91C24BB25366730561D630B131818CD9FF8D686AA8807F4CB30E1324C46ED16197C07
checkRequiredParameters: true
addGetFilesOnVolumeReq: false
sockettimeout: 30
@@ -16,13 +16,14 @@ org:
retryinterval: -15
retrylist: 408,429,500,502,503,504,900
network:
- bpelauth: 481E6A95CE97E393A53363750D5E1E75
+ bpelauth: 4771D91C24BB25366730561D630B131818CD9FF8D686AA8807F4CB30E1324C46ED16197C07
sockettimeout: 5
connecttimeout: 5
retrycount: 5
retryinterval: -15
retrylist: 408,429,500,502,503,504,900
- tenant:
+ encryptionKey: aa3871669d893c7fb8abbcda31b88b4f
+ tenant:
default_x_aic_orm_client_string: ONAP-SO
default_keystone_url_version: /v2.0
default_keystone_reg_ex: "/[vV][0-9]"
@@ -81,20 +82,21 @@ mso:
queue-capacity: 500
spring:
datasource:
- url: jdbc:mariadb://localhost:3307/catalogdb
+ jdbc-url: jdbc:mariadb://localhost:3307/catalogdb
username: root
password: password
driver-class-name: org.mariadb.jdbc.Driver
- initialize: true
- initialization-mode: never
+ initialization-mode: always
jpa:
generate-ddl: false
show-sql: false
hibernate:
ddl-auto: none
- naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
- enable-lazy-load-no-trans: true
database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
+ flyway:
+ baseline-on-migrate: true
+ out-of-order: true
+ ignore-missing-migrations: true
security:
usercredentials:
-
@@ -109,12 +111,20 @@ mariaDB4j:
#Actuator
-management:
+management:
endpoints:
- enabled-by-default: false
- endpoint:
- info:
- enabled: true
+ web:
+ base-path: /manage
+ server:
+ servlet:
+ context-path: /manage
+ metrics:
+ se-global-registry: false
+ export:
+ prometheus:
+ enabled: true # Whether exporting of metrics to Prometheus is enabled.
+ step: 1m # Step size (i.e. reporting frequency) to use.
+
cloud_config:
identity_services:
@@ -148,7 +158,3 @@ cloud_config:
version: "2.0"
-flyway:
- baseline-on-migrate: true
- outOfOrder: true
- ignoreMissingMigrations: true \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/pom.xml b/adapters/mso-requests-db-adapter/pom.xml
index 9dff66b00d..4a4d09a0a9 100644
--- a/adapters/mso-requests-db-adapter/pom.xml
+++ b/adapters/mso-requests-db-adapter/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.onap.so</groupId>
<artifactId>adapters</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.so.adapters</groupId>
@@ -20,17 +20,7 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-jdbc</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>tomcat-jdbc</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-dbcp2</artifactId>
+ <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
@@ -51,12 +41,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
@@ -102,13 +87,11 @@
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
- <artifactId>micrometer-spring-legacy</artifactId>
- <version>1.0.5</version>
+ <artifactId>micrometer-core</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
- <version>1.0.5</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java
index 28c56b32cd..2a661a7a6a 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsScheduler.java
@@ -113,6 +113,7 @@ public class ArchiveInfraRequestsScheduler {
archivedInfra.setNetworkType(iar.getNetworkType());
archivedInfra.setOperationalEnvId(iar.getOperationalEnvId());
archivedInfra.setOperationalEnvName(iar.getOperationalEnvName());
+ archivedInfra.setRequestUrl(iar.getRequestUrl());
archivedInfra.setProgress(iar.getProgress());
archivedInfra.setProvStatus(iar.getProvStatus());
archivedInfra.setRequestAction(iar.getRequestAction());
@@ -150,9 +151,9 @@ public class ArchiveInfraRequestsScheduler {
}
logger.info("Creating archivedInfraRequest records: " + newArchivedReqs.size());
- archivedInfraRepo.save(newArchivedReqs);
+ archivedInfraRepo.saveAll(newArchivedReqs);
logger.info("Deleting InfraActiveRequest records: "+ oldInfraReqs.size());
- infraActiveRepo.delete(oldInfraReqs);
+ infraActiveRepo.deleteAll(oldInfraReqs);
}
}
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
index 33b1028cbb..dc6abce759 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/MsoRequestsDbAdapterImpl.java
@@ -264,7 +264,9 @@ public class MsoRequestsDbAdapterImpl implements MsoRequestsDbAdapter {
String resourceTemplateUUID) throws MsoRequestsDbException {
return resourceOperationStatusRepository
- .findOne(new ResourceOperationStatusId(serviceId, operationId, resourceTemplateUUID));
+ .findById(new ResourceOperationStatusId(serviceId, operationId, resourceTemplateUUID)).
+ orElseThrow( () -> new MsoRequestsDbException("Operation not found:" + operationId));
+
}
/**
diff --git a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java
index bc1e17b067..99fa770974 100644
--- a/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java
+++ b/adapters/mso-requests-db-adapter/src/main/java/org/onap/so/adapters/requestsdb/application/RequestDBConfig.java
@@ -25,7 +25,7 @@ import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
+import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.context.annotation.Bean;
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml b/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml
index 41b72ba08f..b2b16274aa 100644
--- a/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml
+++ b/adapters/mso-requests-db-adapter/src/main/resources/application-local.yaml
@@ -17,7 +17,7 @@ mso:
period: 180
spring:
datasource:
- url: jdbc:mariadb://localhost:3306/requestdb
+ jdbc-url: jdbc:mariadb://localhost:3306/requestdb
username: catalog
password: catalog123
driver-class-name: org.mariadb.jdbc.Driver
@@ -42,9 +42,6 @@ spring:
password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
role: ACTUATOR
-#Actuator
-management:
- context-path: /manage
flyway:
baseline-on-migrate: false
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/application.yaml b/adapters/mso-requests-db-adapter/src/main/resources/application.yaml
index 4f423ca870..4d200d25b8 100644
--- a/adapters/mso-requests-db-adapter/src/main/resources/application.yaml
+++ b/adapters/mso-requests-db-adapter/src/main/resources/application.yaml
@@ -4,17 +4,21 @@ server:
port: 8080
tomcat:
max-threads: 50
-
+ssl-enable: false
mso:
- site-name: unknown
- logPath: ./logs/reqdb/
+ adapters:
+ requestDb:
+ auth: Basic YnBlbDptc28tZGItMTUwNyE=
+ endpoint: http://localhost:8081
+ logPath: .logs/reqdb
+ site-name: unkwon
infra-requests:
archived:
period: 180
# H2
spring:
datasource:
- url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb
+ jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: org.mariadb.jdbc.Driver
@@ -30,18 +34,32 @@ spring:
ddl-auto: validate
naming-strategy: org.hibernate.cfg.ImprovedNamingStrategy
enable-lazy-load-no-trans: true
+ security:
+ usercredentials:
+ -
+ username: bpel
+ password: '$2a$12$1xyutEZNfjGewIZRfKaE8eZE99f5sYFUmmM80BobI65KNjmcK0JuO'
+ role: BPEL-Client
+ -
+ username: mso_admin
+ password: '$2a$12$tidKuu.h88E2nuL95pTVY.ZOYMN/1dp29A9b1o.0GFDsVVSYlMkHa'
+ role: ACTUATOR
flyway:
baseline-on-migrate: false
- url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb
+ jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb
user: ${DB_ADMIN_USERNAME}
password: ${DB_ADMIN_PASSWORD}
-#Actuator
-management:
- context-path: /manage
+management:
+ endpoints:
+ web:
+ base-path: /manage
+ server:
+ servlet:
+ context-path: /manage
metrics:
se-global-registry: false
export:
prometheus:
enabled: true # Whether exporting of metrics to Prometheus is enabled.
- step: 1m # Step size (i.e. reporting frequency) to use. \ No newline at end of file
+ step: 1m # Step size (i.e. reporting frequency) to use.
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.13__Add_Rollback_Status_Message_To_Infra_Active_Reqests.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.13__Add_Rollback_Status_Message_To_Infra_Active_Reqests.sql
new file mode 100644
index 0000000000..41c10a2f07
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V4.13__Add_Rollback_Status_Message_To_Infra_Active_Reqests.sql
@@ -0,0 +1,4 @@
+use requestdb;
+
+ALTER TABLE infra_active_requests ADD ROLLBACK_STATUS_MESSAGE LONGTEXT;
+ALTER TABLE archived_infra_requests ADD ROLLBACK_STATUS_MESSAGE LONGTEXT; \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.1__Add_Column_Request_url_varchar500.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.1__Add_Column_Request_url_varchar500.sql
new file mode 100644
index 0000000000..161ba61b60
--- /dev/null
+++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.1__Add_Column_Request_url_varchar500.sql
@@ -0,0 +1,9 @@
+use requestdb;
+
+ALTER TABLE infra_active_requests
+ADD COLUMN REQUEST_URL varchar(500)
+AFTER OPERATIONAL_ENV_NAME;
+
+ALTER TABLE archived_infra_requests
+ADD COLUMN REQUEST_URL varchar(500)
+AFTER OPERATIONAL_ENV_NAME; \ No newline at end of file
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestdb/rest/RequestProcessingDataRequestDbQueryTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestdb/rest/RequestProcessingDataRequestDbQueryTest.java
index c1e620ba74..34643a428d 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestdb/rest/RequestProcessingDataRequestDbQueryTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestdb/rest/RequestProcessingDataRequestDbQueryTest.java
@@ -34,7 +34,7 @@ import org.onap.so.adapters.requestsdb.application.MSORequestDBApplication;
import org.onap.so.db.request.beans.RequestProcessingData;
import org.onap.so.db.request.client.RequestsDbClient;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsSchedulerTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsSchedulerTest.java
index f05a301caa..1c7effd00a 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsSchedulerTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/ArchiveInfraRequestsSchedulerTest.java
@@ -63,7 +63,7 @@ public class ArchiveInfraRequestsSchedulerTest {
@Test
@Transactional
- public void testArchiveInfraRequests() {
+ public void testArchiveInfraRequests() throws Exception {
String requestId1 = "requestId1";
String requestId2 = "requestId2";
@@ -78,32 +78,15 @@ public class ArchiveInfraRequestsSchedulerTest {
List<InfraActiveRequests> requests = new ArrayList<>();
requests.add(iar1);
requests.add(iar2);
- iarRepo.save(requests);
+ iarRepo.saveAll(requests);
scheduler.archiveInfraRequests(requests);
assertEquals(2, archivedRepo.count());
- assertEquals(requestId1, archivedRepo.findOne(requestId1).getRequestId());
- assertEquals(requestId2, archivedRepo.findOne(requestId2).getRequestId());
+ assertEquals(requestId1, archivedRepo.findById(requestId1)
+ .orElseThrow( () -> new Exception("Request Not Found")).getRequestId());
+ assertEquals(requestId2, archivedRepo.findById(requestId2).
+ orElseThrow( () -> new Exception("Request Not Found")).getRequestId());
}
- @Test
- @Ignore
- public void testInfraRequestsScheduledTask() {
- Date currentDate= new Date();
- Calendar calendar = Calendar.getInstance();
- calendar.setTime(currentDate);
- calendar.add(Calendar.DATE, -archivedPeriod);
- Date archivingDate = calendar.getTime();
-
- List<InfraActiveRequests> requests = iarRepo.findByEndTimeLessThan(archivingDate, new PageRequest(0, 100));
- List<InfraActiveRequests> requests2 = iarRepo.findByStartTimeLessThanAndEndTime(archivingDate, null, new PageRequest(0, 100));
-
- int total = requests.size() + requests2.size();
-
- scheduler.infraRequestsScheduledTask();
-
- assertTrue(archivedRepo.count() >= total);
- assertTrue(iarRepo.count() < total);
- }
}
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java
index 58fd517c91..8fda355abb 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/InfraActiveRequestsRepositoryCustomControllerTest.java
@@ -29,7 +29,7 @@ import org.onap.so.adapters.requestsdb.application.MSORequestDBApplication;
import org.onap.so.db.request.beans.InfraActiveRequests;
import org.onap.so.db.request.data.controller.InstanceNameDuplicateCheckRequest;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.core.ParameterizedTypeReference;
@@ -96,6 +96,7 @@ public class InfraActiveRequestsRepositoryCustomControllerTest {
assertEquals(infraActiveRequests.getOperationalEnvName(), infraActiveRequestsResponse.getOperationalEnvName());
assertEquals(infraActiveRequests.getRequestStatus(), infraActiveRequestsResponse.getRequestStatus());
assertEquals(infraActiveRequests.getAction(), infraActiveRequestsResponse.getAction());
+ assertEquals(infraActiveRequests.getRequestUrl(), infraActiveRequestsResponse.getRequestUrl());
}
@Before
@@ -132,6 +133,7 @@ public class InfraActiveRequestsRepositoryCustomControllerTest {
infraActiveRequests.setOperationalEnvName(UUID.randomUUID().toString());
infraActiveRequests.setRequestStatus("IN_PROGRESS");
infraActiveRequests.setAction("create");
+ infraActiveRequests.setRequestUrl("http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances");
HttpEntity<String> entity = new HttpEntity(infraActiveRequests, headers);
@@ -267,4 +269,45 @@ public class InfraActiveRequestsRepositoryCustomControllerTest {
verifyInfraActiveRequests();
}
+
+ @Test
+ public void checkInstanceNameDuplicateTestNotFound() {
+
+ String instanceNameDuplicateCheckRequest = "{\r\n\t \"instanceName\":\"TestNotFoundInstanceName\",\r\n\t \"requestScope\":\"testasdfasdfasdf\"\r\n}";
+
+ HttpEntity<InstanceNameDuplicateCheckRequest> entityList = new HttpEntity(instanceNameDuplicateCheckRequest, headers);
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort("/infraActiveRequests") + "/checkInstanceNameDuplicate");
+
+ ResponseEntity<InfraActiveRequests> response = restTemplate.exchange(
+ builder.toUriString(),
+ HttpMethod.POST, entityList, new ParameterizedTypeReference<InfraActiveRequests>() {
+ });
+
+ assertEquals(200, response.getStatusCodeValue());
+ assertEquals(null, response.getBody());
+ }
+
+ @Test
+ public void checkInstanceNameDuplicateViaTestNotFound() {
+
+ Map<String, String> requestMap = new HashMap<>();
+ requestMap.put("operationalEnvironmentId", "NotFoundOperationalEnvId");
+
+ InstanceNameDuplicateCheckRequest instanceNameDuplicateCheckRequest = new InstanceNameDuplicateCheckRequest((HashMap<String, String>) requestMap,
+ null,
+ infraActiveRequests.getRequestScope());
+
+ HttpEntity<InstanceNameDuplicateCheckRequest> entityList = new HttpEntity(instanceNameDuplicateCheckRequest, headers);
+ UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(createURLWithPort("/infraActiveRequests") + "/checkInstanceNameDuplicate");
+
+ ResponseEntity<InfraActiveRequests> response = restTemplate.exchange(
+ builder.toUriString(),
+ HttpMethod.POST, entityList, new ParameterizedTypeReference<InfraActiveRequests>() {
+ });
+
+ infraActiveRequestsResponse = response.getBody();
+
+ assertEquals(200, response.getStatusCodeValue());
+ assertEquals(null, response.getBody());
+ }
}
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/HealthCheckHandlerTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/HealthCheckHandlerTest.java
index fc12120166..32eb40aed8 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/HealthCheckHandlerTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/HealthCheckHandlerTest.java
@@ -31,7 +31,7 @@ import org.onap.logging.ref.slf4j.ONAPLogConstants;
import org.onap.so.adapters.requestsdb.application.MSORequestDBApplication;
import org.onap.so.adapters.requestsdb.application.TestAppender;
import org.onap.so.logger.MsoLogger;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.HttpEntity;
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
index 571a2c053f..7c2dd1241f 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/adapters/MSORequestDBImplTest.java
@@ -50,7 +50,7 @@ import org.onap.so.logger.MsoLogger;
import org.onap.so.requestsdb.RequestsDbConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.test.context.ActiveProfiles;
@@ -109,6 +109,7 @@ public class MSORequestDBImplTest {
testRequest.setVfModuleId("c7d527b1-7a91-49fd-b97d-1c8c0f4a7992");
testRequest.setVfModuleModelName("vSAMP10aDEV::base::module-0");
testRequest.setVnfId("b92f60c8-8de3-46c1-8dc1-e4390ac2b005");
+ testRequest.setRequestUrl("http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances");
return testRequest;
}
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/application/EmbeddedMariaDbConfig.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/application/EmbeddedMariaDbConfig.java
index cd07f6757f..c1848e3aad 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/application/EmbeddedMariaDbConfig.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/application/EmbeddedMariaDbConfig.java
@@ -25,7 +25,7 @@ import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
+import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.context.annotation.Bean;
diff --git a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java
index 7c037e4885..efb5932e51 100644
--- a/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java
+++ b/adapters/mso-requests-db-adapter/src/test/java/org/onap/so/adapters/requestsdb/client/RequestsDbClientTest.java
@@ -30,7 +30,7 @@ import org.onap.so.db.request.beans.OperationalEnvDistributionStatus;
import org.onap.so.db.request.beans.OperationalEnvServiceModelStatus;
import org.onap.so.db.request.beans.RequestProcessingData;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
@@ -88,6 +88,7 @@ public class RequestsDbClientTest {
infraActiveRequests.setRequestStatus("IN_PROGRESS");
infraActiveRequests.setAction("create");
infraActiveRequests.setRequestAction("someaction");
+ infraActiveRequests.setRequestUrl("http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances");
requestsDbClient.save(infraActiveRequests);
}
@@ -174,7 +175,17 @@ public class RequestsDbClientTest {
assertNull(requestsDbClient.getInfraActiveRequestbyRequestId(UUID.randomUUID().toString()));
}
+ @Test
+ public void getInfraActiveRequestbyRequestIdWhereRequestUrlNullTest(){
+ // requestUrl setup to null and save
+ infraActiveRequests.setRequestUrl(null);
+ requestsDbClient.save(infraActiveRequests);
+ InfraActiveRequests infraActiveRequestsResponse = requestsDbClient.getInfraActiveRequestbyRequestId(infraActiveRequests.getRequestId());
+ verifyInfraActiveRequests(infraActiveRequestsResponse);
+ assertNull(infraActiveRequestsResponse.getRequestUrl());
+ }
+
@Test
public void getOneByServiceIdAndOperationIdTest(){
OperationStatus operationStatus = new OperationStatus();
diff --git a/adapters/mso-requests-db-adapter/src/test/resources/application-test.yaml b/adapters/mso-requests-db-adapter/src/test/resources/application-test.yaml
index 35b3ec9360..19bff50ea3 100644
--- a/adapters/mso-requests-db-adapter/src/test/resources/application-test.yaml
+++ b/adapters/mso-requests-db-adapter/src/test/resources/application-test.yaml
@@ -19,7 +19,7 @@ mso:
period: 0
spring:
datasource:
- url: jdbc:mariadb://localhost:3307/requestdb
+ jdbc-url: jdbc:mariadb://localhost:3307/requestdb
username: root
password: password
driver-class-name: org.mariadb.jdbc.Driver
@@ -48,15 +48,23 @@ mariaDB4j:
port: 3307
databaseName: requestdb
-#Actuator
management:
- security:
- enabled: false
- basic:
- enabled: false
+ endpoints:
+ web:
+ base-path: /manage
+ server:
+ servlet:
+ context-path: /manage
+ metrics:
+ se-global-registry: false
+ export:
+ prometheus:
+ enabled: true # Whether exporting of metrics to Prometheus is enabled.
+ step: 1m # Step size (i.e. reporting frequency) to use.
+
flyway:
baseline-on-migrate: false
- url: jdbc:mariadb://localhost:3307/requestdb
+ jdbc-url: jdbc:mariadb://localhost:3307/requestdb
user: root
password: password
diff --git a/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
index fcfd1483da..adfc7314be 100644
--- a/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
+++ b/adapters/mso-requests-db-adapter/src/test/resources/db/migration/afterMigrate.sql
@@ -4,13 +4,13 @@ insert into operation_status(service_id, operation_id, service_name, user_id, re
('serviceid', 'operationid', 'servicename', 'userid', 'result', 'operationcontent', 'progress', 'reason', '2016-11-24 13:19:10', '2016-11-24 13:19:10');
-insert into infra_active_requests(request_id, client_request_id, action, request_status, status_message, progress, start_time, end_time, source, vnf_id, vnf_name, vnf_type, service_type, aic_node_clli, tenant_id, prov_status, vnf_params, vnf_outputs, request_body, response_body, last_modified_by, modify_time, request_type, volume_group_id, volume_group_name, vf_module_id, vf_module_name, vf_module_model_name, aai_service_id, aic_cloud_region, callback_url, correlator, network_id, network_name, network_type, request_scope, request_action, service_instance_id, service_instance_name, requestor_id, configuration_id, configuration_name, operational_env_id, operational_env_name) values
-('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails":{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', null, 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null),
-('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null),
-('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<vnf-request xmlns=\"http://org.onap.so/mso/infra/vnf-request/v1\">\n <request-info>\n <request-id>001619d2-a297-4a4b-a9f5-e2823c88458f</request-id>\n <action>CREATE_VF_MODULE</action>\n <source>PORTAL</source>\n </request-info>\n <vnf-inputs>\n <vnf-name>test-vscp</vnf-name>\n <vf-module-name>moduleName</vf-module-name>\n <vnf-type>elena_test21</vnf-type>\n <vf-module-model-name>moduleModelName</vf-module-model-name>\n <asdc-service-model-version>1.0</asdc-service-model-version>\n <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>\n <aic-cloud-region>mtn9</aic-cloud-region>\n <tenant-id>381b9ff6c75e4625b7a4182f90fc68d3</tenant-id>\n <persona-model-id></persona-model-id>\n <persona-model-version></persona-model-version>\n <is-base-vf-module>false</is-base-vf-module>\n </vnf-inputs>\n <vnf-params xmlns:tns=\"http://org.onap.so/mso/infra/vnf-request/v1\"/>\n</vnf-request>\n', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null),
-('00164b9e-784d-48a8-8973-bbad6ef818ed', null, 'createInstance', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"requestDetails":{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-MTN6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-MTN6-3100-0927-1', 'xxxxxx', null, null, null, null),
-('00173cc9-5ce2-4673-a810-f87fefb2829e', null, 'createInstance', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null),
-('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', null, 'activateInstance', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, null, null, null, null, '{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"MSOTADevInfra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":false},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null);
+insert into infra_active_requests(request_id, client_request_id, action, request_status, status_message, progress, start_time, end_time, source, vnf_id, vnf_name, vnf_type, service_type, aic_node_clli, tenant_id, prov_status, vnf_params, vnf_outputs, request_body, response_body, last_modified_by, modify_time, request_type, volume_group_id, volume_group_name, vf_module_id, vf_module_name, vf_module_model_name, aai_service_id, aic_cloud_region, callback_url, correlator, network_id, network_name, network_type, request_scope, request_action, service_instance_id, service_instance_name, requestor_id, configuration_id, configuration_name, operational_env_id, operational_env_name, request_url) values
+('00032ab7-3fb3-42e5-965d-8ea592502017', '00032ab7-3fb3-42e5-965d-8ea592502016', 'deleteInstance', 'COMPLETE', 'Vf Module has been deleted successfully.', '100', '2016-12-22 18:59:54', '2016-12-22 19:00:28', 'VID', 'b92f60c8-8de3-46c1-8dc1-e4390ac2b005', null, null, null, null, '6accefef3cb442ff9e644d589fb04107', null, null, null, '{"requestDetails":{"modelInfo":{"modelType":"vfModule","modelName":"vSAMP10aDEV::base::module-0"},"requestInfo":{"source":"VID"},"cloudConfiguration":{"tenantId":"6accefef3cb442ff9e644d589fb04107","lcpCloudRegionId":"mtn6"}}}', null, 'BPMN', '2016-12-22 19:00:28', null, null, null, 'c7d527b1-7a91-49fd-b97d-1c8c0f4a7992', null, 'vSAMP10aDEV::base::module-0', null, 'mtn6', null, null, null, null, null, 'vfModule', 'deleteInstance', 'e3b5744d-2ad1-4cdd-8390-c999a38829bc', null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00093944-bf16-4373-ab9a-3adfe730ff2d', null, 'createInstance', 'FAILED', 'Error: Locked instance - This service (MSODEV_1707_SI_vSAMP10a_011-4) already has a request being worked with a status of IN_PROGRESS (RequestId - 278e83b1-4f9f-450e-9e7d-3700a6ed22f4). The existing request must finish or be cleaned up before proceeding.', '100', '2017-07-11 18:33:26', '2017-07-11 18:33:26', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"9647dfc4-2083-11e7-93ae-92361f002671","modelType":"service","modelName":"MSOTADevInfra_vSAMP10a_Service","modelVersion":"1.0","modelVersionId":"5df8b6de-2083-11e7-93ae-92361f002671"},"requestInfo":{"source":"VID","instanceName":"MSODEV_1707_SI_vSAMP10a_011-4","suppressRollback":false,"requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarteSet":true,"alaCarte":true}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', null, 'MSODEV_1707_SI_vSAMP10a_011-4', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('001619d2-a297-4a4b-a9f5-e2823c88458f', '001619d2-a297-4a4b-a9f5-e2823c88458f', 'CREATE_VF_MODULE', 'COMPLETE', 'COMPLETED', '100', '2016-07-01 14:11:42', '2017-05-02 16:03:34', 'PORTAL', null, 'test-vscp', 'elena_test21', null, null, '381b9ff6c75e4625b7a4182f90fc68d3', null, null, null, '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<vnf-request xmlns=\"http://org.onap.so/mso/infra/vnf-request/v1\">\n <request-info>\n <request-id>001619d2-a297-4a4b-a9f5-e2823c88458f</request-id>\n <action>CREATE_VF_MODULE</action>\n <source>PORTAL</source>\n </request-info>\n <vnf-inputs>\n <vnf-name>test-vscp</vnf-name>\n <vf-module-name>moduleName</vf-module-name>\n <vnf-type>elena_test21</vnf-type>\n <vf-module-model-name>moduleModelName</vf-module-model-name>\n <asdc-service-model-version>1.0</asdc-service-model-version>\n <service-id>a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb</service-id>\n <aic-cloud-region>mtn9</aic-cloud-region>\n <tenant-id>381b9ff6c75e4625b7a4182f90fc68d3</tenant-id>\n <persona-model-id></persona-model-id>\n <persona-model-version></persona-model-version>\n <is-base-vf-module>false</is-base-vf-module>\n </vnf-inputs>\n <vnf-params xmlns:tns=\"http://org.onap.so/mso/infra/vnf-request/v1\"/>\n</vnf-request>\n', 'NONE', 'RDBTEST', '2016-07-01 14:11:42', 'VNF', null, null, null, 'MODULENAME1', 'moduleModelName', 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb', 'mtn9', null, null, null, null, null, 'vfModule', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00164b9e-784d-48a8-8973-bbad6ef818ed', null, 'createInstance', 'COMPLETE', 'Service Instance was created successfully.', '100', '2017-09-28 12:45:51', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, '19123c2924c648eb8e42a3c1f14b7682', null, null, null, '{"requestDetails":{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"52b49b5d-3086-4ffd-b5e6-1b1e5e7e062f","modelType":"service","modelNameVersionId":null,"modelName":"MSO Test Network","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"aed5a5b7-20d3-44f7-90a3-ddbd16f14d1e","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":"DEV-MTN6-3100-0927-1","suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":null,"subscriberInfo":{"globalSubscriberId":"MSO_1610_dev","subscriberName":"MSO_1610_dev"},"cloudConfiguration":{"aicNodeClli":null,"tenantId":"19123c2924c648eb8e42a3c1f14b7682","lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":"MSO-dev-service-type","userParams":[{"name":"someUserParam","value":"someValue"}],"aLaCarte":true,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":true},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}}', null, 'CreateGenericALaCarteServiceInstance', '2017-09-28 12:45:52', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'service', 'createInstance', 'b2f59173-b7e5-4e0f-8440-232fd601b865', 'DEV-MTN6-3100-0927-1', 'xxxxxx', null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('00173cc9-5ce2-4673-a810-f87fefb2829e', null, 'createInstance', 'FAILED', 'Error parsing request. No valid instanceName is specified', '100', '2017-04-14 21:08:46', '2017-04-14 21:08:46', 'VID', null, null, null, null, null, 'a259ae7b7c3f493cb3d91f95a7c18149', null, null, null, '{"requestDetails":{"modelInfo":{"modelInvariantId":"ff6163d4-7214-459e-9f76-507b4eb00f51","modelType":"service","modelName":"ConstraintsSrvcVID","modelVersion":"2.0","modelVersionId":"722d256c-a374-4fba-a14f-a59b76bb7656"},"requestInfo":{"productFamilyId":"LRSI-OSPF","source":"VID","requestorId":"xxxxxx"},"subscriberInfo":{"globalSubscriberId":"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"},"cloudConfiguration":{"tenantId":"a259ae7b7c3f493cb3d91f95a7c18149","lcpCloudRegionId":"mtn16"},"requestParameters":{"subscriptionServiceType":"Mobility","userParams":[{"name":"neutronport6_name","value":"8"},{"name":"neutronnet5_network_name","value":"8"},{"name":"contrailv2vlansubinterface3_name","value":"false"}]}}}', null, 'APIH', '2016-12-22 19:00:28', null, null, null, null, null, null, null, 'mtn16', null, null, null, null, null, 'service', 'createInstance', null, null, null, null, null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances'),
+('0017f68c-eb2d-45bb-b7c7-ec31b37dc349', null, 'activateInstance', 'UNLOCKED', null, '20', '2017-09-26 16:09:29', '2017-09-28 12:45:53', 'VID', null, null, null, null, null, null, null, null, null, '{"requestDetails":{"modelInfo":{"modelCustomizationName":null,"modelInvariantId":"1587cf0e-f12f-478d-8530-5c55ac578c39","modelType":"configuration","modelNameVersionId":null,"modelName":null,"modelVersion":null,"modelCustomizationUuid":null,"modelVersionId":"36a3a8ea-49a6-4ac8-b06c-89a545444455","modelCustomizationId":"68dc9a92-214c-11e7-93ae-92361f002671","modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"requestInfo":{"billingAccountNumber":null,"callbackUrl":null,"correlator":null,"orderNumber":null,"productFamilyId":null,"orderVersion":null,"source":"VID","instanceName":null,"suppressRollback":false,"requestorId":"xxxxxx"},"relatedInstanceList":[{"relatedInstance":{"instanceName":null,"instanceId":"9e15a443-af65-4f05-9000-47ae495e937d","modelInfo":{"modelCustomizationName":null,"modelInvariantId":"de19ae10-9a25-11e7-abc4-cec278b6b50a","modelType":"service","modelNameVersionId":null,"modelName":"MSOTADevInfra_Configuration_Service","modelVersion":"1.0","modelCustomizationUuid":null,"modelVersionId":"ee938612-9a25-11e7-abc4-cec278b6b50a","modelCustomizationId":null,"modelUuid":null,"modelInvariantUuid":null,"modelInstanceName":null},"instanceDirection":null}}],"subscriberInfo":null,"cloudConfiguration":{"aicNodeClli":null,"tenantId":null,"lcpCloudRegionId":"mtn6"},"requestParameters":{"subscriptionServiceType":null,"userParams":[],"aLaCarte":false,"autoBuildVfModules":false,"cascadeDelete":false,"usePreload":true,"alaCarte":false},"project":null,"owningEntity":null,"platform":null,"lineOfBusiness":null}}', null, 'APIH', '2017-09-26 16:09:29', null, null, null, null, null, null, null, 'mtn6', null, null, null, null, null, 'configuration', 'activateInstance', '9e15a443-af65-4f05-9000-47ae495e937d', null, 'xxxxxx', '26ef7f15-57bb-48df-8170-e59edc26234c', null, null, null, 'http://localhost:8080/onap/so/infra/serviceInstantiation/v7/serviceInstances');
insert into watchdog_distributionid_status(distribution_id, distribution_id_status, create_time, modify_time) values
('1533c4bd-a3e3-493f-a16d-28c20614415e', '', '2017-11-30 15:48:09', '2017-11-30 15:48:09'),
diff --git a/adapters/mso-sdnc-adapter/pom.xml b/adapters/mso-sdnc-adapter/pom.xml
index 7723ffa691..8e94db1aa0 100644
--- a/adapters/mso-sdnc-adapter/pom.xml
+++ b/adapters/mso-sdnc-adapter/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.onap.so</groupId>
<artifactId>adapters</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
</parent>
<artifactId>mso-sdnc-adapter</artifactId>
<properties>
@@ -93,21 +93,9 @@
<version>1.5.16</version>
</dependency>
<dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mariadb.jdbc</groupId>
- <artifactId>mariadb-java-client</artifactId>
- </dependency>
- <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
- </dependency>
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-data-jpa</artifactId>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
@@ -151,13 +139,11 @@
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
- <artifactId>micrometer-spring-legacy</artifactId>
- <version>1.0.5</version>
+ <artifactId>micrometer-core</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
- <artifactId>micrometer-registry-prometheus</artifactId>
- <version>1.0.5</version>
+ <artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
<dependency>
<groupId>org.onap.so</groupId>
@@ -165,4 +151,4 @@
<version>${project.version}</version>
</dependency>
</dependencies>
-</project> \ No newline at end of file
+</project>
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
index f88aab08a6..2fd0a58dda 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
@@ -29,12 +29,9 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
-import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@SpringBootApplication(scanBasePackages = { "org.onap" })
-@EnableJpaRepositories({"org.onap.so.db.request.data.repository"})
-@EntityScan({ "org.onap.so.db.request.beans"})
public class SDNCAdapterApplication {
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Constants.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Constants.java
index d114788267..09597b26b7 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Constants.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Constants.java
@@ -28,13 +28,8 @@ public interface Constants {
public static final String DEFAULT_BPEL_URL = "http://localhost:8080//active-bpel/services/SDNCAdapterCallbackV1";
public static final String MY_URL_PROP = "org.onap.so.adapters.sdnc.myurl";
- public static final String DEFAULT_MY_URL = "https://localhost:8443/adapters/rest/SDNCNotify";
-
public static final String SDNC_AUTH_PROP = "org.onap.so.adapters.sdnc.sdncauth";
- public static final String DEFAULT_SDNC_AUTH = "406B2AE613211B6FB52466DE6E1769AC";
-
- public static final String DEFAULT_BPEL_AUTH = "05FDA034C27D1CA51AAB8FAE512EDE45241E16FC8C137D292AA3A964431C82DB";
- public static final String BPEL_AUTH_PROP = "org.onap.so.adapters.sdnc.bpelauth";
+ public static final String BPEL_AUTH_PROP = "org.onap.so.adapters.sdnc.bpelauth";
public static final String SDNC_SVCCFGRESP_ROOT = "input";
@@ -42,7 +37,7 @@ public interface Constants {
public static final String SDNC_RESP_CODE = "/response-code";
public static final String SDNC_RESP_MSG = "/response-message";
public static final String SDNC_CONNECTTIME_PROP = "org.onap.so.adapters.sdnc.sdncconnecttime";
- public static final String ENCRYPTION_KEY = "aa3871669d893c7fb8abbcda31b88b4f";
+ public static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey";
public static final String REQUEST_TUNABLES = "org.onap.so.adapters.sdnc";
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
index 71937245bc..fd924cad79 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
@@ -143,7 +143,7 @@ public class SDNCRestClient{
con.setConnectTimeout(Integer.parseInt(env.getProperty(Constants.SDNC_CONNECTTIME_PROP)));
con.setReadTimeout(Integer.parseInt(rt.getTimeout()));
con.setRequestProperty("Accept", "application/yang.data+xml"); //for response in xml
- String userCredentials = CryptoUtils.decryptProperty(env.getProperty(Constants.SDNC_AUTH_PROP), Constants.DEFAULT_SDNC_AUTH, Constants.ENCRYPTION_KEY);
+ String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.SDNC_AUTH_PROP), env.getProperty(Constants.ENCRYPTION_KEY_PROP));
String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
con.setRequestProperty ("Authorization", basicAuth);
@@ -308,7 +308,7 @@ public class SDNCRestClient{
{
Map<String, Object> reqCtx = bp.getRequestContext();
Map<String, List<String>> headers = new HashMap<>();
- String userCredentials = CryptoUtils.decryptProperty(env.getProperty(Constants.BPEL_AUTH_PROP), Constants.DEFAULT_BPEL_AUTH, Constants.ENCRYPTION_KEY);
+ String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.BPEL_AUTH_PROP), env.getProperty(Constants.ENCRYPTION_KEY_PROP));
String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
reqCtx.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
index d5ce96ea5a..9c4dd5e8a0 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
@@ -119,8 +119,8 @@ public class BPRestCallback {
boolean error = false;
try {
- String userCredentials = CryptoUtils.decryptProperty(env.getProperty(Constants.BPEL_AUTH_PROP),
- Constants.DEFAULT_BPEL_AUTH, Constants.ENCRYPTION_KEY);
+ String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.BPEL_AUTH_PROP),
+ env.getProperty(Constants.ENCRYPTION_KEY_PROP));
String authorization = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
method.setHeader("Authorization", authorization);
} catch (Exception e) {
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java
index 05e272f867..dcb1fdae8c 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java
@@ -64,12 +64,7 @@ public final class SDNCAdapterUtils {
* @param pathSegment the path segment to encode
* @return the encoded path segment
*/
- public static String encodeURLPathSegment(String pathSegment) {
- try {
+ public static String encodeURLPathSegment(String pathSegment) {
return UriUtils.encodePathSegment(pathSegment, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- LOGGER.debug("Exception:", e);
- throw new RuntimeException("UTF-8 encoding is not supported");
- }
}
} \ No newline at end of file
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java
index 6e4fbd830e..1c5025a59d 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java
@@ -114,8 +114,8 @@ public abstract class SDNCConnector {
}
- String userCredentials = CryptoUtils.decryptProperty(env.getProperty(Constants.SDNC_AUTH_PROP),
- Constants.DEFAULT_SDNC_AUTH, Constants.ENCRYPTION_KEY);
+ String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.SDNC_AUTH_PROP),
+ env.getProperty(Constants.ENCRYPTION_KEY_PROP));
String authorization = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
if(null != method) {
method.setHeader("Authorization", authorization);
diff --git a/adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml b/adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml
index 44f295e425..4141548c29 100644
--- a/adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml
+++ b/adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml
@@ -17,7 +17,7 @@ org:
onap:
so:
adapters:
- sdnc:
+ sdnc:
'.':
put: PUT|60000|sdncurl5|
query: GET|60000|sdncurl2|
@@ -57,7 +57,7 @@ org:
changedelete: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
delete: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
rollback: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- bpelauth: 9997930a04f74e8dfd3acedf6be6f8c2ec4fb3720521304f64a468ba54ef1e14
+ bpelauth: BBD450258299BD2FEF7E3EBA3CD2B58AD417355332319856D761654AA876830A9839820D33DE8426A81E5D48649A4BE6FE7021F5
bpelurl: http://localhost:8080/mso/SDNCAdapterCallbackService
generic-resource:
network-topology-operation:
@@ -92,7 +92,7 @@ org:
myurl: http://localhost:8080/adapters/rest/SDNCNotify
rest:
bpelurl: http://localhost:8080/mso/WorkflowMessage
- sdncauth: 406B2AE613211B6FB52466DE6E1769AC
+ sdncauth: 1C2DC9B30545C5F673B3C33904608E942476F0C969B3CF7A2509459AB83C9062EFAAE89E91D6DB
sdncconnecttime: 5000
sdncurl10: 'https://localhost:8443/restconf/operations/GENERIC-RESOURCE-API:'
sdncurl12: https://localhost:8443/
@@ -101,6 +101,8 @@ org:
vfmodule:
'':
query: GET|60000|sdncurl12|
+ network:
+ encryptionKey: aa3871669d893c7fb8abbcda31b88b4f
spring:
security:
usercredentials:
diff --git a/adapters/mso-sdnc-adapter/src/main/resources/application.yaml b/adapters/mso-sdnc-adapter/src/main/resources/application.yaml
index 185bc5cbd1..6009eff016 100644
--- a/adapters/mso-sdnc-adapter/src/main/resources/application.yaml
+++ b/adapters/mso-sdnc-adapter/src/main/resources/application.yaml
@@ -12,11 +12,23 @@ mso:
queue-capacity: 500
#Actuator
-management:
- context-path: /manage
+management:
+ endpoints:
+ web:
+ base-path: /manage
+ server:
+ servlet:
+ context-path: /manage
metrics:
se-global-registry: false
export:
prometheus:
enabled: true # Whether exporting of metrics to Prometheus is enabled.
- step: 1m # Step size (i.e. reporting frequency) to use. \ No newline at end of file
+ step: 1m # Step size (i.e. reporting frequency) to use.
+
+org:
+ onap:
+ so:
+ adapters:
+ network:
+ encryptionKey: aa3871669d893c7fb8abbcda31b88b4f
diff --git a/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallbackTest.java b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallbackTest.java
new file mode 100644
index 0000000000..849374838a
--- /dev/null
+++ b/adapters/mso-sdnc-adapter/src/test/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallbackTest.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.sdncrest;
+
+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.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class BPRestCallbackTest extends BaseTest {
+
+ @Autowired
+ private BPRestCallback bpRestCallback;
+
+ @Test
+ public void sendTest(){
+ 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 \"&lt;/input&gt;\".</error-message>\n" +
+ "\t\t// </error>\n" +
+ "\t\t// </errors>";
+
+ stubFor(post(urlPathEqualTo("/sdnc"))
+ .willReturn(aResponse().withHeader("Content-Type", "application/xml").withBody(response).withStatus(HttpStatus.SC_MULTIPLE_CHOICES)));
+
+ boolean responseCommon = bpRestCallback.send("http://localhost:" + wireMockPort + "/sdnc", "Test");
+ assertNotNull(responseCommon);
+ assertEquals(true,responseCommon);
+ }
+}
diff --git a/adapters/mso-sdnc-adapter/src/test/resources/application-test.properties b/adapters/mso-sdnc-adapter/src/test/resources/application-test.properties
index 1ae9269ffa..e4f6903e23 100644
--- a/adapters/mso-sdnc-adapter/src/test/resources/application-test.properties
+++ b/adapters/mso-sdnc-adapter/src/test/resources/application-test.properties
@@ -17,8 +17,8 @@ org.onap.so.adapters.sdnc.rest.bpelurl=http://localhost:${wiremock.server.port}/
###
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.sdncauth=3233884EE2EA1365FB368B9B66C4C4A3C3249DA157ABF3870287EE375418B135
+org.onap.so.adapters.sdnc.bpelauth=2784520F82031D042BDD7E25A49CDB372E6A43A349C5FA26FBCB1AC1EF329C9AC055993E1CB29CDC370FD395A4696D86
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
diff --git a/adapters/mso-vfc-adapter/pom.xml b/adapters/mso-vfc-adapter/pom.xml
index 4d1c612018..5408bf9112 100644
--- a/adapters/mso-vfc-adapter/pom.xml
+++ b/adapters/mso-vfc-adapter/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.onap.so</groupId>
<artifactId>adapters</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.so.adapters</groupId>
<artifactId>mso-vfc-adapter</artifactId>
@@ -64,10 +64,6 @@
</exclusions>
</dependency>
<dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-dbcp2</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-spring-boot-starter-jaxws</artifactId>
<version>${cxf.version}</version>
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/CXFConfiguration.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/CXFConfiguration.java
index 031bc2edc5..656a246afc 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/CXFConfiguration.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/CXFConfiguration.java
@@ -21,22 +21,20 @@
package org.onap.so.adapters.vfc;
import java.util.Arrays;
-import javax.xml.ws.Endpoint;
import org.apache.cxf.Bus;
import org.apache.cxf.endpoint.Server;
import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
import org.apache.cxf.jaxrs.swagger.Swagger2Feature;
-import org.apache.cxf.jaxws.EndpointImpl;
import org.apache.cxf.transport.servlet.CXFServlet;
-import org.onap.so.adapters.vfc.rest.HealthCheckHandler;
import org.onap.so.adapters.vfc.rest.VfcAdapterRest;
import org.onap.so.logging.jaxrs.filter.JaxRsFilterLogging;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
@@ -49,9 +47,6 @@ public class CXFConfiguration {
@Autowired
private VfcAdapterRest vfcAdapterRest;
-
- @Autowired
- private HealthCheckHandler healthCheckHandler;
@Autowired
private JaxRsFilterLogging jaxRsFilterLogging;
@@ -68,7 +63,7 @@ public class CXFConfiguration {
public Server rsServer() {
JAXRSServerFactoryBean endpoint = new JAXRSServerFactoryBean();
endpoint.setBus(bus);
- endpoint.setServiceBeans(Arrays.<Object>asList(vfcAdapterRest, healthCheckHandler));
+ endpoint.setServiceBeans(Arrays.<Object>asList(vfcAdapterRest));
endpoint.setAddress("/");
endpoint.setFeatures(Arrays.asList(createSwaggerFeature(), new LoggingFeature()));
endpoint.setProviders(Arrays.asList(new JacksonJsonProvider(mapper),jaxRsFilterLogging));
@@ -79,11 +74,11 @@ public class CXFConfiguration {
public Swagger2Feature createSwaggerFeature() {
Swagger2Feature swagger2Feature = new Swagger2Feature();
swagger2Feature.setPrettyPrint(true);
- swagger2Feature.setTitle("SO Request Adapter");
+ swagger2Feature.setTitle("SO VFC Adapter");
swagger2Feature.setContact("The ONAP SO team");
swagger2Feature.setDescription("This project is the SO Orchestration Engine");
swagger2Feature.setVersion("1.0.0");
- swagger2Feature.setResourcePackage("org.onap.so.adapters.requestdb");
+ swagger2Feature.setResourcePackage("org.onap.so.adapters.vfc.rest");
swagger2Feature.setScan(true);
return swagger2Feature;
}
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/RequestDBConfig.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/RequestDBConfig.java
index 2ff66d2c25..8db210f62a 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/RequestDBConfig.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/RequestDBConfig.java
@@ -25,7 +25,7 @@ import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
+import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.context.annotation.Bean;
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/WebSecurityConfigImpl.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/WebSecurityConfigImpl.java
new file mode 100644
index 0000000000..37a5633d8d
--- /dev/null
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/WebSecurityConfigImpl.java
@@ -0,0 +1,51 @@
+/*-
+ * ============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.vfc;
+
+import org.onap.so.security.MSOSpringFirewall;
+import org.onap.so.security.WebSecurityConfig;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.builders.WebSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.web.firewall.StrictHttpFirewall;
+import org.springframework.util.StringUtils;
+
+@EnableWebSecurity
+public class WebSecurityConfigImpl extends WebSecurityConfig {
+
+ @Override
+ protected void configure(HttpSecurity http) throws Exception {
+ http.csrf().disable()
+ .authorizeRequests()
+ .antMatchers("/manage/health","/manage/info","/services").permitAll()
+ .antMatchers("/**").hasAnyRole(StringUtils.collectionToDelimitedString(getRoles(),",").toString())
+ .and()
+ .httpBasic();
+ }
+
+ @Override
+ public void configure(WebSecurity web) throws Exception {
+ super.configure(web);
+ StrictHttpFirewall firewall = new MSOSpringFirewall();
+ web.httpFirewall(firewall);
+ }
+
+} \ No newline at end of file
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcManager.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcManager.java
index 2dbc444bc3..86aba2f84b 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcManager.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/rest/VfcManager.java
@@ -351,7 +351,8 @@ public class VfcManager {
ValidateUtil.assertObjectNotNull(jobId);
// Step 1: query the current resource operation status
ResourceOperationStatus status = new ResourceOperationStatus(nsOperationKey.getServiceId(), nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID());
- status = resourceOperationStatusRepository.findOne(Example.of(status));
+ status = resourceOperationStatusRepository.findOne(Example.of(status))
+ .orElseThrow( () -> new ApplicationException(404,"Cannot Find Operation Status"));
// Step 2: start query
LOGGER.info("query ns status -> begin");
String url = getUrl(jobId, CommonConstant.Step.QUERY);
@@ -438,7 +439,8 @@ public class VfcManager {
RestfulResponse scaleRsp = restfulUtil.send(url, methodType, scaleReq);
ResourceOperationStatus status = new ResourceOperationStatus(segInput.getNsOperationKey().getServiceId(), segInput.getNsOperationKey().getOperationId(), segInput.getNsOperationKey().getNodeTemplateUUID());
- ResourceOperationStatus nsOperInfo = resourceOperationStatusRepository.findOne(Example.of(status));
+ ResourceOperationStatus nsOperInfo = resourceOperationStatusRepository.findOne(Example.of(status))
+ .orElseThrow( () -> new ApplicationException(404,"Cannot Find Operation Status"));
ValidateUtil.assertObjectNotNull(scaleRsp);
if(!HttpCode.isSucess(scaleRsp.getStatus())) {
LOGGER.error("update segment operation status : fail to scale ns");
diff --git a/adapters/mso-vfc-adapter/src/main/resources/application-local.yaml b/adapters/mso-vfc-adapter/src/main/resources/application-local.yaml
index 0519f50c46..414dabb0a1 100644
--- a/adapters/mso-vfc-adapter/src/main/resources/application-local.yaml
+++ b/adapters/mso-vfc-adapter/src/main/resources/application-local.yaml
@@ -8,7 +8,7 @@ mso:
site-name: localSite
spring:
datasource:
- url: jdbc:mariadb://localhost:3306/requestdb
+ jdbc-url: jdbc:mariadb://localhost:3306/requestdb
username: mso
password: mso123
driver-class-name: org.mariadb.jdbc.Driver
diff --git a/adapters/mso-vfc-adapter/src/main/resources/application.yaml b/adapters/mso-vfc-adapter/src/main/resources/application.yaml
index 2cee9cf7dc..8ce0dc96d8 100644
--- a/adapters/mso-vfc-adapter/src/main/resources/application.yaml
+++ b/adapters/mso-vfc-adapter/src/main/resources/application.yaml
@@ -10,15 +10,10 @@ mso:
spring:
datasource:
- url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb
+ jdbc-url: jdbc:mariadb://${DB_HOST}:${DB_PORT}/requestdb
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
driver-class-name: org.mariadb.jdbc.Driver
- dbcp2:
- initial-size: 5
- max-total: 20
- validation-query: select 1
- test-on-borrow: true
jpa:
show-sql: false
hibernate:
@@ -28,5 +23,16 @@ spring:
enable-lazy-load-no-trans: true
#Actuator
-management:
- context-path: /manage
+management:
+ endpoints:
+ web:
+ base-path: /manage
+ server:
+ servlet:
+ context-path: /manage
+ metrics:
+ se-global-registry: false
+ export:
+ prometheus:
+ enabled: true # Whether exporting of metrics to Prometheus is enabled.
+ step: 1m # Step size (i.e. reporting frequency) to use.
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/EmbeddedMariaDbConfig.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/EmbeddedMariaDbConfig.java
index e5324d348a..50bf3f97b0 100644
--- a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/EmbeddedMariaDbConfig.java
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/EmbeddedMariaDbConfig.java
@@ -25,7 +25,7 @@ import ch.vorburger.mariadb4j.springframework.MariaDB4jSpringService;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
+import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
import org.springframework.context.annotation.Bean;
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/HealthCheckHandlerTest.java b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/HealthCheckHandlerTest.java
index d53e467865..02922db007 100644
--- a/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/HealthCheckHandlerTest.java
+++ b/adapters/mso-vfc-adapter/src/test/java/org/onap/so/adapters/vfc/rest/HealthCheckHandlerTest.java
@@ -30,7 +30,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.onap.so.adapters.vfc.MSOVfcApplication;
import org.springframework.boot.configurationprocessor.json.JSONException;
-import org.springframework.boot.context.embedded.LocalServerPort;
+import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.HttpEntity;
diff --git a/adapters/mso-vfc-adapter/src/test/resources/application-test.yaml b/adapters/mso-vfc-adapter/src/test/resources/application-test.yaml
index d558d247d7..b43d382410 100644
--- a/adapters/mso-vfc-adapter/src/test/resources/application-test.yaml
+++ b/adapters/mso-vfc-adapter/src/test/resources/application-test.yaml
@@ -16,7 +16,7 @@ mso:
period: 1
spring:
datasource:
- url: jdbc:mariadb://localhost:3307/requestdb
+ jdbc-url: jdbc:mariadb://localhost:3307/requestdb
username: root
password: password
driver-class-name: org.mariadb.jdbc.Driver
@@ -43,10 +43,19 @@ mariaDB4j:
#Actuator
management:
- security:
- enabled: false
- basic:
- enabled: false
+ endpoints:
+ web:
+ base-path: /manage
+ server:
+ servlet:
+ context-path: /manage
+ metrics:
+ se-global-registry: false
+ export:
+ prometheus:
+ enabled: true # Whether exporting of metrics to Prometheus is enabled.
+ step: 1m # Step size (i.e. reporting frequency) to use.
+
flyway:
baseline-on-migrate: false
diff --git a/adapters/pom.xml b/adapters/pom.xml
index cb14a48d37..634a1616e6 100644
--- a/adapters/pom.xml
+++ b/adapters/pom.xml
@@ -4,7 +4,7 @@
<parent>
<groupId>org.onap.so</groupId>
<artifactId>so</artifactId>
- <version>1.3.0-SNAPSHOT</version>
+ <version>1.4.0-SNAPSHOT</version>
</parent>
<artifactId>adapters</artifactId>
@@ -37,4 +37,4 @@
<version>1.2.4.RELEASE</version>
</dependency>
</dependencies>
-</project> \ No newline at end of file
+</project>