Skip to content

Commit 9ad88a1

Browse files
committed
chore: revert to Java 8 syntax
I didn't realise we were still using Java 8 to build the connector. Given that it has been deprecated in Kafka since v3.0 this doesn't seem like the right choice, but that feels like too significant a change to include in this pull request, so for now I'll just remove the newer syntax I'd used. Signed-off-by: Dale Lane <[email protected]>
1 parent 892c7f8 commit 9ad88a1

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/main/java/com/ibm/eventstreams/connect/mqsource/MQSourceConnector.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.net.MalformedURLException;
2020
import java.net.URL;
2121
import java.util.ArrayList;
22+
import java.util.HashMap;
2223
import java.util.List;
2324
import java.util.Locale;
2425
import java.util.Map;
@@ -776,8 +777,11 @@ public void ensureValid(final String name, final Object value) {
776777
final JsonDeserializer deserializer = new JsonDeserializer();
777778
final JsonConverter conv = new JsonConverter()
778779
) {
780+
final Map<String, String> converterConfig = new HashMap<>();
781+
converterConfig.put(JsonConverterConfig.TYPE_CONFIG, ConverterType.VALUE.getName());
782+
conv.configure(converterConfig);
783+
779784
final JsonNode jsonStr = deserializer.deserialize(trimmedStr, trimmedStr.getBytes());
780-
conv.configure(Map.of(JsonConverterConfig.TYPE_CONFIG, ConverterType.VALUE.getName()));
781785
conv.asConnectSchema(jsonStr);
782786
} catch (final DataException exc) {
783787
throw new ConfigException(name, value, exc.getMessage());

src/test/java/com/ibm/eventstreams/connect/mqsource/builders/RecordBuilderFactoryTest.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package com.ibm.eventstreams.connect.mqsource.builders;
1717

1818
import org.assertj.core.api.Assertions;
19+
import org.junit.Before;
1920
import org.junit.Test;
2021

2122
import com.ibm.eventstreams.connect.mqsource.MQSourceConnector;
@@ -25,11 +26,14 @@
2526

2627
public class RecordBuilderFactoryTest {
2728

28-
final Map<String, String> placeholderProps = Map.of(
29-
"mq.queue.manager", "placeholder",
30-
"mq.queue", "placeholder",
31-
"topic", "placeholder"
32-
);
29+
final Map<String, String> placeholderProps = new HashMap<>();
30+
31+
@Before
32+
public void prepareProperties() {
33+
placeholderProps.put("mq.queue.manager", "placeholder");
34+
placeholderProps.put("mq.queue", "placeholder");
35+
placeholderProps.put("topic", "placeholder");
36+
}
3337

3438
@Test
3539
public void testGetRecordBuilder_ForJsonRecordBuilder() {

0 commit comments

Comments
 (0)