diff options
Diffstat (limited to 'adapters')
7 files changed, 25 insertions, 10 deletions
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 a69e66cc69..d77fb097ae 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 @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Copyright (C) 2018 IBM. + * ================================================================================ * 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 @@ -99,8 +101,6 @@ import org.onap.so.db.catalog.data.repository.VnfCustomizationRepository; import org.onap.so.db.catalog.data.repository.VnfRecipeRepository; import org.onap.so.db.catalog.data.repository.VnfResourceRepository; import org.onap.so.db.catalog.rest.beans.ServiceMacroHolder; -import org.onap.so.logger.MessageEnum; -import org.onap.so.logger.MsoLogger; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; 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 d638e47e8c..fbafdd052e 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 @@ -78,8 +78,8 @@ public class R__CloudConfigMigration implements JdbcMigration , MigrationInfoPro this.cloudConfig = cloudConfig; } - private CloudConfig loadCloudConfig(InputStream stream) throws JsonParseException, JsonMappingException, IOException { - ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + private CloudConfig loadCloudConfig(InputStream stream) throws JsonMappingException, IOException { + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); R__CloudConfigMigration cloudConfigMigration = mapper.readValue(stream, R__CloudConfigMigration.class); CloudConfig cloudConfig = cloudConfigMigration.getCloudConfig(); 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 83db2add0a..500b0b32e3 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 @@ -66,7 +66,10 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { 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 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; @@ -160,7 +163,7 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { subnetIdMap, networkRollback); } catch (NetworkException e) { - LOGGER.debug ("Got a NetworkException on createNetwork: ", e); + LOGGER.debug (NETWORK_EXCEPTION_MSG, e); MsoExceptionCategory exCat = null; String eMsg = null; try { @@ -174,9 +177,9 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { NetworkAdapterNotify notifyPort = getNotifyEP (notificationUrl); notifyPort.createNetworkNotification (messageId, false, exCat, eMsg, null, null, null, null); } catch (Exception e1) { - error = "Error sending createNetwork notification " + e1.getMessage (); - LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception sending createNetwork notification", e1); - alarmLogger.sendAlarm ("MsoInternalError", MsoAlarmLogger.CRITICAL, error); + error = CREATE_NETWORK_ERROR_MSG + e1.getMessage (); + LOGGER.error (MessageEnum.RA_CREATE_NETWORK_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError,CREATE_NETWORK_EXCEPTON_MSG, e1); + alarmLogger.sendAlarm (MSO_INTERNAL_ERROR_MSG, MsoAlarmLogger.CRITICAL, error); } return; } 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 2b4e7808b5..102b52985c 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 @@ -6,6 +6,10 @@ server: max-threads: 50 ssl-enable: false mso: + adapters: + requestDb: + auth: Basic YnBlbDptc28tZGItMTUwNyE= + endpoint: http://localhost:8081 logPath: logs site-name: localSite spring: 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 6a5db78f8b..49582ec513 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 @@ -6,6 +6,10 @@ server: max-threads: 50 ssl-enable: false mso: + adapters: + requestDb: + auth: Basic YnBlbDptc28tZGItMTUwNyE= + endpoint: http://localhost:8081 logPath: logs site-name: localSite infra-requests: 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 10fa02a1d1..d53e467865 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 @@ -26,10 +26,10 @@ import static org.junit.Assert.*; import javax.ws.rs.core.Response; -import org.json.JSONException; 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.test.context.SpringBootTest; import org.springframework.boot.test.web.client.TestRestTemplate; 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 64de62c2d6..d558d247d7 100644 --- a/adapters/mso-vfc-adapter/src/test/resources/application-test.yaml +++ b/adapters/mso-vfc-adapter/src/test/resources/application-test.yaml @@ -5,6 +5,10 @@ server: max-threads: 50 ssl-enable: false mso: + adapters: + requestDb: + auth: Basic YnBlbDptc28tZGItMTUwNyE= + endpoint: http://localhost:8081 logPath: logs site-name: localSite infra-requests: |