aboutsummaryrefslogtreecommitdiffstats
path: root/plans/so
diff options
context:
space:
mode:
authorwaqas.ikram <waqas.ikram@est.tech>2019-08-30 17:38:13 +0000
committerWaqas Ikram <waqas.ikram@est.tech>2019-08-30 17:38:33 +0000
commite21d1a8d8db1e9d17e89e0729238f5529d696be3 (patch)
tree9670e5dde328b970a8b25779cb36a911759c66e1 /plans/so
parentccb602658c56b9ab10d8f49feba53612e06c9b93 (diff)
Fixing Unsupported Media Type bug
Change-Id: Ib2c757a51162515a5b80b01b0912cdf3ee6622da Issue-ID: SO-2239 Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
Diffstat (limited to 'plans/so')
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/GenericVnfsController.java4
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java2
-rw-r--r--plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java2
3 files changed, 7 insertions, 1 deletions
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/GenericVnfsController.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/GenericVnfsController.java
index 67e1c4b6..64284b5f 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/GenericVnfsController.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/controller/GenericVnfsController.java
@@ -19,6 +19,7 @@
*/
package org.onap.so.aaisimulator.controller;
+import static org.onap.so.aaisimulator.utils.Constants.APPLICATION_MERGE_PATCH_JSON;
import static org.onap.so.aaisimulator.utils.Constants.BI_DIRECTIONAL_RELATIONSHIP_LIST_URL;
import static org.onap.so.aaisimulator.utils.Constants.GENERIC_VNF;
import static org.onap.so.aaisimulator.utils.Constants.GENERIC_VNFS_URL;
@@ -152,7 +153,8 @@ public class GenericVnfsController {
return RequestErrorResponseUtils.getRequestErrorResponseEntity(request, GENERIC_VNF);
}
- @PostMapping(value = "/generic-vnf/{vnf-id}", consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML},
+ @PostMapping(value = "/generic-vnf/{vnf-id}",
+ consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, APPLICATION_MERGE_PATCH_JSON},
produces = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public ResponseEntity<?> patchGenericVnf(@RequestBody final GenericVnf genericVnf,
@PathVariable("vnf-id") final String vnfId,
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java
index de3f9983..dd644d16 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/main/java/org/onap/so/aaisimulator/utils/Constants.java
@@ -67,6 +67,8 @@ public class Constants {
public static final String OWNING_ENTITY_OWNING_ENTITY_ID = "owning-entity.owning-entity-id";
public static final String X_HTTP_METHOD_OVERRIDE = "X-HTTP-Method-Override";
+
+ public static final String APPLICATION_MERGE_PATCH_JSON = "application/merge-patch+json";
public static final String SERVICE_RESOURCE_TYPE = "service-instance";
diff --git a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java
index 4b9cad30..dd749db4 100644
--- a/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java
+++ b/plans/so/integration-etsi-testing/so-simulators/aai-simulator/src/test/java/org/onap/so/aaisimulator/controller/GenericVnfsControllerTest.java
@@ -345,6 +345,8 @@ public class GenericVnfsControllerTest extends AbstractSpringBootTest {
final HttpHeaders httpHeaders = testRestTemplateService.getHttpHeaders();
httpHeaders.add(X_HTTP_METHOD_OVERRIDE, HttpMethod.PATCH.toString());
+ httpHeaders.remove(HttpHeaders.CONTENT_TYPE);
+ httpHeaders.add(HttpHeaders.CONTENT_TYPE, Constants.APPLICATION_MERGE_PATCH_JSON);
final String genericVnfUrl = getUrl(GENERIC_VNF_URL, VNF_ID);
final ResponseEntity<Void> orchStatuUpdateServiceInstanceResponse = testRestTemplateService