aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2023-02-02 14:47:46 +0000
committerliamfallon <liam.fallon@est.tech>2023-02-02 17:55:21 +0000
commitcc83fb1b3bce889c83dafdb48b55621ff00a4d48 (patch)
tree9b898ae1ddf110c73b324ae3882431e7dac71253
parent5aa5a743a10c6e24fbb34669be00b32119bc8d64 (diff)
Replace Eclipselink with Hibernate
Issue-ID: POLICY-4533 Change-Id: Ieda653947935448036b822960aae5498595ad4e0 Signed-off-by: liamfallon <liam.fallon@est.tech>
-rw-r--r--gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/RestUtils.java8
-rw-r--r--gui-server/src/test/java/org/onap/policy/gui/server/config/RestTemplateConfig.java4
2 files changed, 5 insertions, 7 deletions
diff --git a/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/RestUtils.java b/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/RestUtils.java
index 53b91f5..cd9c3d2 100644
--- a/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/RestUtils.java
+++ b/gui-editors/gui-editor-apex/src/main/java/org/onap/policy/gui/editors/apex/rest/handling/RestUtils.java
@@ -1,7 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2016-2018 Ericsson. All rights reserved.
- * Modifications Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020,2023 Nordix Foundation.
* Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* ================================================================================
@@ -38,7 +38,6 @@ import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.transform.stream.StreamSource;
-import org.eclipse.persistence.jaxb.MarshallerProperties;
import org.onap.policy.apex.model.basicmodel.concepts.AxConcept;
import org.onap.policy.gui.editors.apex.rest.handling.bean.BeanBase;
@@ -160,10 +159,9 @@ public abstract class RestUtils {
final var jaxbContext = JAXBContext.newInstance(clz);
unmarshaller = jaxbContext.createUnmarshaller();
if (jsonString.matches(JSON_INPUT_TYPE_REGEXP)) {
- unmarshaller.setProperty(MarshallerProperties.MEDIA_TYPE, MediaType.APPLICATION_JSON);
- unmarshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT, true);
+ unmarshaller.setProperty("media-type", MediaType.APPLICATION_JSON);
} else if (jsonString.matches(XML_INPUT_TYPE_REGEXP)) {
- unmarshaller.setProperty(MarshallerProperties.MEDIA_TYPE, MediaType.APPLICATION_XML);
+ unmarshaller.setProperty("media-type", MediaType.APPLICATION_XML);
} else {
return null;
}
diff --git a/gui-server/src/test/java/org/onap/policy/gui/server/config/RestTemplateConfig.java b/gui-server/src/test/java/org/onap/policy/gui/server/config/RestTemplateConfig.java
index 4ffce3b..1efa826 100644
--- a/gui-server/src/test/java/org/onap/policy/gui/server/config/RestTemplateConfig.java
+++ b/gui-server/src/test/java/org/onap/policy/gui/server/config/RestTemplateConfig.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2022 Nordix Foundation.
+ * Copyright (C) 2022-2023 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import javax.annotation.PostConstruct;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.boot.web.server.LocalServerPort;
+import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.web.client.RestTemplate;
/**