From 49f07db935d114b72a44e446867b16262dd552aa Mon Sep 17 00:00:00 2001 From: rameshiyer27 Date: Mon, 29 Jan 2024 09:23:58 +0000 Subject: Remove dmaap from models Issue-ID: POLICY-4402 Change-Id: Icead1601984f463e557b969f2792f0f0aa05f060 Signed-off-by: rameshiyer27 --- models-interactions/model-impl/aai/pom.xml | 4 +- .../onap/policy/appclcm/AppcLcmDmaapWrapper.java | 51 ------------------- .../onap/policy/appclcm/AppcLcmMessageWrapper.java | 51 +++++++++++++++++++ .../test/java/org/onap/policy/sdnr/SdnrTest.java | 58 +++++++++++----------- models-interactions/model-impl/so/pom.xml | 4 +- .../java/org/onap/policy/so/SoDummyServer.java | 14 +++--- 6 files changed, 91 insertions(+), 91 deletions(-) delete mode 100644 models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/AppcLcmDmaapWrapper.java create mode 100644 models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/AppcLcmMessageWrapper.java (limited to 'models-interactions/model-impl') diff --git a/models-interactions/model-impl/aai/pom.xml b/models-interactions/model-impl/aai/pom.xml index 9ccdd4465..afadd752a 100644 --- a/models-interactions/model-impl/aai/pom.xml +++ b/models-interactions/model-impl/aai/pom.xml @@ -3,7 +3,7 @@ aai ================================================================================ Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2019, 2023 Nordix Foundation. + Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ org.onap.aai.schema-service aai-schema - 1.9.6 + 1.12.3 com.google.code.javaparser diff --git a/models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/AppcLcmDmaapWrapper.java b/models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/AppcLcmDmaapWrapper.java deleted file mode 100644 index 525ac622c..000000000 --- a/models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/AppcLcmDmaapWrapper.java +++ /dev/null @@ -1,51 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * appclcm - * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. - * ================================================================================ - * 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.policy.appclcm; - -import com.google.gson.annotations.SerializedName; -import java.io.Serializable; -import lombok.Data; - -@Data -public class AppcLcmDmaapWrapper implements Serializable { - - private static final long serialVersionUID = 753005805432396532L; - - @SerializedName(value = "version") - private String version; - - @SerializedName(value = "cambria-partition") - private String cambriaPartition; - - @SerializedName(value = "rpc-name") - private String rpcName; - - @SerializedName(value = "correlation-id") - private String correlationId; - - @SerializedName(value = "type") - private String type; - - @SerializedName("body") - private AppcLcmBody body; - -} diff --git a/models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/AppcLcmMessageWrapper.java b/models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/AppcLcmMessageWrapper.java new file mode 100644 index 000000000..bb9d1cf05 --- /dev/null +++ b/models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/AppcLcmMessageWrapper.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * appclcm + * ================================================================================ + * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019, 2024 Nordix Foundation. + * ================================================================================ + * 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.policy.appclcm; + +import com.google.gson.annotations.SerializedName; +import java.io.Serializable; +import lombok.Data; + +@Data +public class AppcLcmMessageWrapper implements Serializable { + + private static final long serialVersionUID = 753005805432396532L; + + @SerializedName(value = "version") + private String version; + + @SerializedName(value = "cambria-partition") + private String cambriaPartition; + + @SerializedName(value = "rpc-name") + private String rpcName; + + @SerializedName(value = "correlation-id") + private String correlationId; + + @SerializedName(value = "type") + private String type; + + @SerializedName("body") + private AppcLcmBody body; + +} diff --git a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/SdnrTest.java b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/SdnrTest.java index bd5fad494..c84084890 100644 --- a/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/SdnrTest.java +++ b/models-interactions/model-impl/sdnr/src/test/java/org/onap/policy/sdnr/SdnrTest.java @@ -3,7 +3,7 @@ * sdnr * ================================================================================ * Copyright (C) 2018 Wipro Limited Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019, 2024 Nordix Foundation. * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -38,22 +38,22 @@ public class SdnrTest { private static final Logger logger = LoggerFactory.getLogger(SdnrTest.class); - private static PciRequestWrapper dmaapRequest; - private static PciResponseWrapper dmaapResponse; + private static PciRequestWrapper messageRequest; + private static PciResponseWrapper messageResponse; static { /* * Construct an SDNR Request to be Serialized */ - dmaapRequest = new PciRequestWrapper(); - dmaapRequest.setCorrelationId(CORRELATION_ID + "-" + "1"); - dmaapRequest.setRpcName("restart"); - dmaapRequest.setType("request"); + messageRequest = new PciRequestWrapper(); + messageRequest.setCorrelationId(CORRELATION_ID + "-" + "1"); + messageRequest.setRpcName("restart"); + messageRequest.setType("request"); - dmaapResponse = new PciResponseWrapper(); - dmaapResponse.setCorrelationId(CORRELATION_ID + "-" + "1"); - dmaapResponse.setRpcName("restart"); - dmaapResponse.setType("response"); + messageResponse = new PciResponseWrapper(); + messageResponse.setCorrelationId(CORRELATION_ID + "-" + "1"); + messageResponse.setRpcName("restart"); + messageResponse.setType("response"); PciRequest sdnrRequest = new PciRequest(); @@ -67,7 +67,7 @@ public class SdnrTest { sdnrRequest.setPayload(null); - dmaapRequest.setBody(sdnrRequest); + messageRequest.setBody(sdnrRequest); /* * Construct an SDNR Response to be Serialized @@ -77,7 +77,7 @@ public class SdnrTest { sdnrResponse.getStatus().setValue("Restart Successful"); sdnrResponse.setPayload(null); - dmaapResponse.setBody(sdnrResponse); + messageResponse.setBody(sdnrResponse); } @Test @@ -86,7 +86,7 @@ public class SdnrTest { /* * Use the gson serializer to obtain json */ - String jsonRequest = Serialization.gson.toJson(dmaapRequest, PciRequestWrapper.class); + String jsonRequest = Serialization.gson.toJson(messageRequest, PciRequestWrapper.class); assertNotNull(jsonRequest); /* @@ -115,25 +115,25 @@ public class SdnrTest { /* * Convert the PCI request object into json so we have a string of json to use for testing */ - String jsonRequest = Serialization.gson.toJson(dmaapRequest, PciRequestWrapper.class); + String jsonRequest = Serialization.gson.toJson(messageRequest, PciRequestWrapper.class); /* * Use the serializer to convert the json string into a java object */ PciRequestWrapper pciRequestWrapper = Serialization.gson.fromJson(jsonRequest, PciRequestWrapper.class); assertNotNull(pciRequestWrapper); - assertEquals(dmaapRequest, pciRequestWrapper); + assertEquals(messageRequest, pciRequestWrapper); /* - * The type of the DMAAP wrapper should be request + * The type of the Message wrapper should be request */ - assertEquals("request", dmaapRequest.getType()); + assertEquals("request", messageRequest.getType()); /* - * The DMAAP wrapper must have a body as that is the true SDNR request + * The Message wrapper must have a body as that is the true SDNR request */ - assertNotNull(dmaapRequest.getBody()); - PciRequest sdnrRequest = dmaapRequest.getBody(); + assertNotNull(messageRequest.getBody()); + PciRequest sdnrRequest = messageRequest.getBody(); assertNotNull(sdnrRequest); /* @@ -156,7 +156,7 @@ public class SdnrTest { /* * Use the serializer to convert the object into json */ - String jsonResponse = Serialization.gson.toJson(dmaapResponse, PciResponseWrapper.class); + String jsonResponse = Serialization.gson.toJson(messageResponse, PciResponseWrapper.class); assertNotNull(jsonResponse); /* @@ -180,25 +180,25 @@ public class SdnrTest { /* * Convert the PCI response object into json so we have a string of json to use for testing */ - String jsonResponse = Serialization.gson.toJson(dmaapResponse, PciResponseWrapper.class); + String jsonResponse = Serialization.gson.toJson(messageResponse, PciResponseWrapper.class); /* * Use the serializer to convert the json string into a java object */ PciResponseWrapper pciResponseWrapper = Serialization.gson.fromJson(jsonResponse, PciResponseWrapper.class); assertNotNull(pciResponseWrapper); - assertEquals(dmaapResponse, pciResponseWrapper); + assertEquals(messageResponse, pciResponseWrapper); /* - * The type of the DMAAP wrapper should be response + * The type of the Message wrapper should be response */ - assertEquals("response", dmaapResponse.getType()); + assertEquals("response", messageResponse.getType()); /* - * The DMAAP wrapper must have a body as that is the true SDNR response + * The Message wrapper must have a body as that is the true SDNR response */ - assertNotNull(dmaapResponse.getBody()); - PciResponse sdnrResponse = dmaapResponse.getBody(); + assertNotNull(messageResponse.getBody()); + PciResponse sdnrResponse = messageResponse.getBody(); assertNotNull(sdnrResponse); /* diff --git a/models-interactions/model-impl/so/pom.xml b/models-interactions/model-impl/so/pom.xml index 374c5df03..f38fd9bea 100644 --- a/models-interactions/model-impl/so/pom.xml +++ b/models-interactions/model-impl/so/pom.xml @@ -3,7 +3,7 @@ so ================================================================================ Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. - Modifications Copyright (C) 2019, 2023 Nordix Foundation. + Modifications Copyright (C) 2019, 2023-2024 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ org.glassfish.jersey.containers jersey-container-grizzly2-http - 3.1.3 + ${version.jersey} test diff --git a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoDummyServer.java b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoDummyServer.java index d7e7a1166..bb7e85144 100644 --- a/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoDummyServer.java +++ b/models-interactions/model-impl/so/src/test/java/org/onap/policy/so/SoDummyServer.java @@ -5,7 +5,7 @@ * Copyright (C) 2018 Ericsson. All rights reserved. * ================================================================================ * Modifications Copyright (C) 2018-2019 AT&T. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019, 2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +24,14 @@ package org.onap.policy.so; import com.google.gson.Gson; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.core.Response; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.core.Response; @Path("/SO") public class SoDummyServer { -- cgit 1.2.3-korg