Decoupling clamp from policy-parent 30/142730/3
authoradheli.tavares <adheli.tavares@est.tech>
Thu, 11 Dec 2025 11:37:27 +0000 (11:37 +0000)
committeradheli.tavares <adheli.tavares@est.tech>
Thu, 11 Dec 2025 14:02:26 +0000 (14:02 +0000)
- added the settings.xml for maven to know the nexus
configuration when generating new artifacts
- moving the two classes using spring from policy-common to
runtime-acm module where they are used
- removed the suse images as they are not needed
- fixed a Kafka test that was taking too long to run.

Issue-ID: POLICY-5521
Change-Id: I232b3569b13da93b61fcf90b65d1f20e820c3fcb
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
20 files changed:
models/pom.xml
packages/policy-clamp-docker/src/main/docker/A1pmsParticipant-Suse.Dockerfile [deleted file]
packages/policy-clamp-docker/src/main/docker/AcmRuntime-Suse.Dockerfile [deleted file]
packages/policy-clamp-docker/src/main/docker/ElementParticipant-Suse.Dockerfile [deleted file]
packages/policy-clamp-docker/src/main/docker/HttpParticipant-Suse.Dockerfile [deleted file]
packages/policy-clamp-docker/src/main/docker/KserveParticipant-Suse.Dockerfile [deleted file]
packages/policy-clamp-docker/src/main/docker/KubernetesParticipant-Suse.Dockerfile [deleted file]
packages/policy-clamp-docker/src/main/docker/PolicyParticipant-Suse.Dockerfile [deleted file]
packages/policy-clamp-docker/src/main/docker/SimParticipant-Suse.Dockerfile [deleted file]
packages/policy-clamp-tarball/src/main/resources/etc/AcRuntimeParameters.yaml
policy-common/pom.xml
policy-common/src/main/java/org/onap/policy/common/message/bus/event/kafka/KafkaPublisherWrapper.java
policy-common/src/main/java/org/onap/policy/common/spring/utils/CustomImplicitNamingStrategy.java [deleted file]
policy-common/src/test/java/org/onap/policy/common/message/bus/event/kafka/KafkaPublisherWrapperTest.java
policy-common/src/test/java/org/onap/policy/common/spring/utils/CustomImplicitNamingStrategyTest.java [deleted file]
runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/config/converter/ConverterConfiguration.java [moved from runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/config/ConverterConfiguration.java with 51% similarity]
runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/config/converter/YamlHttpMessageConverter.java [moved from policy-common/src/main/java/org/onap/policy/common/spring/utils/YamlHttpMessageConverter.java with 69% similarity]
runtime-acm/src/main/resources/application.yaml
runtime-acm/src/test/java/org/onap/policy/clamp/acm/runtime/config/converter/YamlHttpMessageConverterTest.java [moved from policy-common/src/test/java/org/onap/policy/common/spring/utils/YamlHttpMessageConverterTest.java with 70% similarity]
settings.xml [new file with mode: 0644]

index 7a8f691..caf150a 100644 (file)
             <groupId>org.springframework.data</groupId>
             <artifactId>spring-data-commons</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-core</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-tx</artifactId>
diff --git a/packages/policy-clamp-docker/src/main/docker/A1pmsParticipant-Suse.Dockerfile b/packages/policy-clamp-docker/src/main/docker/A1pmsParticipant-Suse.Dockerfile
deleted file mode 100644 (file)
index a03f262..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#-------------------------------------------------------------------------------
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2022 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-#-------------------------------------------------------------------------------
-
-FROM busybox AS tarball
-RUN mkdir /packages /extracted
-COPY /maven/lib/a1pms-participant.tar.gz /packages/
-RUN tar xvzf /packages/a1pms-participant.tar.gz --directory /extracted/
-
-FROM opensuse/leap:15.4
-
-LABEL maintainer="Policy Team"
-LABEL org.opencontainers.image.title="Policy CLAMP ACM A1 PMS Participant"
-LABEL org.opencontainers.image.description="Policy CLAMP ACM A1 PMS Participant image based on OpenSuse"
-LABEL org.opencontainers.image.url="https://github.com/onap/policy-clamp"
-LABEL org.opencontainers.image.vendor="ONAP Policy Team"
-LABEL org.opencontainers.image.licenses="Apache-2.0"
-LABEL org.opencontainers.image.created="${git.build.time}"
-LABEL org.opencontainers.image.version="${git.build.version}"
-LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
-
-ARG POLICY_LOGS=/var/log/onap/policy/a1pms-participant
-
-ENV POLICY_LOGS=$POLICY_LOGS
-ENV POLICY_HOME=/opt/app/policy/clamp
-ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
-ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11
-
-RUN zypper -n -q install --no-recommends java-11-openjdk-headless netcat-openbsd && \
-    zypper -n -q update && zypper -n -q clean --all && \
-    groupadd --system policy && \
-    useradd --system --shell /bin/sh -G policy policy && \
-    mkdir -p $POLICY_HOME $POLICY_LOGS && \
-    chown -R policy:policy $POLICY_HOME $POLICY_LOGS
-
-COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME
-
-WORKDIR $POLICY_HOME
-COPY --chown=policy:policy a1pms-participant.sh bin/
-COPY --chown=policy:policy /maven/policy-clamp-participant-impl-a1pms.jar /app/app.jar
-
-RUN chmod 755 bin/*.sh
-
-EXPOSE 8086
-
-USER policy
-WORKDIR $POLICY_HOME/bin
-ENTRYPOINT [ "./a1pms-participant.sh" ]
diff --git a/packages/policy-clamp-docker/src/main/docker/AcmRuntime-Suse.Dockerfile b/packages/policy-clamp-docker/src/main/docker/AcmRuntime-Suse.Dockerfile
deleted file mode 100644 (file)
index 9927358..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#-------------------------------------------------------------------------------
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2022 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-#-------------------------------------------------------------------------------
-
-FROM busybox AS tarball
-RUN mkdir /packages /extracted
-COPY /maven/lib/policy-clamp-runtime-acm.tar.gz /packages/
-RUN tar xvzf /packages/policy-clamp-runtime-acm.tar.gz --directory /extracted/
-
-FROM opensuse/leap:15.4
-
-LABEL maintainer="Policy Team"
-LABEL org.opencontainers.image.title="Policy CLAMP ACM runtime"
-LABEL org.opencontainers.image.description="Policy CLAMP ACM runtime image based on OpenSuse"
-LABEL org.opencontainers.image.url="https://github.com/onap/policy-clamp"
-LABEL org.opencontainers.image.vendor="ONAP Policy Team"
-LABEL org.opencontainers.image.licenses="Apache-2.0"
-LABEL org.opencontainers.image.created="${git.build.time}"
-LABEL org.opencontainers.image.version="${git.build.version}"
-LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
-
-ARG POLICY_LOGS=/var/log/onap/policy/policy-clamp-runtime-acm
-
-ENV POLICY_LOGS=$POLICY_LOGS
-ENV POLICY_HOME=/opt/app/policy/clamp
-ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
-ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11
-
-RUN zypper -n -q install --no-recommends java-11-openjdk-headless netcat-openbsd && \
-    zypper -n -q update && zypper -n -q clean --all && \
-    groupadd --system policy && \
-    useradd --system --shell /bin/sh -G policy policy && \
-    mkdir -p $POLICY_HOME $POLICY_LOGS && \
-    chown -R policy:policy $POLICY_HOME $POLICY_LOGS
-
-COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME
-
-WORKDIR $POLICY_HOME
-COPY --chown=policy:policy acm-runtime.sh bin/
-COPY --chown=policy:policy /maven/policy-clamp-runtime-acm.jar /app/app.jar
-
-RUN chmod 755 bin/*.sh
-
-EXPOSE 6969
-
-USER policy
-WORKDIR $POLICY_HOME/bin
-ENTRYPOINT [ "./acm-runtime.sh" ]
diff --git a/packages/policy-clamp-docker/src/main/docker/ElementParticipant-Suse.Dockerfile b/packages/policy-clamp-docker/src/main/docker/ElementParticipant-Suse.Dockerfile
deleted file mode 100644 (file)
index ed80962..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#-------------------------------------------------------------------------------
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2022 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-#-------------------------------------------------------------------------------
-
-FROM busybox AS tarball
-RUN mkdir /packages /extracted
-COPY /maven/lib/element-participant.tar.gz /packages
-RUN tar xvfz /packages/element-participant.tar.gz --directory /extracted/
-
-FROM opensuse/leap:15.4
-
-LABEL maintainer="Policy Team"
-LABEL org.opencontainers.image.title="Policy CLAMP ACM Element Participant"
-LABEL org.opencontainers.image.description="Policy CLAMP ACM Element Participant image based on OpenSuse"
-LABEL org.opencontainers.image.url="https://github.com/onap/policy-clamp"
-LABEL org.opencontainers.image.vendor="ONAP Policy Team"
-LABEL org.opencontainers.image.licenses="Apache-2.0"
-LABEL org.opencontainers.image.created="${git.build.time}"
-LABEL org.opencontainers.image.version="${git.build.version}"
-LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
-
-ARG POLICY_LOGS=/var/log/onap/policy/element-participant
-
-ENV POLICY_LOGS=$POLICY_LOGS
-ENV POLICY_HOME=/opt/app/policy/clamp
-ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
-ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11
-
-RUN zypper -n -q install --no-recommends java-11-openjdk-headless netcat-openbsd && \
-    zypper -n -q update && zypper -n -q clean --all && \
-    groupadd --system policy && \
-    useradd --system --shell /bin/sh -G policy policy && \
-    mkdir -p $POLICY_HOME $POLICY_LOGS && \
-    chown -R policy:policy $POLICY_HOME $POLICY_LOGS
-
-COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME
-
-WORKDIR $POLICY_HOME
-COPY --chown=policy:policy element-participant.sh bin/
-COPY --chown=policy:policy /maven/policy-clamp-acm-element-impl.jar /app/app.jar
-
-RUN chmod 755 bin/*.sh
-
-EXPOSE 8084
-
-USER policy
-WORKDIR $POLICY_HOME/bin
-ENTRYPOINT [ "./element-participant.sh" ]
diff --git a/packages/policy-clamp-docker/src/main/docker/HttpParticipant-Suse.Dockerfile b/packages/policy-clamp-docker/src/main/docker/HttpParticipant-Suse.Dockerfile
deleted file mode 100644 (file)
index 9e8333a..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#-------------------------------------------------------------------------------
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2022 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-#-------------------------------------------------------------------------------
-
-FROM busybox AS tarball
-RUN mkdir /packages /extracted
-COPY /maven/lib/http-participant.tar.gz /packages/
-RUN tar xvzf /packages/http-participant.tar.gz --directory /extracted/
-
-FROM opensuse/leap:15.4
-
-LABEL maintainer="Policy Team"
-LABEL org.opencontainers.image.title="Policy CLAMP ACM HTTP Participant"
-LABEL org.opencontainers.image.description="Policy CLAMP ACM HTTP Participant image based on OpenSuse"
-LABEL org.opencontainers.image.url="https://github.com/onap/policy-clamp"
-LABEL org.opencontainers.image.vendor="ONAP Policy Team"
-LABEL org.opencontainers.image.licenses="Apache-2.0"
-LABEL org.opencontainers.image.created="${git.build.time}"
-LABEL org.opencontainers.image.version="${git.build.version}"
-LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
-
-ARG POLICY_LOGS=/var/log/onap/policy/http-participant
-
-ENV POLICY_LOGS=$POLICY_LOGS
-ENV POLICY_HOME=/opt/app/policy/clamp
-ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
-ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11
-
-RUN zypper -n -q install --no-recommends java-11-openjdk-headless netcat-openbsd && \
-    zypper -n -q update && zypper -n -q clean --all && \
-    groupadd --system policy && \
-    useradd --system --shell /bin/sh -G policy policy && \
-    mkdir -p $POLICY_HOME $POLICY_LOGS && \
-    chown -R policy:policy $POLICY_HOME $POLICY_LOGS
-
-COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME
-
-WORKDIR $POLICY_HOME
-COPY --chown=policy:policy http-participant.sh bin/
-COPY --chown=policy:policy /maven/policy-clamp-participant-impl-http.jar /app/app.jar
-
-RUN chmod 755 bin/*.sh
-
-EXPOSE 8084
-
-USER policy
-WORKDIR $POLICY_HOME/bin
-ENTRYPOINT [ "./http-participant.sh" ]
diff --git a/packages/policy-clamp-docker/src/main/docker/KserveParticipant-Suse.Dockerfile b/packages/policy-clamp-docker/src/main/docker/KserveParticipant-Suse.Dockerfile
deleted file mode 100644 (file)
index b4d2049..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#-------------------------------------------------------------------------------
-# ============LICENSE_START=======================================================
-#  Copyright (C) 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.
-# 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-#-------------------------------------------------------------------------------
-
-FROM busybox AS tarball
-RUN mkdir /packages /extracted
-COPY /maven/lib/kserve-participant.tar.gz /packages/
-RUN tar xvzf /packages/kserve-participant.tar.gz --directory /extracted/
-
-FROM opensuse/leap:15.4
-
-LABEL maintainer="Policy Team"
-LABEL org.opencontainers.image.title="Policy CLAMP ACM KSERVE Participant"
-LABEL org.opencontainers.image.description="Policy CLAMP ACM KSERVE Participant image based on OpenSuse"
-LABEL org.opencontainers.image.url="https://github.com/onap/policy-clamp"
-LABEL org.opencontainers.image.vendor="ONAP Policy Team"
-LABEL org.opencontainers.image.licenses="Apache-2.0"
-LABEL org.opencontainers.image.created="${git.build.time}"
-LABEL org.opencontainers.image.version="${git.build.version}"
-LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
-
-ARG POLICY_LOGS=/var/log/onap/policy/kserve-participant
-
-ENV POLICY_LOGS=$POLICY_LOGS
-ENV POLICY_HOME=/opt/app/policy/clamp
-ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
-ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11
-
-RUN zypper -n -q install --no-recommends gzip java-11-openjdk-headless netcat-openbsd tar wget && \
-    zypper -n -q update && zypper -n -q clean --all && \
-    groupadd --system policy && \
-    useradd --system --shell /bin/sh -G policy policy && \
-    mkdir -p /app $POLICY_HOME $POLICY_LOGS && \
-    chown -R policy:policy /app $POLICY_HOME $POLICY_LOGS
-
-COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME
-
-WORKDIR $POLICY_HOME
-COPY --chown=policy:policy kserve-participant.sh bin/
-COPY --chown=policy:policy /maven/policy-clamp-participant-impl-kserve.jar /app/app.jar
-
-RUN chmod 755 bin/*.sh
-
-EXPOSE 8087
-
-USER policy
-WORKDIR $POLICY_HOME/bin
-ENTRYPOINT [ "./kserve-participant.sh" ]
-
-
diff --git a/packages/policy-clamp-docker/src/main/docker/KubernetesParticipant-Suse.Dockerfile b/packages/policy-clamp-docker/src/main/docker/KubernetesParticipant-Suse.Dockerfile
deleted file mode 100644 (file)
index 18175f3..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#-------------------------------------------------------------------------------
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2022 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-#-------------------------------------------------------------------------------
-
-FROM busybox AS tarball
-RUN mkdir /packages /extracted
-COPY /maven/lib/kubernetes-participant.tar.gz /packages/
-RUN tar xvzf /packages/kubernetes-participant.tar.gz --directory /extracted/
-
-FROM opensuse/leap:15.4
-
-LABEL maintainer="Policy Team"
-LABEL org.opencontainers.image.title="Policy CLAMP ACM K8S Participant"
-LABEL org.opencontainers.image.description="Policy CLAMP ACM K8S Participant image based on OpenSuse"
-LABEL org.opencontainers.image.url="https://github.com/onap/policy-clamp"
-LABEL org.opencontainers.image.vendor="ONAP Policy Team"
-LABEL org.opencontainers.image.licenses="Apache-2.0"
-LABEL org.opencontainers.image.created="${git.build.time}"
-LABEL org.opencontainers.image.version="${git.build.version}"
-LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
-
-ARG POLICY_LOGS=/var/log/onap/policy/k8s-participant
-
-ENV POLICY_LOGS=$POLICY_LOGS
-ENV POLICY_HOME=/opt/app/policy/clamp
-ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
-ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11
-
-RUN zypper -n -q install --no-recommends gzip java-11-openjdk-headless netcat-openbsd tar wget && \
-    zypper -n -q update && zypper -n -q clean --all && \
-    groupadd --system policy && \
-    useradd --system --shell /bin/sh -G policy policy && \
-    mkdir -p /app $POLICY_HOME $POLICY_LOGS && \
-    chown -R policy:policy /app $POLICY_HOME $POLICY_LOGS
-
-COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME
-
-WORKDIR $POLICY_HOME
-COPY --chown=policy:policy kubernetes-participant.sh bin/
-COPY --chown=policy:policy /maven/policy-clamp-participant-impl-kubernetes.jar /app/app.jar
-
-RUN chmod 755 bin/*.sh && \
-    wget -nv https://get.helm.sh/helm-v3.5.2-linux-amd64.tar.gz && \
-    tar xvf helm-v3.5.2-linux-amd64.tar.gz && \
-    mv linux-amd64/helm /usr/local/bin && \
-    rm -rf linux-amd64 && \
-    rm helm-v3.5.2-linux-amd64.tar.gz && \
-    wget -nv https://storage.googleapis.com/kubernetes-release/release/v1.21.1/bin/linux/amd64/kubectl && \
-    chmod +x kubectl && \
-    mv kubectl /usr/local/bin/kubectl
-
-EXPOSE 8083
-
-USER policy
-WORKDIR $POLICY_HOME/bin
-ENTRYPOINT [ "./kubernetes-participant.sh" ]
-
-
diff --git a/packages/policy-clamp-docker/src/main/docker/PolicyParticipant-Suse.Dockerfile b/packages/policy-clamp-docker/src/main/docker/PolicyParticipant-Suse.Dockerfile
deleted file mode 100644 (file)
index 6373ddf..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#-------------------------------------------------------------------------------
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2022 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-#-------------------------------------------------------------------------------
-
-FROM busybox AS tarball
-RUN mkdir /packages /extracted
-COPY /maven/lib/policy-participant.tar.gz /packages/
-RUN tar xvzf /packages/policy-participant.tar.gz --directory /extracted/
-
-FROM opensuse/leap:15.4
-
-LABEL maintainer="Policy Team"
-LABEL org.opencontainers.image.title="Policy CLAMP ACM Policy Framework Participant"
-LABEL org.opencontainers.image.description="Policy CLAMP ACM Policy Framework Participant image based on OpenSuse"
-LABEL org.opencontainers.image.url="https://github.com/onap/policy-clamp"
-LABEL org.opencontainers.image.vendor="ONAP Policy Team"
-LABEL org.opencontainers.image.licenses="Apache-2.0"
-LABEL org.opencontainers.image.created="${git.build.time}"
-LABEL org.opencontainers.image.version="${git.build.version}"
-LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
-
-ARG POLICY_LOGS=/var/log/onap/policy/pf-participant
-
-ENV POLICY_LOGS=$POLICY_LOGS
-ENV POLICY_HOME=/opt/app/policy/clamp
-ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
-ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11
-
-RUN zypper -n -q install --no-recommends java-11-openjdk-headless netcat-openbsd && \
-    zypper -n -q update && zypper -n -q clean --all && \
-    groupadd --system policy && \
-    useradd --system --shell /bin/sh -G policy policy && \
-    mkdir -p $POLICY_HOME $POLICY_LOGS && \
-    chown -R policy:policy $POLICY_HOME $POLICY_LOGS
-
-COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME
-
-WORKDIR $POLICY_HOME
-COPY --chown=policy:policy policy-participant.sh bin/
-COPY --chown=policy:policy /maven/policy-clamp-participant-impl-policy.jar /app/app.jar
-
-RUN chmod 755 bin/*.sh
-
-EXPOSE 8085
-
-USER policy
-WORKDIR $POLICY_HOME/bin
-ENTRYPOINT [ "./policy-participant.sh" ]
diff --git a/packages/policy-clamp-docker/src/main/docker/SimParticipant-Suse.Dockerfile b/packages/policy-clamp-docker/src/main/docker/SimParticipant-Suse.Dockerfile
deleted file mode 100644 (file)
index 29e8b48..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#-------------------------------------------------------------------------------
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2022 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-#-------------------------------------------------------------------------------
-
-FROM busybox AS tarball
-RUN mkdir /packages /extracted
-COPY /maven/lib/sim-participant.tar.gz /packages/
-RUN tar xvzf /packages/sim-participant.tar.gz --directory /extracted/
-
-FROM opensuse/leap:15.4
-
-LABEL maintainer="Policy Team"
-LABEL org.opencontainers.image.title="Policy CLAMP ACM Simulator Participant"
-LABEL org.opencontainers.image.description="Policy CLAMP ACM Simulator Participant image based on OpenSuse"
-LABEL org.opencontainers.image.url="https://github.com/onap/policy-clamp"
-LABEL org.opencontainers.image.vendor="ONAP Policy Team"
-LABEL org.opencontainers.image.licenses="Apache-2.0"
-LABEL org.opencontainers.image.created="${git.build.time}"
-LABEL org.opencontainers.image.version="${git.build.version}"
-LABEL org.opencontainers.image.revision="${git.commit.id.abbrev}"
-
-ARG POLICY_LOGS=/var/log/onap/policy/sim-participant
-
-ENV POLICY_LOGS=$POLICY_LOGS
-ENV POLICY_HOME=/opt/app/policy/clamp
-ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
-ENV JAVA_HOME=/usr/lib64/jvm/java-11-openjdk-11
-
-RUN zypper -n -q install --no-recommends java-11-openjdk-headless netcat-openbsd && \
-    zypper -n -q update && zypper -n -q clean --all && \
-    groupadd --system policy && \
-    useradd --system --shell /bin/sh -G policy policy && \
-    mkdir -p $POLICY_HOME $POLICY_LOGS && \
-    chown -R policy:policy $POLICY_HOME $POLICY_LOGS
-
-COPY --chown=policy:policy --from=tarball /extracted $POLICY_HOME
-
-WORKDIR $POLICY_HOME
-COPY --chown=policy:policy sim-participant.sh bin/
-COPY --chown=policy:policy /maven/policy-clamp-participant-impl-sim.jar /app/app.jar
-
-RUN chmod 755 bin/*.sh
-
-EXPOSE 8084
-
-USER policy
-WORKDIR $POLICY_HOME/bin
-ENTRYPOINT [ "./sim-participant.sh" ]
index 28938c0..64445ab 100644 (file)
@@ -3,7 +3,7 @@ spring:
     user:
       name: runtimeUser
       password: zb!XztG34
-  mvc:
+  http:
     converters:
       preferred-json-mapper: gson
   datasource:
@@ -21,7 +21,6 @@ spring:
       ddl-auto: none
       naming:
         physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
-        implicit-strategy: org.onap.policy.common.spring.utils.CustomImplicitNamingStrategy
     properties:
       hibernate:
         format_sql: true
index dd64bdb..0f891c2 100644 (file)
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-jexl3</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.hibernate.orm</groupId>
-            <artifactId>hibernate-core</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.projectlombok</groupId>
             <artifactId>lombok</artifactId>
             <groupId>ch.qos.logback</groupId>
             <artifactId>logback-classic</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-web</artifactId>
-        </dependency>
         <dependency>
             <groupId>org.yaml</groupId>
             <artifactId>snakeyaml</artifactId>
index 86b9e93..41866bd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ============LICENSE_START=======================================================
- * Copyright (C) 2024 Nordix Foundation.
+ * Copyright (C) 2024-2025 OpenInfra Foundation Europe.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Kafka based library publisher.
+ * Kafka-based library publisher.
  */
 public class KafkaPublisherWrapper implements BusPublisher {
 
@@ -79,7 +79,19 @@ public class KafkaPublisherWrapper implements BusPublisher {
                 TracingProducerInterceptor.class.getName());
         }
 
-        producer = new KafkaProducer<>(kafkaProps);
+        producer = createProducer(kafkaProps);
+    }
+
+    /**
+     * Creates a Kafka Producer with the given properties.
+     *
+     * @param kafkaProps the properties to configure the Kafka Producer, including
+     *                   details such as bootstrap servers, serializers, and other
+     *                   configurations.
+     * @return a configured KafkaProducer instance ready for sending messages to Kafka topics.
+     */
+    protected KafkaProducer<String, String> createProducer(Properties kafkaProps) {
+        return new KafkaProducer<>(kafkaProps);
     }
 
     @Override
diff --git a/policy-common/src/main/java/org/onap/policy/common/spring/utils/CustomImplicitNamingStrategy.java b/policy-common/src/main/java/org/onap/policy/common/spring/utils/CustomImplicitNamingStrategy.java
deleted file mode 100644 (file)
index d9a7e97..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2022 Bell Canada. All rights reserved.
- * Modifications Copyright (C) 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.
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.common.spring.utils;
-
-import java.io.Serial;
-import org.hibernate.boot.model.naming.Identifier;
-import org.hibernate.boot.model.naming.ImplicitJoinColumnNameSource;
-import org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl;
-
-public class CustomImplicitNamingStrategy extends ImplicitNamingStrategyJpaCompliantImpl {
-
-    @Serial
-    private static final long serialVersionUID = 8666774028328486896L;
-
-    @Override
-    public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source) {
-        String name = source.getReferencedColumnName().getText();
-        return toIdentifier(name, source.getBuildingContext());
-    }
-}
index 8e13af2..69e3151 100644 (file)
@@ -1,6 +1,6 @@
 /*-
  * ============LICENSE_START=======================================================
- * Copyright (C) 2024 Nordix Foundation
+ * Copyright (C) 2024-2025 OpenInfra Foundation Europe.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ package org.onap.policy.common.message.bus.event.kafka;
 
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.Mockito.mock;
@@ -29,7 +30,6 @@ import static org.mockito.Mockito.when;
 import java.util.Collections;
 import java.util.Properties;
 import org.apache.kafka.clients.producer.KafkaProducer;
-import org.apache.kafka.clients.producer.Producer;
 import org.apache.kafka.clients.producer.ProducerRecord;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -39,7 +39,7 @@ import org.onap.policy.common.parameters.topic.BusTopicParams;
 class KafkaPublisherWrapperTest {
 
     private KafkaPublisherWrapper kafkaPublisherWrapper;
-    private Producer<String, String> mockProducer;
+    private KafkaProducer<String, String> mockProducer;
     private BusTopicParams mockBusTopicParams;
 
     @BeforeEach
@@ -54,7 +54,7 @@ class KafkaPublisherWrapperTest {
         when(mockBusTopicParams.isAllowTracing()).thenReturn(false);
 
         kafkaPublisherWrapper = new KafkaPublisherWrapper(mockBusTopicParams) {
-            private Producer<String, String> createProducer(Properties props) { // NOSONAR instance creation
+            public KafkaProducer<String, String> createProducer(Properties props) { // NOSONAR instance creation
                 return mockProducer;
             }
         };
@@ -88,7 +88,7 @@ class KafkaPublisherWrapperTest {
     @Test
     void testSendFailure() {
         when(mockProducer.send(ArgumentMatchers.any(ProducerRecord.class))).thenThrow(RuntimeException.class);
-        assertTrue(kafkaPublisherWrapper.send("partitionId", "testMessage"));
+        assertFalse(kafkaPublisherWrapper.send("partitionId", "testMessage"));
     }
 
     @Test
diff --git a/policy-common/src/test/java/org/onap/policy/common/spring/utils/CustomImplicitNamingStrategyTest.java b/policy-common/src/test/java/org/onap/policy/common/spring/utils/CustomImplicitNamingStrategyTest.java
deleted file mode 100644 (file)
index 09719dd..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * ============LICENSE_START=======================================================
- * Copyright (C) 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.common.spring.utils;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import org.hibernate.boot.model.naming.Identifier;
-import org.hibernate.boot.model.naming.ImplicitJoinColumnNameSource;
-import org.hibernate.boot.model.relational.Database;
-import org.hibernate.boot.spi.InFlightMetadataCollector;
-import org.hibernate.boot.spi.MetadataBuildingContext;
-import org.hibernate.engine.jdbc.env.spi.IdentifierHelper;
-import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Test;
-import org.mockito.Mock;
-
-class CustomImplicitNamingStrategyTest {
-
-    static CustomImplicitNamingStrategy strategy;
-
-    @Mock
-    static ImplicitJoinColumnNameSource source;
-
-    @BeforeAll
-    static void setUpBeforeClass() {
-        strategy = new CustomImplicitNamingStrategy();
-        source = mock(ImplicitJoinColumnNameSource.class);
-    }
-
-    @Test
-    void testDetermineJoinColumnName() {
-        Identifier identifier = new Identifier("identifier", true);
-
-        MetadataBuildingContext buildingContextMock = mock(MetadataBuildingContext.class);
-        InFlightMetadataCollector flightCollectorMock = mock(InFlightMetadataCollector.class);
-        Database databaseMock = mock(Database.class);
-
-        when(flightCollectorMock.getDatabase()).thenReturn(databaseMock);
-        when(source.getReferencedColumnName()).thenReturn(identifier);
-        when(source.getBuildingContext()).thenReturn(buildingContextMock);
-        when(buildingContextMock.getMetadataCollector()).thenReturn(flightCollectorMock);
-
-        JdbcEnvironment environmentMock = mock(JdbcEnvironment.class);
-        when(databaseMock.getJdbcEnvironment()).thenReturn(environmentMock);
-
-        IdentifierHelper helperMock = mock(IdentifierHelper.class);
-        when(environmentMock.getIdentifierHelper()).thenReturn(helperMock);
-        when(helperMock.toIdentifier(anyString())).thenReturn(identifier);
-
-        Identifier result = strategy.determineJoinColumnName(source);
-        assertEquals(identifier, result);
-    }
-
-}
@@ -1,27 +1,25 @@
-/*-
+/*
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2021-2022 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
+ *  Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved
+ *  ================================================================================
+ *  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
+ *        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.
  *
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.clamp.acm.runtime.config;
+package org.onap.policy.clamp.acm.runtime.config.converter;
 
 import java.util.List;
-import org.onap.policy.common.spring.utils.YamlHttpMessageConverter;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.http.MediaType;
 import org.springframework.http.converter.HttpMessageConverter;
@@ -1,24 +1,23 @@
-/*-
+/*
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2022-2023 Bell Canada. All rights reserved.
- * ================================================================================
- * 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
+ *  Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved
+ *  ================================================================================
+ *  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
+ *        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.
  *
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.spring.utils;
+package org.onap.policy.clamp.acm.runtime.config.converter;
 
 import java.io.IOException;
 import java.io.InputStreamReader;
@@ -37,6 +36,7 @@ import org.springframework.http.MediaType;
 import org.springframework.http.converter.AbstractGenericHttpMessageConverter;
 import org.springframework.http.converter.HttpMessageNotReadableException;
 import org.springframework.http.converter.HttpMessageNotWritableException;
+import org.springframework.lang.NonNull;
 import org.springframework.lang.Nullable;
 
 /**
@@ -54,13 +54,15 @@ public class YamlHttpMessageConverter extends AbstractGenericHttpMessageConverte
     }
 
     @Override
-    public final Object read(Type type, @Nullable Class<?> contextClass, HttpInputMessage inputMessage)
-        throws IOException {
+    @NonNull
+    public final Object read(@NonNull Type type, @Nullable Class<?> contextClass,
+                             @NonNull HttpInputMessage inputMessage) {
         return readResolved(GenericTypeResolver.resolveType(type, contextClass), inputMessage);
     }
 
     @Override
-    protected final Object readInternal(Class<?> clazz, HttpInputMessage inputMessage) throws IOException {
+    @NonNull
+    protected final Object readInternal(@NonNull Class<?> clazz, @NonNull HttpInputMessage inputMessage) {
         return readResolved(clazz, inputMessage);
     }
 
@@ -70,8 +72,8 @@ public class YamlHttpMessageConverter extends AbstractGenericHttpMessageConverte
     }
 
     @Override
-    protected final void writeInternal(Object object, @Nullable Type type, HttpOutputMessage outputMessage)
-        throws IOException {
+    protected final void writeInternal(@NonNull Object object, @Nullable Type type,
+                                       @NonNull HttpOutputMessage outputMessage) {
         try (var writer = getWriter(outputMessage)) {
             writeInternal(object, writer);
             writer.flush();
@@ -84,7 +86,7 @@ public class YamlHttpMessageConverter extends AbstractGenericHttpMessageConverte
         TRANSLATOR.toYaml(writer, object);
     }
 
-    private Object readResolved(Type resolvedType, HttpInputMessage inputMessage) throws IOException {
+    private Object readResolved(Type resolvedType, HttpInputMessage inputMessage) {
         try (var reader = getReader(inputMessage)) {
             return readInternal(resolvedType, reader);
         } catch (Exception ex) {
index 84d805d..244b08b 100644 (file)
@@ -5,7 +5,7 @@ spring:
     user:
       name: runtimeUser
       password: zb!XztG34
-  mvc:
+  http:
     converters:
       preferred-json-mapper: gson
   datasource:
@@ -23,7 +23,6 @@ spring:
       ddl-auto: none
       naming:
         physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
-        implicit-strategy: org.onap.policy.common.spring.utils.CustomImplicitNamingStrategy
     properties:
       hibernate:
         format_sql: true
@@ -1,24 +1,23 @@
 /*
  * ============LICENSE_START=======================================================
- * ONAP
- * ================================================================================
- * Copyright (C) 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
+ *  Copyright (C) 2025 OpenInfra Foundation Europe. All rights reserved
+ *  ================================================================================
+ *  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
+ *        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.
  *
- * 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=========================================================
+ *  SPDX-License-Identifier: Apache-2.0
+ *  ============LICENSE_END=========================================================
  */
 
-package org.onap.policy.common.spring.utils;
+package org.onap.policy.clamp.acm.runtime.config.converter;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -93,7 +92,7 @@ class YamlHttpMessageConverterTest {
         // Mocking HttpHeaders
         HttpHeaders headers = mock(HttpHeaders.class);
         when(headers.getContentType()).thenReturn(MediaType.APPLICATION_JSON);  // Return JSON media type
-        when(headers.getAcceptCharset()).thenReturn(null);  // Return null to use default charset
+        when(headers.getAcceptCharset()).thenReturn(null);  // Return null to use the default charset
 
         // Mocking HttpOutputMessage
         HttpOutputMessage outputMessage = mock(HttpOutputMessage.class);
@@ -118,7 +117,7 @@ class YamlHttpMessageConverterTest {
     void testWriteInternalWithException() throws IOException {
         // Mocking HttpHeaders
         HttpHeaders headers = mock(HttpHeaders.class);
-        when(headers.getContentType()).thenReturn(MediaType.APPLICATION_JSON);  // Return YAML media type
+        when(headers.getContentType()).thenReturn(MediaType.APPLICATION_JSON);  // Should return YAML media type
 
         // Mocking HttpOutputMessage to throw an IOException when getBody() is called
         HttpOutputMessage outputMessage = mock(HttpOutputMessage.class);
@@ -133,4 +132,19 @@ class YamlHttpMessageConverterTest {
         assertThrows(HttpMessageNotWritableException.class, () -> converter.write(map, null, outputMessage));
     }
 
+    @Test
+    void testThrowException_NullValues() {
+        assertThrows(NullPointerException.class, () -> converter.write(null, null, null));
+        assertThrows(HttpMessageNotReadableException.class, () -> converter.read(null, null, null));
+        assertThrows(HttpMessageNotReadableException.class, () -> converter.read(Map.class, null, null));
+        assertThrows(HttpMessageNotWritableException.class, () -> converter.writeInternal(null, null, null));
+        assertThrows(HttpMessageNotReadableException.class, () -> converter.readInternal(null, null));
+        assertThrows(HttpMessageNotReadableException.class, () -> converter.readInternal(Map.class, null));
+
+        var map = new HashMap<>();
+        map.put("key", "value");
+        assertThrows(NullPointerException.class, () -> converter.write(map, null, null));
+        assertThrows(HttpMessageNotWritableException.class, () -> converter.writeInternal(map, null, null));
+    }
+
 }
diff --git a/settings.xml b/settings.xml
new file mode 100644 (file)
index 0000000..39ff52d
--- /dev/null
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Copyright (c) 2016-2018 Huawei Technologies Co., Ltd. and others.  All rights reserved.
+   Modifications Copyright (c) 2020 AT&T Technologies.  All rights reserved.
+   Modifications Copyright (C) 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.
+-->
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+
+  <profiles>
+    <profile>
+      <id>onap-settings</id>
+      <properties>
+        <onap.nexus.url>https://nexus.onap.org</onap.nexus.url>
+        <onap.nexus.rawrepo.baseurl.upload>https://nexus.onap.org/content/sites/raw</onap.nexus.rawrepo.baseurl.upload>
+        <onap.nexus.rawrepo.baseurl.download>https://nexus.onap.org/service/local/repositories/raw/content</onap.nexus.rawrepo.baseurl.download>
+        <onap.nexus.rawrepo.serverid>ecomp-raw</onap.nexus.rawrepo.serverid>
+
+        <!-- properties for Nexus Docker registry -->
+        <onap.nexus.dockerregistry.daily>nexus3.onap.org:10003</onap.nexus.dockerregistry.daily>
+        <onap.nexus.dockerregistry.release>nexus3.onap.org:10002</onap.nexus.dockerregistry.release>
+        <docker.pull.registry>nexus3.onap.org:10001</docker.pull.registry>
+        <docker.push.registry>nexus3.onap.org:10003</docker.push.registry>
+      </properties>
+    </profile>
+    <profile>
+      <id>onap-snapshots</id>
+      <repositories>
+        <repository>
+          <id>onap-snapshots</id>
+          <name>onap-snapshots</name>
+          <url>https://nexus.onap.org/content/repositories/snapshots/</url>
+          <releases>
+            <enabled>false</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>onap-snapshots</id>
+          <name>onap-snapshots</name>
+          <url>https://nexus.onap.org/content/repositories/snapshots/</url>
+          <releases>
+            <enabled>false</enabled>
+          </releases>
+          <snapshots>
+            <enabled>true</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+    <profile>
+      <id>onap-releases</id>
+      <repositories>
+        <repository>
+          <id>onap-releases</id>
+          <name>onap-releases</name>
+          <url>https://nexus.onap.org/content/repositories/releases/</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>onap-releases</id>
+          <name>onap-releases</name>
+          <url>https://nexus.onap.org/content/repositories/releases/</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+    <profile>
+      <id>onap-public</id>
+      <repositories>
+        <repository>
+          <id>central</id>
+          <url>https://repo1.maven.org/maven2/</url>
+        </repository>
+        <repository>
+          <id>onap-public</id>
+          <name>onap-public</name>
+          <url>https://nexus.onap.org/content/repositories/public/</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>central</id>
+          <url>https://repo1.maven.org/maven2/</url>
+        </pluginRepository>
+        <pluginRepository>
+          <id>onap-public</id>
+          <name>onap-public</name>
+          <url>https://nexus.onap.org/content/repositories/public/</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+    <profile>
+      <!-- Configure this profile if you have a local nexus cache -->
+      <id>local-public</id>
+      <repositories>
+        <repository>
+          <id>local-public</id>
+          <name>local-public</name>
+          <url>http://nexus-proxy:8081/nexus/content/repositories/public/</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </repository>
+      </repositories>
+      <pluginRepositories>
+        <pluginRepository>
+          <id>local-public</id>
+          <name>local-public</name>
+          <url>http://nexus-proxy:8081/nexus/content/repositories/public/</url>
+          <releases>
+            <enabled>true</enabled>
+          </releases>
+          <snapshots>
+            <enabled>false</enabled>
+          </snapshots>
+        </pluginRepository>
+      </pluginRepositories>
+    </profile>
+  </profiles>
+
+  <activeProfiles>
+    <activeProfile>onap-settings</activeProfile>
+    <activeProfile>onap-snapshots</activeProfile>
+    <activeProfile>onap-releases</activeProfile>
+    <activeProfile>onap-public</activeProfile>
+    <!-- <activeProfile>local-public</activeProfile> -->
+  </activeProfiles>
+
+</settings>