From cf53eacdaf85a91a7e697465180d6a1f7bacc658 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 2 Feb 2023 14:49:38 +0000 Subject: Replace Eclipselink with Hibernate Issue-ID: POLICY-4533 Change-Id: I9e2e9bbff1d47e9d507d4abcbf01f9c05d8fab88 Signed-off-by: liamfallon --- .../event/carrier/kafka/KafkaCarrierTechnologyParameters.java | 8 +------- .../carrier/kafka/KafkaCarrierTechnologyParametersTest.java | 10 +--------- .../plugins/event/protocol/yaml/YamlPluginStabilityTest.java | 5 +++-- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-kafka/src/main/java/org/onap/policy/apex/plugins/event/carrier/kafka/KafkaCarrierTechnologyParameters.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-kafka/src/main/java/org/onap/policy/apex/plugins/event/carrier/kafka/KafkaCarrierTechnologyParameters.java index a599307ff..19334134c 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-kafka/src/main/java/org/onap/policy/apex/plugins/event/carrier/kafka/KafkaCarrierTechnologyParameters.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-kafka/src/main/java/org/onap/policy/apex/plugins/event/carrier/kafka/KafkaCarrierTechnologyParameters.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019,2023 Nordix Foundation. * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ @@ -31,7 +31,6 @@ import java.util.Properties; import lombok.Getter; import lombok.Setter; import org.apache.commons.lang3.StringUtils; -import org.apache.kafka.clients.producer.internals.DefaultPartitioner; import org.onap.policy.apex.service.parameters.carriertechnology.CarrierTechnologyParameters; import org.onap.policy.common.parameters.BeanValidationResult; import org.onap.policy.common.parameters.ObjectValidationResult; @@ -79,7 +78,6 @@ public class KafkaCarrierTechnologyParameters extends CarrierTechnologyParameter private static final String[] DEFAULT_CONS_TOPICLIST = {"apex-in"}; private static final String DEFAULT_STRING_SERZER = "org.apache.kafka.common.serialization.StringSerializer"; private static final String DEFAULT_STRING_DESZER = "org.apache.kafka.common.serialization.StringDeserializer"; - private static final String DEFAULT_PARTITIONR_CLASS = DefaultPartitioner.class.getName(); // Parameter property map tokens private static final String PROPERTY_BOOTSTRAP_SERVERS = "bootstrap.servers"; @@ -96,7 +94,6 @@ public class KafkaCarrierTechnologyParameters extends CarrierTechnologyParameter private static final String PROPERTY_VALUE_SERIALIZER = "value.serializer"; private static final String PROPERTY_KEY_DESERIALIZER = "key.deserializer"; private static final String PROPERTY_VALUE_DESERIALIZER = "value.deserializer"; - private static final String PROPERTY_PARTITIONER_CLASS = "partitioner.class"; // kafka carrier parameters @NotBlank @@ -131,8 +128,6 @@ public class KafkaCarrierTechnologyParameters extends CarrierTechnologyParameter private String keyDeserializer = DEFAULT_STRING_DESZER; @NotBlank private String valueDeserializer = DEFAULT_STRING_DESZER; - @NotBlank - private String partitionerClass = DEFAULT_PARTITIONR_CLASS; // All Kafka properties can be specified as an array of key-value pairs private String[][] kafkaProperties = null; @@ -176,7 +171,6 @@ public class KafkaCarrierTechnologyParameters extends CarrierTechnologyParameter putExplicitProperty(retKafkaProps, PROPERTY_BUFFER_MEMORY, bufferMemory, DEFAULT_BUFFER_MEMORY); putExplicitProperty(retKafkaProps, PROPERTY_KEY_SERIALIZER, keySerializer, DEFAULT_STRING_SERZER); putExplicitProperty(retKafkaProps, PROPERTY_VALUE_SERIALIZER, valueSerializer, DEFAULT_STRING_SERZER); - putExplicitProperty(retKafkaProps, PROPERTY_PARTITIONER_CLASS, partitionerClass, DEFAULT_PARTITIONR_CLASS); // @formatter:on return retKafkaProps; diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-kafka/src/test/java/org/onap/policy/apex/plugins/event/carrier/kafka/KafkaCarrierTechnologyParametersTest.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-kafka/src/test/java/org/onap/policy/apex/plugins/event/carrier/kafka/KafkaCarrierTechnologyParametersTest.java index 14f13bc97..6b0f7d920 100644 --- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-kafka/src/test/java/org/onap/policy/apex/plugins/event/carrier/kafka/KafkaCarrierTechnologyParametersTest.java +++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-kafka/src/test/java/org/onap/policy/apex/plugins/event/carrier/kafka/KafkaCarrierTechnologyParametersTest.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Samsung. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019,2023 Nordix Foundation. * Modifications Copyright (C) 2021 Bell Canada. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -140,12 +140,6 @@ public class KafkaCarrierTechnologyParametersTest { kafkaCarrierTechnologyParameters.setProducerTopic(origStringValue); assertTrue(kafkaCarrierTechnologyParameters.validate().isValid()); - origStringValue = kafkaCarrierTechnologyParameters.getPartitionerClass(); - kafkaCarrierTechnologyParameters.setPartitionerClass(" "); - assertFalse(kafkaCarrierTechnologyParameters.validate().isValid()); - kafkaCarrierTechnologyParameters.setPartitionerClass(origStringValue); - assertTrue(kafkaCarrierTechnologyParameters.validate().isValid()); - int origIntValue = kafkaCarrierTechnologyParameters.getRetries(); kafkaCarrierTechnologyParameters.setRetries(-1); assertFalse(kafkaCarrierTechnologyParameters.validate().isValid()); @@ -333,8 +327,6 @@ public class KafkaCarrierTechnologyParametersTest { kafkaCtp.getKafkaConsumerProperties().get("key.deserializer")); assertEquals("org.apache.kafka.common.serialization.StringDeserializer", kafkaCtp.getKafkaConsumerProperties().get("value.deserializer")); - assertEquals("org.apache.kafka.clients.producer.internals.DefaultPartitioner", - kafkaCtp.getKafkaProducerProperties().get("partitioner.class")); // @formatter:off String[][] kafkaProperties0 = { diff --git a/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-yaml/src/test/java/org/onap/policy/apex/plugins/event/protocol/yaml/YamlPluginStabilityTest.java b/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-yaml/src/test/java/org/onap/policy/apex/plugins/event/protocol/yaml/YamlPluginStabilityTest.java index 0d3d62382..fdab1d8c1 100644 --- a/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-yaml/src/test/java/org/onap/policy/apex/plugins/event/protocol/yaml/YamlPluginStabilityTest.java +++ b/plugins/plugins-event/plugins-event-protocol/plugins-event-protocol-yaml/src/test/java/org/onap/policy/apex/plugins/event/protocol/yaml/YamlPluginStabilityTest.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 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) 2022 Bell Canada. All rights reserved. * ================================================================================ @@ -112,6 +112,7 @@ public class YamlPluginStabilityTest { * * @throws ApexEventException the apex event exception */ + @SuppressWarnings("deprecation") @Test public void testStability() throws ApexEventException { Apex2YamlEventConverter converter = new Apex2YamlEventConverter(); @@ -220,4 +221,4 @@ public class YamlPluginStabilityTest { assertThatThrownBy(() -> converter.toApexEvent("TestEvent", "doubleValue: 123.45\n" + "intValue: ~\n" + "stringValue: MyString")).getCause().hasMessageStartingWith("mandatory field \"intValue\" is missing"); } -} \ No newline at end of file +} -- cgit 1.2.3-korg