From 63412d5fcedfefabd337e08be7feca7fc8d5d98b Mon Sep 17 00:00:00 2001
From: Benjamin Xu <32624725+benj58xu@users.noreply.github.com>
Date: Mon, 10 Aug 2020 19:23:58 -0400
Subject: [PATCH] cmdb remoteCreate accepting business service ID as
alternative; dashboard remoteCreate behaves as remoteUpdate when existing
(#155)
* cmdb remoteCreate accepting business service ID as alternative; dashboard remoteCreate behaves as remoteUpdate when existing
* Up version to 3.2.7-SNAPSHOT
* Fix review comments
---
pom.xml | 2 +-
.../dashboard/request/CmdbRequest.java | 10 ++++++
.../dashboard/rest/CmdbController.java | 5 +++
.../rest/DashboardRemoteController.java | 13 ++++---
.../service/CmdbRemoteServiceImpl.java | 25 ++++++++++---
.../service/DashboardRemoteServiceImpl.java | 35 ++++++++++++++++---
.../service/DashboardServiceImpl.java | 4 +--
.../service/CmdbRemoteServiceTest.java | 33 ++++++++++++++---
.../service/DashboardRemoteServiceTest.java | 14 ++++----
9 files changed, 113 insertions(+), 28 deletions(-)
diff --git a/pom.xml b/pom.xml
index 5bdd9127..99be9b1d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
api
jar
${project.groupId}:${project.artifactId}
- 3.2.6-SNAPSHOT
+ 3.2.7-SNAPSHOT
Hygieia Rest API Layer
https://github.com/Hygieia/api
diff --git a/src/main/java/com/capitalone/dashboard/request/CmdbRequest.java b/src/main/java/com/capitalone/dashboard/request/CmdbRequest.java
index cf7c2e21..a6859896 100644
--- a/src/main/java/com/capitalone/dashboard/request/CmdbRequest.java
+++ b/src/main/java/com/capitalone/dashboard/request/CmdbRequest.java
@@ -16,6 +16,9 @@ public class CmdbRequest {
private String assignmentGroup;
@NotNull
private String ownerDept;
+
+ private String businessService;
+
/**
* commonName Human readable value of the configurationItem
*/
@@ -92,4 +95,11 @@ public String getToolName() {
public void setToolName(String toolName) {
this.toolName = toolName;
}
+
+ public String getBusinessService() {
+ return businessService;
+ }
+
+ public void setBusinessService(String businessService) { this.businessService = businessService; }
+
}
diff --git a/src/main/java/com/capitalone/dashboard/rest/CmdbController.java b/src/main/java/com/capitalone/dashboard/rest/CmdbController.java
index f2786954..c07b8d3e 100644
--- a/src/main/java/com/capitalone/dashboard/rest/CmdbController.java
+++ b/src/main/java/com/capitalone/dashboard/rest/CmdbController.java
@@ -6,6 +6,8 @@
import com.capitalone.dashboard.service.CmdbRemoteService;
import com.capitalone.dashboard.service.CmdbService;
import com.capitalone.dashboard.util.PaginationHeaderUtility;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@@ -31,6 +33,8 @@ public class CmdbController {
private final CmdbRemoteService cmdbRemoteService;
private PaginationHeaderUtility paginationHeaderUtility;
+ private static final Logger LOGGER = LoggerFactory.getLogger(CmdbController.class);
+
@Autowired
public CmdbController(CmdbService cmdbService, PaginationHeaderUtility paginationHeaderUtility, CmdbRemoteService cmdbRemoteService ) {
@@ -62,6 +66,7 @@ public ResponseEntity