summaryrefslogtreecommitdiffstats
path: root/adapters/mso-openstack-adapters
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-openstack-adapters')
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java75
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java (renamed from adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java)41
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java87
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java32
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java10
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java6
-rw-r--r--adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java5
-rw-r--r--adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java14
8 files changed, 213 insertions, 57 deletions
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java
new file mode 100644
index 0000000000..710a6ddc13
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AbstractAuditService.java
@@ -0,0 +1,75 @@
+package org.onap.so.adapters.audit;
+
+import java.util.Optional;
+
+import org.camunda.bpm.client.task.ExternalTask;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+public abstract class AbstractAuditService {
+
+ private static final Logger logger = LoggerFactory.getLogger(AbstractAuditService.class);
+
+
+
+ protected static final String UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI = "Unable to find all VServers and L-Interaces in A&AI";
+
+ @Autowired
+ public Environment env;
+
+ /**
+ * @param auditHeatStackFailed
+ * @param auditList
+ * @return
+ */
+ protected boolean didCreateAuditFail(Optional<AAIObjectAuditList> auditList) {
+ if (auditList.get().getAuditList() != null && !auditList.get().getAuditList().isEmpty()) {
+ if (logger.isInfoEnabled()) {
+ logger.info("Audit Results: {}", auditList.get().toString());
+ }
+ return auditList.get().getAuditList().stream().filter(auditObject -> !auditObject.isDoesObjectExist())
+ .findFirst().map(v -> true).orElse(false);
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * @param auditHeatStackFailed
+ * @param auditList
+ * @return
+ */
+ protected boolean didDeleteAuditFail(Optional<AAIObjectAuditList> auditList) {
+ if (auditList.get().getAuditList() != null && !auditList.get().getAuditList().isEmpty()) {
+ if (logger.isInfoEnabled()) {
+ logger.info("Audit Results: {}", auditList.get().toString());
+ }
+ return auditList.get().getAuditList().stream().filter(AAIObjectAudit::isDoesObjectExist)
+ .findFirst().map(v -> true).orElse(false);
+ } else {
+ return false;
+ }
+ }
+
+ protected String[] getRetrySequence() {
+ return env.getProperty("mso.workflow.topics.retrySequence",String[].class);
+ }
+
+ protected void setupMDC(ExternalTask externalTask) {
+ String msoRequestId = externalTask.getVariable("mso-request-id");
+ if(msoRequestId != null && !msoRequestId.isEmpty())
+ MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId);
+ }
+
+ protected long calculateRetryDelay(int currentRetries){
+ int retrySequence = getRetrySequence().length - currentRetries;
+ long retryMultiplier = Long.parseLong(env.getProperty("mso.workflow.topics.retryMultiplier","6000"));
+ return Integer.parseInt(getRetrySequence()[retrySequence]) * retryMultiplier;
+ }
+}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
index da6bea7dec..5dfba25141 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackServiceData.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditCreateStackService.java
@@ -40,11 +40,9 @@ import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
@Component
-public class AuditStackServiceData {
-
- private static final String UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI = "Unable to find all VServers and L-Interaces in A&AI";
-
- private static final Logger logger = LoggerFactory.getLogger(AuditStackServiceData.class);
+public class AuditCreateStackService extends AbstractAuditService{
+
+ private static final Logger logger = LoggerFactory.getLogger(AuditCreateStackService.class);
@Autowired
public HeatStackAudit heatStackAudit;
@@ -64,7 +62,7 @@ public class AuditStackServiceData {
if (auditListOpt.isPresent()) {
GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
variables.put("auditInventoryResult", objectMapper.getMapper().writeValueAsString(auditListOpt.get()));
- success = !didAuditFail(auditListOpt);
+ success = !didCreateAuditFail(auditListOpt);
}
} catch (Exception e) {
logger.error("Error during audit of stack", e);
@@ -88,35 +86,8 @@ public class AuditStackServiceData {
logger.debug("The External Task Id: {} Failed", externalTask.getId());
}
}
- private void setupMDC(ExternalTask externalTask) {
- String msoRequestId = externalTask.getVariable("mso-request-id");
- if(msoRequestId != null && !msoRequestId.isEmpty())
- MDC.put(ONAPLogConstants.MDCs.REQUEST_ID, msoRequestId);
- }
- protected long calculateRetryDelay(int currentRetries){
- int retrySequence = getRetrySequence().length - currentRetries;
- long retryMultiplier = Long.parseLong(env.getProperty("mso.workflow.topics.retryMultiplier","6000"));
- return Integer.parseInt(getRetrySequence()[retrySequence]) * retryMultiplier;
- }
+
- /**
- * @param auditHeatStackFailed
- * @param auditList
- * @return
- */
- protected boolean didAuditFail(Optional<AAIObjectAuditList> auditList) {
- if (auditList.get().getAuditList() != null && !auditList.get().getAuditList().isEmpty()) {
- if (logger.isInfoEnabled()) {
- logger.info("Audit Results: {}", auditList.get().toString());
- }
- return auditList.get().getAuditList().stream().filter(auditObject -> !auditObject.isDoesObjectExist())
- .findFirst().map(v -> true).orElse(false);
- } else {
- return false;
- }
- }
- public String[] getRetrySequence() {
- return env.getProperty("mso.workflow.topics.retrySequence",String[].class);
- }
+
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
new file mode 100644
index 0000000000..2c2b2f810d
--- /dev/null
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditDeleteStackService.java
@@ -0,0 +1,87 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017-2019 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.audit;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import org.camunda.bpm.client.task.ExternalTask;
+import org.camunda.bpm.client.task.ExternalTaskService;
+import org.onap.logging.ref.slf4j.ONAPLogConstants;
+import org.onap.so.audit.beans.AuditInventory;
+import org.onap.so.client.graphinventory.GraphInventoryCommonObjectMapperProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.env.Environment;
+import org.springframework.stereotype.Component;
+
+@Component
+public class AuditDeleteStackService extends AbstractAuditService{
+
+ private static final Logger logger = LoggerFactory.getLogger(AuditDeleteStackService.class);
+
+ @Autowired
+ public HeatStackAudit heatStackAudit;
+
+ @Autowired
+ public Environment env;
+
+ protected void executeExternalTask(ExternalTask externalTask, ExternalTaskService externalTaskService){
+ AuditInventory auditInventory = externalTask.getVariable("auditInventory");
+ Map<String, Object> variables = new HashMap<>();
+ setupMDC(externalTask);
+ boolean success = false;
+ try {
+ logger.info("Executing External Task Audit Inventory, Retry Number: {} \n {}", auditInventory,externalTask.getRetries());
+ Optional<AAIObjectAuditList> auditListOpt=heatStackAudit.auditHeatStack(auditInventory.getCloudRegion(), auditInventory.getCloudOwner(),
+ auditInventory.getTenantId(), auditInventory.getHeatStackName());
+ if (auditListOpt.isPresent()) {
+ GraphInventoryCommonObjectMapperProvider objectMapper = new GraphInventoryCommonObjectMapperProvider();
+ variables.put("auditInventoryResult", objectMapper.getMapper().writeValueAsString(auditListOpt.get()));
+ success = didDeleteAuditFail(auditListOpt);
+ }
+ } catch (Exception e) {
+ logger.error("Error during audit of stack", e);
+ }
+ variables.put("auditIsSuccessful", success);
+ if (success) {
+ externalTaskService.complete(externalTask, variables);
+ logger.debug("The External Task Id: {} Successful", externalTask.getId());
+ } else {
+ if(externalTask.getRetries() == null){
+ logger.debug("The External Task Id: {} Failed, Setting Retries to Default Start Value: {}", externalTask.getId(),getRetrySequence().length);
+ externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, getRetrySequence().length, 10000);
+ }else if(externalTask.getRetries() != null &&
+ externalTask.getRetries()-1 == 0){
+ logger.debug("The External Task Id: {} Failed, All Retries Exhausted", externalTask.getId());
+ externalTaskService.complete(externalTask);
+ }else{
+ logger.debug("The External Task Id: {} Failed, Decrementing Retries: {} , Retry Delay: ", externalTask.getId(),externalTask.getRetries()-1, calculateRetryDelay(externalTask.getRetries()));
+ externalTaskService.handleFailure(externalTask, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, UNABLE_TO_FIND_ALL_V_SERVERS_AND_L_INTERACES_IN_A_AI, externalTask.getRetries()-1, calculateRetryDelay(externalTask.getRetries()));
+ }
+ logger.debug("The External Task Id: {} Failed", externalTask.getId());
+ }
+ }
+
+} \ No newline at end of file
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
index 499c1137c7..1e16c2a016 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/AuditStackService.java
@@ -46,10 +46,13 @@ public class AuditStackService {
public Environment env;
@Autowired
- private AuditStackServiceData auditStack;
+ private AuditCreateStackService auditCreateStack;
+
+ @Autowired
+ private AuditDeleteStackService auditDeleteStack;
@PostConstruct
- public void auditAAIInventory() {
+ public void auditAddAAIInventory() {
String auth = "";
try {
auth = CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey"));
@@ -60,9 +63,26 @@ public class AuditStackService {
auth);
ExternalTaskClient client = ExternalTaskClient.create()
.baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1).addInterceptor(interceptor)
- .asyncResponseTimeout(120000).backoffStrategy(new ExponentialBackoffStrategy(10000, 2, 120000)).build();
- client.subscribe("InventoryAudit").lockDuration(60000)
- .handler(auditStack::executeExternalTask).open();
+ .asyncResponseTimeout(120000).build();
+ client.subscribe("InventoryAddAudit").lockDuration(60000)
+ .handler(auditCreateStack::executeExternalTask).open();
}
-
+
+ @PostConstruct
+ public void auditDeleteAAIInventory() {
+ String auth = "";
+ try {
+ auth = CryptoUtils.decrypt(env.getRequiredProperty("mso.auth"), env.getRequiredProperty("mso.msoKey"));
+ } catch (IllegalStateException | GeneralSecurityException e) {
+ logger.error("Error Decrypting Password", e);
+ }
+ ClientRequestInterceptor interceptor = new BasicAuthProvider(env.getRequiredProperty("mso.config.cadi.aafId"),
+ auth);
+ ExternalTaskClient client = ExternalTaskClient.create()
+ .baseUrl(env.getRequiredProperty("mso.workflow.endpoint")).maxTasks(1).addInterceptor(interceptor)
+ .asyncResponseTimeout(120000).build();
+ client.subscribe("InventoryDeleteAudit").lockDuration(60000)
+ .handler(auditDeleteStack::executeExternalTask).open();
+ }
+
}
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java
index aafcb1c600..349aa78d44 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapter.java
@@ -28,6 +28,7 @@ import javax.jws.WebParam;
import javax.jws.WebParam.Mode;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.ws.Holder;
import org.onap.so.adapters.vnf.exceptions.VnfAlreadyExists;
@@ -35,6 +36,7 @@ import org.onap.so.adapters.vnf.exceptions.VnfException;
import org.onap.so.entity.MsoRequest;
import org.onap.so.openstack.beans.VnfRollback;
import org.onap.so.openstack.beans.VnfStatus;
+import org.onap.so.openstack.mappers.MapAdapter;
@WebService (name="VnfAdapter", targetNamespace="http://org.onap.so/vnf")
public interface MsoVnfAdapter
@@ -51,7 +53,7 @@ public interface MsoVnfAdapter
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="requestType") @XmlElement(required=false) String requestType,
@WebParam(name="volumeGroupHeatStackId") @XmlElement(required=false) String volumeGroupHeatStackId,
- @WebParam(name="inputs") Map<String,Object> inputs,
+ @WebParam(name="inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String,Object> inputs,
@WebParam(name="failIfExists") Boolean failIfExists,
@WebParam(name="backout") Boolean backout,
@WebParam(name="enableBridge") Boolean enableBridge,
@@ -70,7 +72,7 @@ public interface MsoVnfAdapter
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="requestType") @XmlElement(required=false) String requestType,
@WebParam(name="volumeGroupHeatStackId") @XmlElement(required=false) String volumeGroupHeatStackId,
- @WebParam(name="inputs") Map<String,Object> inputs,
+ @WebParam(name="inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String,Object> inputs,
@WebParam(name="request") MsoRequest msoRequest,
@WebParam(name="outputs", mode=Mode.OUT) Holder<Map<String,String>> outputs,
@WebParam(name="rollback", mode=Mode.OUT) Holder<VnfRollback> rollback )
@@ -114,7 +116,7 @@ public interface MsoVnfAdapter
@WebParam(name="volumeGroupHeatStackId") @XmlElement(required=false) String volumeGroupHeatStackId,
@WebParam(name="baseVfHeatStackId") @XmlElement(required=false) String baseVfHeatStackId,
@WebParam(name = "modelCustomizationUuid") @XmlElement(required = false) String modelCustomizationUuid,
- @WebParam(name="inputs") Map<String,Object> inputs,
+ @WebParam(name="inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String,Object> inputs,
@WebParam(name="failIfExists") Boolean failIfExists,
@WebParam(name="backout") Boolean backout,
@WebParam(name="enableBridge") Boolean enableBridge,
@@ -145,7 +147,7 @@ public interface MsoVnfAdapter
@WebParam(name="baseVfHeatStackId") @XmlElement(required=false) String baseVfHeatStackId,
@WebParam(name="vfModuleStackId") @XmlElement(required=false) String vfModuleStackId,
@WebParam(name = "modelCustomizationUuid") @XmlElement(required = false) String modelCustomizationUuid,
- @WebParam(name="inputs") Map<String,Object> inputs,
+ @WebParam(name="inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String,Object> inputs,
@WebParam(name="request") MsoRequest msoRequest,
@WebParam(name="outputs", mode=Mode.OUT) Holder<Map<String,String>> outputs,
@WebParam(name="rollback", mode=Mode.OUT) Holder<VnfRollback> rollback )
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java
index 70afb1c69c..5642e01a72 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/vnf/MsoVnfAdapterAsync.java
@@ -28,9 +28,11 @@ import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.onap.so.entity.MsoRequest;
import org.onap.so.openstack.beans.VnfRollback;
+import org.onap.so.openstack.mappers.MapAdapter;
/**
* This webservice defines the Asynchronous versions of VNF adapter calls.
@@ -54,7 +56,7 @@ public interface MsoVnfAdapterAsync
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="requestType") @XmlElement(required=false) String requestType,
@WebParam(name="volumeGroupHeatStackId") @XmlElement(required=false) String volumeGroupHeatStackId,
- @WebParam(name="inputs") Map<String,Object> inputs,
+ @WebParam(name="inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String,Object> inputs,
@WebParam(name="failIfExists") Boolean failIfExists,
@WebParam(name="backout") Boolean backout,
@WebParam(name="enableBridge") Boolean enableBridge,
@@ -72,7 +74,7 @@ public interface MsoVnfAdapterAsync
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="requestType") @XmlElement(required=false) String requestType,
@WebParam(name="volumeGroupHeatStackId") @XmlElement(required=false) String volumeGroupHeatStackId,
- @WebParam(name="inputs") Map<String,Object> inputs,
+ @WebParam(name="inputs") @XmlJavaTypeAdapter(MapAdapter.class) Map<String,Object> inputs,
@WebParam(name="messageId") @XmlElement(required=true) String messageId,
@WebParam(name="request") MsoRequest msoRequest,
@WebParam(name="notificationUrl") @XmlElement(required=true) String notificationUrl );
diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java
index 72b3795053..141dd4fe50 100644
--- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java
+++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/heatbridge/openstack/factory/OpenstackClientFactoryImpl.java
@@ -25,6 +25,7 @@ import org.openstack4j.api.OSClient.OSClientV2;
import org.openstack4j.api.OSClient.OSClientV3;
import org.openstack4j.api.exceptions.AuthenticationException;
import org.openstack4j.openstack.OSFactory;
+import org.openstack4j.model.common.Identifier;
public class OpenstackClientFactoryImpl implements OpenstackClientFactory {
@@ -35,12 +36,14 @@ public class OpenstackClientFactoryImpl implements OpenstackClientFactory {
Preconditions.checkNotNull(osAccess.getPassword(), "Keystone-v3 Auth: password not set.");
Preconditions.checkNotNull(osAccess.getDomainNameIdentifier(), "Keystone-v3 Auth: domain not set.");
Preconditions.checkNotNull(osAccess.getRegion(), "Keystone-v3 Auth: region not set.");
+ Preconditions.checkNotNull(osAccess.getTenantId(), "Keystone-v3 Auth: tenant-id not set.");
OSClientV3 client;
try {
client = OSFactory.builderV3()
.endpoint(osAccess.getUrl())
.credentials(osAccess.getUser(), osAccess.getPassword(), osAccess.getDomainNameIdentifier())
+ .scopeToProject(Identifier.byId(osAccess.getTenantId()))
.authenticate()
.useRegion(osAccess.getRegion());
return new OpenstackV3ClientImpl(client);
@@ -54,7 +57,7 @@ public class OpenstackClientFactoryImpl implements OpenstackClientFactory {
Preconditions.checkNotNull(osAccess.getUrl(), "Keystone-v2 Auth: endpoint not set.");
Preconditions.checkNotNull(osAccess.getUser(), "Keystone-v2 Auth: username not set.");
Preconditions.checkNotNull(osAccess.getPassword(), "Keystone-v2 Auth: password not set.");
- Preconditions.checkNotNull(osAccess.getTenantId(), "Keystone-v2 Auth: domain not set.");
+ Preconditions.checkNotNull(osAccess.getTenantId(), "Keystone-v2 Auth: tenant-id not set.");
Preconditions.checkNotNull(osAccess.getRegion(), "Keystone-v2 Auth: region not set.");
OSClientV2 client;
diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
index 29e672a4a6..1eaac18fb6 100644
--- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
+++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditStackServiceDataTest.java
@@ -20,21 +20,17 @@
package org.onap.so.adapters.audit;
-import static org.hamcrest.CoreMatchers.isA;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.doReturn;
import java.io.File;
import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
import java.util.Map;
import java.util.Optional;
import org.camunda.bpm.client.task.ExternalTask;
import org.camunda.bpm.client.task.ExternalTaskService;
-import org.hamcrest.Matchers;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
@@ -42,17 +38,17 @@ import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.onap.aai.domain.yang.LInterface;
import org.onap.so.audit.beans.AuditInventory;
import org.springframework.core.env.Environment;
+
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
-public class AuditStackServiceDataTest extends AuditStackServiceData {
+public class AuditStackServiceDataTest extends AuditCreateStackService {
@InjectMocks
- private AuditStackServiceData auditStackService = new AuditStackServiceData();
+ private AuditCreateStackService auditStackService = new AuditCreateStackService();
@Mock
private HeatStackAudit heatStackAuditMock;
@@ -191,13 +187,13 @@ public class AuditStackServiceDataTest extends AuditStackServiceData {
@Test
public void determineAuditResult_Test() throws Exception{
- boolean actual = auditStackService.didAuditFail(auditListOptSuccess);
+ boolean actual = auditStackService.didCreateAuditFail(auditListOptSuccess);
assertEquals(false, actual);
}
@Test
public void determineAuditResult_Failure_Test() throws Exception{
- boolean actual = auditStackService.didAuditFail(auditListOptFailure);
+ boolean actual = auditStackService.didCreateAuditFail(auditListOptFailure);
assertEquals(true, actual);
}
}