aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/job/command/ServiceInstantiationCommand.java
diff options
context:
space:
mode:
authorWojciech Sliwka <wojciech.sliwka@nokia.com>2018-09-20 12:03:10 +0200
committerWojciech Sliwka <wojciech.sliwka@nokia.com>2018-10-22 08:42:07 +0200
commit2ddfc4e81cc399c8ffe5451e19308503a5b08a94 (patch)
tree1b0031eb29cc538cfa0fb8734c7a1c835ee7cdef /vid-app-common/src/main/java/org/onap/vid/job/command/ServiceInstantiationCommand.java
parent2786c4e256e149ad5967f618017de54d5dc5566e (diff)
new tests for job dir
Add new tests for job directory to increase code coverage in vid Issue-ID: VID-310 Change-Id: Idbdeb1e9037c2b8c7359cf34b3893e1fc2e858d2 Signed-off-by: Wojciech Sliwka <wojciech.sliwka@nokia.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/job/command/ServiceInstantiationCommand.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/job/command/ServiceInstantiationCommand.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/job/command/ServiceInstantiationCommand.java b/vid-app-common/src/main/java/org/onap/vid/job/command/ServiceInstantiationCommand.java
index 9d22b8bfa..958fc115e 100644
--- a/vid-app-common/src/main/java/org/onap/vid/job/command/ServiceInstantiationCommand.java
+++ b/vid-app-common/src/main/java/org/onap/vid/job/command/ServiceInstantiationCommand.java
@@ -42,6 +42,7 @@ import org.springframework.stereotype.Component;
import javax.inject.Inject;
import java.util.Map;
+import java.util.Objects;
import java.util.UUID;
@@ -73,6 +74,14 @@ public class ServiceInstantiationCommand implements JobCommand {
init(uuid, serviceInstantiationRequest, userId);
}
+ ServiceInstantiationCommand(AsyncInstantiationBusinessLogic asyncInstantiationBL, AuditService auditService, MsoInterface msoInterface,
+ UUID uuid, ServiceInstantiation serviceInstantiation, String userId) {
+ this(uuid, serviceInstantiation, userId);
+ this.asyncInstantiationBL = asyncInstantiationBL;
+ this.auditService = auditService;
+ this.restMso = msoInterface;
+ }
+
@Override
public NextCommand call() {
RequestDetailsWrapper<ServiceInstantiationRequestDetails> requestDetailsWrapper ;
@@ -81,7 +90,6 @@ public class ServiceInstantiationCommand implements JobCommand {
uuid, serviceInstantiationRequest, userId
);
}
-
//Aai return bad response while checking names uniqueness
catch (InvalidAAIResponseException exception) {
LOGGER.error("Failed to check name uniqueness in AAI. VID will try again later", exception);
@@ -116,7 +124,7 @@ public class ServiceInstantiationCommand implements JobCommand {
return new NextCommand(jobStatus, new InProgressStatusCommand(uuid, requestId));
} else {
auditService.setFailedAuditStatusFromMso(uuid,null, msoResponse.getStatus(),
- msoResponse.getBody().toString());
+ Objects.toString(msoResponse.getBody()));
return handleCommandFailed();
}