diff --git a/tests/itests-elasticsearch/src/test/java/org/apache/camel/kafkaconnector/elasticsearch/common/ElasticSearchLocalContainerServiceHack.java b/tests/itests-elasticsearch/src/test/java/org/apache/camel/kafkaconnector/elasticsearch/common/ElasticSearchLocalContainerServiceHack.java deleted file mode 100644 index 52568694b0..0000000000 --- a/tests/itests-elasticsearch/src/test/java/org/apache/camel/kafkaconnector/elasticsearch/common/ElasticSearchLocalContainerServiceHack.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You 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. - */ -package org.apache.camel.kafkaconnector.elasticsearch.common; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.nio.file.Files; -import java.nio.file.OpenOption; -import java.nio.file.Path; - -import org.apache.camel.test.infra.elasticsearch.services.ElasticSearchLocalContainerService; -import org.testcontainers.elasticsearch.ElasticsearchContainer; - -public class ElasticSearchLocalContainerServiceHack extends ElasticSearchLocalContainerService { - public ElasticSearchLocalContainerServiceHack() { - super(); - } - - public ElasticSearchLocalContainerServiceHack(String imageName) { - super(imageName); - } - - public ElasticSearchLocalContainerServiceHack(ElasticsearchContainer container) { - super(container); - } - - @Override - public void registerProperties() { - System.setProperty("elasticsearch.host", this.getElasticSearchHost()); - System.setProperty("elasticsearch.port", String.valueOf(this.getPort())); - this.getContainer().caCertAsBytes().ifPresent(content -> { - try { - Field certPath = getClass().getSuperclass().getDeclaredField("certPath"); - certPath.setAccessible(true); // enables access to private variables - certPath.set(this, Files.createTempFile("http_ca", ".crt")); - Files.write((Path) certPath.get(this), content, new OpenOption[0]); - - Field sslContext = getClass().getSuperclass().getDeclaredField("sslContext"); - sslContext.setAccessible(true); // enables access to private variables - sslContext.set(this, this.getContainer().createSslContextFromCa()); - } catch (IOException | NoSuchFieldException | IllegalAccessException var3) { - throw new RuntimeException(var3); - } - }); - } -} diff --git a/tests/itests-elasticsearch/src/test/java/org/apache/camel/kafkaconnector/elasticsearch/sink/CamelSinkElasticSearchITCase.java b/tests/itests-elasticsearch/src/test/java/org/apache/camel/kafkaconnector/elasticsearch/sink/CamelSinkElasticSearchITCase.java index 082389c944..891dc59a70 100644 --- a/tests/itests-elasticsearch/src/test/java/org/apache/camel/kafkaconnector/elasticsearch/sink/CamelSinkElasticSearchITCase.java +++ b/tests/itests-elasticsearch/src/test/java/org/apache/camel/kafkaconnector/elasticsearch/sink/CamelSinkElasticSearchITCase.java @@ -29,7 +29,7 @@ import org.apache.camel.kafkaconnector.elasticsearch.clients.ElasticSearchClient; import org.apache.camel.kafkaconnector.elasticsearch.common.ElasticSearchCommon; import org.apache.camel.kafkaconnector.elasticsearch.common.ElasticSearchIndexMessageProducer; -import org.apache.camel.kafkaconnector.elasticsearch.common.ElasticSearchLocalContainerServiceHack; +import org.apache.camel.test.infra.elasticsearch.services.ElasticSearchLocalContainerService; import org.apache.camel.test.infra.elasticsearch.services.ElasticSearchService; import org.apache.camel.test.infra.elasticsearch.services.RemoteElasticSearchService; import org.junit.jupiter.api.BeforeEach; @@ -56,8 +56,7 @@ public ElasticSearchService get() { ElasticsearchContainer container = new ElasticsearchContainer("docker.elastic.co/elasticsearch/elasticsearch:8.5.2"); container.addEnv("xpack.security.enabled", "true"); - //XXX: revert back to the normal lasticSearchLocalContainerService when https://issues.apache.org/jira/browse/CAMEL-19834 is fixed - return new ElasticSearchLocalContainerServiceHack(container); + return new ElasticSearchLocalContainerService(container); } } ).addRemoteMapping(RemoteElasticSearchService::new).build(); diff --git a/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/source/CamelSourceSQLITCase.java b/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/source/CamelSourceSQLITCase.java index 6a08de6833..4795b46b92 100644 --- a/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/source/CamelSourceSQLITCase.java +++ b/tests/itests-sql/src/test/java/org/apache/camel/kafkaconnector/sql/source/CamelSourceSQLITCase.java @@ -31,7 +31,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -//@Disabled("Database connection fails with connection refused.") public class CamelSourceSQLITCase extends CamelSourceTestSupport { private static final String DATABASE_NAME = "camel"; private static final String USERNAME = "ckc"; diff --git a/tooling/camel-kafka-connector-generator-maven-plugin/src/main/resources/camel-kafka-connector-java-header.txt b/tooling/camel-kafka-connector-generator-maven-plugin/src/main/resources/camel-kafka-connector-java-header.txt index f974c9ac4f..ae6f28c4a1 100644 --- a/tooling/camel-kafka-connector-generator-maven-plugin/src/main/resources/camel-kafka-connector-java-header.txt +++ b/tooling/camel-kafka-connector-generator-maven-plugin/src/main/resources/camel-kafka-connector-java-header.txt @@ -13,4 +13,4 @@ * 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. - */ \ No newline at end of file + */