diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-10-12 14:03:02 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-10-16 17:28:55 -0400 |
commit | 2ff435b28384a066017b690cf8a876a2cdd52d29 (patch) | |
tree | 0b87091067f3a23d8a75738d933bcb61cb8f8d6a /common/src | |
parent | d6c21ac6f38474841d3b9ced0524fe7671ae8682 (diff) |
Bug fixes for casablanca
Updated builder to use String.format
Added exception specifically for issues interacting with
requestdbadapter
Updated exception message and added junit test case
Added case to handle when homing is not called during assign vnf.
include network ID for completion handler
Added exception handling for saving to requestdb
added null check to mdc and interceptors to sdnc cxf
confirm subnet map is not null in adapter response
shallow copy subnet before AAI udpate
update AAIObjectType to use uriTemplate
extract subnet data from adapter response
update correct AAIObjectType for subnet query
update subnet(s) in AAI on network create completion
updated how request db is set to failure in workflowA
updated in and out mapping to be generalBuildingBlock
change source out mapping to generalBuildingBlock
Use explicit conversion to JSON to read cloudConfiguration settings.
Use explicit conversion to JSON to read cloudConfiguration settings.
Correct the name of DeleteVfModuleBB subprocess.
Write the returned value from Homing to gBBInput
updated unit test coverage for update network
sync subnet status with network update
Added WorkflowException to out mapping which will trigger an exception
to be thrown when populated.
Correct the payload for HealthCheck APP-C Action to remove escaping and
change parameter name.
Added WorkflowException to out mapping which will trigger an exception
to be thrown when populated.
Commit a change that was not staged in previous commit
updated arguments to getConstructor method
forgot to extract throwable from Optional object
added throwable constructor to createException
fixed broken unit test and added a new test and method
set the network technology in the network request
remove namespace from added networkId payload element
- Updated SDWan test case to check the database to make sure the
VNFCustomization object exist.
- Updated code to only loop in iNotif.getResources() for VF resources,
all others are unnecessary and were causing issues with the Service
object.
- Removed modifiedHeatTemplate variable since this isn't needed in the
ONAP code base.
Make sure vnfResponseCode variable is set to 200 when VNF is correctly
retrieved from A&AI.
VRR VRRCreateVfModule - send availability_zone to SDNC Infra Assign
request
Safeguard the retrieval of Boolean setting for isRollbackEnabled.
Set isRollbackEnabled to opposite of suppressRollback early on in the
execution.
Reverse suppressRollback value to pass as backout parameter to VNF
Adapter
Add the exceptions to the calls to aai client queries
Correct retrieval of the object from Optional for A&AI queries.
Change-Id: I7d22e621b0316c14ce61bd51a9d5753473622697
Issue-ID: SO-1134
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'common/src')
3 files changed, 32 insertions, 6 deletions
diff --git a/common/src/main/java/org/onap/so/client/aai/AAIResourcesClient.java b/common/src/main/java/org/onap/so/client/aai/AAIResourcesClient.java index 7e4397ec29..e91dc43af9 100644 --- a/common/src/main/java/org/onap/so/client/aai/AAIResourcesClient.java +++ b/common/src/main/java/org/onap/so/client/aai/AAIResourcesClient.java @@ -245,18 +245,22 @@ public class AAIResourcesClient extends AAIClient { String json; try { json = this.createClient(uri).get(String.class) - .orElseThrow(() -> createException(c, uri.build() + " not found in A&AI")); + .orElseThrow(() -> createException(c, uri.build() + " not found in A&AI", Optional.empty())); } catch (NotFoundException e) { - throw createException(c, "could not construct uri for use with A&AI"); + throw createException(c, "could not construct uri for use with A&AI", Optional.of(e)); } return new AAIResultWrapper(json); } - private RuntimeException createException(Class<? extends RuntimeException> c, String message) { + private RuntimeException createException(Class<? extends RuntimeException> c, String message, Optional<Throwable> t) { RuntimeException e; try { - e = c.getConstructor(String.class).newInstance(message); + if (t.isPresent()) { + e = c.getConstructor(String.class, Throwable.class).newInstance(message, t.get()); + } else { + e = c.getConstructor(String.class).newInstance(message); + } } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e1) { throw new IllegalArgumentException("could not create instance for " + c.getName()); diff --git a/common/src/main/java/org/onap/so/constants/Defaults.java b/common/src/main/java/org/onap/so/constants/Defaults.java index abbd522b4e..06c6fae467 100644 --- a/common/src/main/java/org/onap/so/constants/Defaults.java +++ b/common/src/main/java/org/onap/so/constants/Defaults.java @@ -1,3 +1,23 @@ +/*- + * ============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.constants; public enum Defaults { diff --git a/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCTaskDecorator.java b/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCTaskDecorator.java index cc2ccb5c2e..9624dcd578 100644 --- a/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCTaskDecorator.java +++ b/common/src/main/java/org/onap/so/logging/jaxrs/filter/MDCTaskDecorator.java @@ -32,8 +32,10 @@ public class MDCTaskDecorator implements TaskDecorator { Map<String, String> contextMap = MDC.getCopyOfContextMap(); return () -> { try { - MDC.setContextMap(contextMap); - runnable.run(); + if(contextMap!=null){ + MDC.setContextMap(contextMap); + runnable.run(); + } } finally { MDC.clear(); } |