Skip to content

Commit 29cd125

Browse files
committed
chore: update usages of deprecated methods
Signed-off-by: Robert Young <robertyoungnz@gmail.com>
1 parent be594b5 commit 29cd125

File tree

7 files changed

+15
-13
lines changed

7 files changed

+15
-13
lines changed

kroxylicious-integration-test-support/src/test/java/io/kroxylicious/test/tester/DefaultKroxyliciousTesterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.apache.kafka.clients.admin.CreateTopicsResult;
2323
import org.apache.kafka.clients.admin.DeleteTopicsResult;
2424
import org.apache.kafka.clients.consumer.MockConsumer;
25-
import org.apache.kafka.clients.consumer.OffsetResetStrategy;
25+
import org.apache.kafka.clients.consumer.internals.AutoOffsetResetStrategy.StrategyType;
2626
import org.apache.kafka.clients.producer.MockProducer;
2727
import org.apache.kafka.common.KafkaException;
2828
import org.apache.kafka.common.KafkaFuture;
@@ -97,7 +97,7 @@ class DefaultKroxyliciousTesterTest {
9797

9898
private final MockProducer<String, String> producer = new MockProducer<>();
9999

100-
private final MockConsumer<String, String> consumer = new MockConsumer<>(OffsetResetStrategy.LATEST);
100+
private final MockConsumer<String, String> consumer = new MockConsumer<>(StrategyType.LATEST.toString());
101101

102102
@BeforeEach
103103
void setUp() {

kroxylicious-integration-test-support/src/test/java/io/kroxylicious/test/tester/KroxyliciousClientsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import org.apache.kafka.clients.admin.Admin;
1717
import org.apache.kafka.clients.consumer.Consumer;
1818
import org.apache.kafka.clients.consumer.MockConsumer;
19-
import org.apache.kafka.clients.consumer.OffsetResetStrategy;
19+
import org.apache.kafka.clients.consumer.internals.AutoOffsetResetStrategy.StrategyType;
2020
import org.apache.kafka.clients.producer.MockProducer;
2121
import org.apache.kafka.clients.producer.Producer;
2222
import org.apache.kafka.clients.producer.ProducerRecord;
@@ -54,7 +54,7 @@ public Admin newAdmin(Map<String, Object> clientConfiguration) {
5454
public <K, V> Consumer<K, V> newConsumer(Map<String, Object> clientConfiguration, Deserializer<K> keyDeserializer,
5555
Deserializer<V> valueDeserializer) {
5656
assertThat(clientConfiguration).contains(Map.entry(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, "kroxylicious.example.com:9091"));
57-
return new MockConsumer<>(OffsetResetStrategy.LATEST);
57+
return new MockConsumer<>(StrategyType.LATEST.toString());
5858
}
5959

6060
@Override

kroxylicious-integration-tests/src/test/java/io/kroxylicious/it/filter/multitenant/BaseMultiTenantIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.apache.kafka.clients.consumer.ConsumerConfig;
2525
import org.apache.kafka.clients.consumer.ConsumerRecord;
2626
import org.apache.kafka.clients.consumer.ConsumerRecords;
27-
import org.apache.kafka.clients.consumer.OffsetResetStrategy;
27+
import org.apache.kafka.clients.consumer.internals.AutoOffsetResetStrategy;
2828
import org.apache.kafka.clients.producer.ProducerConfig;
2929
import org.apache.kafka.clients.producer.ProducerRecord;
3030
import org.apache.kafka.clients.producer.RecordMetadata;
@@ -137,7 +137,7 @@ Consumer<String, String> getConsumerWithConfig(KroxyliciousTester tester, String
137137
Map<String, Object> standardConfig = Map.of(ConsumerConfig.GROUP_ID_CONFIG, groupId,
138138
ConsumerConfig.ALLOW_AUTO_CREATE_TOPICS_CONFIG, Boolean.FALSE.toString(),
139139
ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, Boolean.FALSE.toString(),
140-
ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, OffsetResetStrategy.EARLIEST.toString());
140+
ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, AutoOffsetResetStrategy.StrategyType.EARLIEST.toString());
141141
return getConsumerWithConfig(tester, Optional.of(virtualCluster), baseConfig, standardConfig, additionalConfig);
142142
}
143143

kroxylicious-integration-tests/src/test/java/io/kroxylicious/it/filter/validation/JsonSchemaRecordValidationIT.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import com.fasterxml.jackson.databind.ObjectMapper;
3838
import com.github.dockerjava.api.command.CreateContainerCmd;
3939
import com.github.dockerjava.api.model.ExposedPort;
40+
import com.github.dockerjava.api.model.HostConfig;
4041
import com.github.dockerjava.api.model.PortBinding;
4142
import com.github.dockerjava.api.model.Ports;
4243

@@ -111,8 +112,8 @@ static void init() throws IOException {
111112
// An Apicurio Registry instance is required for this test to work, so we start one using a Generic Container
112113
DockerImageName dockerImageName = DockerImageName.parse("quay.io/apicurio/apicurio-registry-mem:2.6.13.Final");
113114

114-
Consumer<CreateContainerCmd> cmd = e -> e.withPortBindings(
115-
new PortBinding(Ports.Binding.bindPort(APICURIO_REGISTRY_PORT), new ExposedPort(APICURIO_REGISTRY_PORT)));
115+
Consumer<CreateContainerCmd> cmd = e -> e.withHostConfig(new HostConfig().withPortBindings(
116+
new PortBinding(Ports.Binding.bindPort(APICURIO_REGISTRY_PORT), new ExposedPort(APICURIO_REGISTRY_PORT))));
116117

117118
registryContainer = new GenericContainer<>(dockerImageName)
118119
.withEnv(Map.of(

kroxylicious-integration-tests/src/test/java/io/kroxylicious/it/net/PassthroughProxy.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
import io.netty.channel.ChannelInitializer;
2626
import io.netty.channel.ChannelOption;
2727
import io.netty.channel.EventLoopGroup;
28-
import io.netty.channel.nio.NioEventLoopGroup;
28+
import io.netty.channel.MultiThreadIoEventLoopGroup;
29+
import io.netty.channel.nio.NioIoHandler;
2930
import io.netty.channel.socket.SocketChannel;
3031
import io.netty.channel.socket.nio.NioServerSocketChannel;
3132

@@ -41,8 +42,8 @@ public class PassthroughProxy implements Closeable {
4142

4243
public PassthroughProxy(int remotePort, String remoteHost) {
4344
ServerBootstrap b = new ServerBootstrap();
44-
EventLoopGroup bossGroup = new NioEventLoopGroup(1);
45-
EventLoopGroup workerGroup = new NioEventLoopGroup();
45+
EventLoopGroup bossGroup = new MultiThreadIoEventLoopGroup(1, NioIoHandler.newFactory());
46+
EventLoopGroup workerGroup = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
4647
future = b.group(bossGroup, workerGroup)
4748
.channel(NioServerSocketChannel.class)
4849
.childHandler(new PassthroughProxyInitiailizer(remoteHost, remotePort))

kroxylicious-krpc-plugin/src/main/java/io/kroxylicious/krpccodegen/main/KrpcGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ enum GeneratorMode {
184184
JSON_SERDE.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
185185
JSON_SERDE.configure(DeserializationFeature.FAIL_ON_TRAILING_TOKENS, true);
186186
JSON_SERDE.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
187-
JSON_SERDE.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
187+
JSON_SERDE.setDefaultPropertyInclusion(JsonInclude.Include.NON_EMPTY);
188188
}
189189

190190
private final Logger logger;

kroxylicious-systemtests/src/main/java/io/kroxylicious/systemtests/templates/kroxylicious/KroxyliciousFilterTemplates.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private static ObjectMapper createBaseObjectMapper() {
5858
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
5959
.disable(DeserializationFeature.FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY)
6060
.enable(JsonParser.Feature.STRICT_DUPLICATE_DETECTION)
61-
.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
61+
.setDefaultPropertyInclusion(JsonInclude.Include.NON_DEFAULT);
6262
}
6363

6464
/**

0 commit comments

Comments
 (0)