Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.camel.test.infra.aws2.services.AWSServiceFactory;
import org.apache.camel.test.infra.kafka.services.KafkaService;
import org.apache.camel.test.infra.kafka.services.KafkaServiceFactory;
import org.apache.camel.test.junit5.CamelContextConfiguration;
import org.apache.camel.test.main.junit5.CamelMainTestSupport;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand All @@ -55,10 +56,10 @@ protected CamelContext createCamelContext() throws Exception {
}

@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
return asProperties(
"kafkaBrokers", KAFKA_SERVICE.getBootstrapServers()
);
public void configureContext(CamelContextConfiguration camelContextConfiguration) {
super.configureContext(camelContextConfiguration);
Properties overridenProperties = asProperties("kafkaBrokers", KAFKA_SERVICE.getBootstrapServers());
camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.apache.camel.test.infra.aws2.services.AWSServiceFactory;
import org.apache.camel.test.infra.kafka.services.KafkaService;
import org.apache.camel.test.infra.kafka.services.KafkaServiceFactory;
import org.apache.camel.test.junit5.CamelContextConfiguration;
import org.apache.camel.test.main.junit5.CamelMainTestSupport;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand All @@ -55,10 +56,10 @@ protected CamelContext createCamelContext() throws Exception {
}

@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
return asProperties(
"kafkaBrokers", KAFKA_SERVICE.getBootstrapServers()
);
public void configureContext(CamelContextConfiguration camelContextConfiguration) {
super.configureContext(camelContextConfiguration);
Properties overridenProperties = asProperties("kafkaBrokers", KAFKA_SERVICE.getBootstrapServers());
camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.camel.main.MainConfigurationProperties;
import org.apache.camel.test.infra.couchbase.services.CouchbaseService;
import org.apache.camel.test.infra.couchbase.services.CouchbaseServiceFactory;
import org.apache.camel.test.junit5.CamelContextConfiguration;
import org.apache.camel.test.main.junit5.CamelMainTestSupport;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
Expand Down Expand Up @@ -80,14 +81,15 @@ static void destroy() {
}

@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
return asProperties(
"couchbase.host", SERVICE.getHostname(),
"couchbase.port", Integer.toString(SERVICE.getPort()),
"couchbase.username", SERVICE.getUsername(),
"couchbase.password", SERVICE.getPassword(),
"couchbase.bucket", BUCKET
);
public void configureContext(CamelContextConfiguration camelContextConfiguration) {
super.configureContext(camelContextConfiguration);
Properties overridenProperties = asProperties(
"couchbase.host", SERVICE.getHostname(),
"couchbase.port", Integer.toString(SERVICE.getPort()),
"couchbase.username", SERVICE.getUsername(),
"couchbase.password", SERVICE.getPassword(),
"couchbase.bucket", BUCKET);
camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.main.MainConfigurationProperties;
import org.apache.camel.test.junit5.CamelContextConfiguration;
import org.apache.camel.test.main.junit5.CamelMainTestSupport;
import org.junit.jupiter.api.Test;

Expand All @@ -32,10 +33,11 @@
*/
class CSimpleJOORTest extends CamelMainTestSupport {


@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
return asProperties("myPeriod", Integer.toString(500));
public void configureContext(CamelContextConfiguration camelContextConfiguration) {
super.configureContext(camelContextConfiguration);
Properties overridenProperties = asProperties("myPeriod", Integer.toString(500));
camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.main.MainConfigurationProperties;
import org.apache.camel.test.junit5.CamelContextConfiguration;
import org.apache.camel.test.main.junit5.CamelMainTestSupport;
import org.junit.jupiter.api.Test;

Expand All @@ -33,8 +34,10 @@
class CSimpleTest extends CamelMainTestSupport {

@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
return asProperties("myPeriod", Integer.toString(500));
public void configureContext(CamelContextConfiguration camelContextConfiguration) {
super.configureContext(camelContextConfiguration);
Properties overridenProperties = asProperties("myPeriod", Integer.toString(500));
camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.apache.camel.test.infra.cassandra.services.CassandraServiceFactory;
import org.apache.camel.test.infra.postgres.services.PostgresLocalContainerService;
import org.apache.camel.test.infra.postgres.services.PostgresService;
import org.apache.camel.test.junit5.CamelContextConfiguration;
import org.apache.camel.test.main.junit5.CamelMainTestSupport;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -106,15 +107,14 @@ protected CamelContext createCamelContext() throws Exception {
}

@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
// Override the host and port of the broker
return asProperties(
"debezium.postgres.databaseHostName", POSTGRES_SERVICE.host(),
"debezium.postgres.databasePort", Integer.toString(POSTGRES_SERVICE.port()),
"debezium.postgres.databaseUser", SOURCE_DB_USERNAME,
"debezium.postgres.databasePassword", SOURCE_DB_PASSWORD,
"cassandra.node", String.format("%s:%d", CASSANDRA_SERVICE.getCassandraHost(), CASSANDRA_SERVICE.getCQL3Port())
);
public void configureContext(CamelContextConfiguration camelContextConfiguration) {
super.configureContext(camelContextConfiguration);
Properties overridenProperties = asProperties("debezium.postgres.databaseHostName", POSTGRES_SERVICE.host(),
"debezium.postgres.databasePort", Integer.toString(POSTGRES_SERVICE.port()),
"debezium.postgres.databaseUser", SOURCE_DB_USERNAME,
"debezium.postgres.databasePassword", SOURCE_DB_PASSWORD,
"cassandra.node", String.format("%s:%d", CASSANDRA_SERVICE.getCassandraHost(), CASSANDRA_SERVICE.getCQL3Port()));
camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties);
}

@Test
Expand Down
14 changes: 8 additions & 6 deletions ftp/src/test/java/org/apache/camel/example/ftp/FtpTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.main.MainConfigurationProperties;
import org.apache.camel.test.junit5.CamelContextConfiguration;
import org.apache.camel.test.main.junit5.CamelMainTestSupport;
import org.apache.ftpserver.FtpServer;
import org.apache.ftpserver.FtpServerFactory;
Expand Down Expand Up @@ -87,12 +88,13 @@ static void destroy() {
}

@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
return asProperties(
"ftp.port", Integer.toString(PORT),
"ftp.username", "admin",
"ftp.password", "admin"
);
public void configureContext(CamelContextConfiguration camelContextConfiguration) {
super.configureContext(camelContextConfiguration);
Properties overridenProperties = asProperties(
"ftp.port", Integer.toString(PORT),
"ftp.username", "admin",
"ftp.password", "admin");
camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.main.MainConfigurationProperties;
import org.apache.camel.test.junit5.CamelContextConfiguration;
import org.apache.camel.test.main.junit5.CamelMainTestSupport;
import org.junit.jupiter.api.Test;

Expand All @@ -33,8 +34,10 @@
class MainEndpointDSLTest extends CamelMainTestSupport {

@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
return asProperties("myPeriod", Integer.toString(500));
public void configureContext(CamelContextConfiguration camelContextConfiguration) {
super.configureContext(camelContextConfiguration);
Properties overridenProperties = asProperties("myPeriod", Integer.toString(500));
camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.main.MainConfigurationProperties;
import org.apache.camel.test.junit5.CamelContextConfiguration;
import org.apache.camel.test.main.junit5.CamelMainTestSupport;
import org.junit.jupiter.api.Test;

Expand All @@ -33,8 +34,10 @@
class MainHealthTest extends CamelMainTestSupport {

@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
return asProperties("myPeriod", Integer.toString(500));
public void configureContext(CamelContextConfiguration camelContextConfiguration) {
super.configureContext(camelContextConfiguration);
Properties overridenProperties = asProperties("myPeriod", Integer.toString(500));
camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.main.MainConfigurationProperties;
import org.apache.camel.test.junit5.CamelContextConfiguration;
import org.apache.camel.test.main.junit5.CamelMainTestSupport;
import org.junit.jupiter.api.Test;

Expand All @@ -33,8 +34,10 @@
class MainJOORTest extends CamelMainTestSupport {

@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
return asProperties("myPeriod", Integer.toString(500));
public void configureContext(CamelContextConfiguration camelContextConfiguration) {
super.configureContext(camelContextConfiguration);
Properties overridenProperties = asProperties("myPeriod", Integer.toString(500));
camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.apache.camel.builder.NotifyBuilder;
import org.apache.camel.main.MainConfigurationProperties;
import org.apache.camel.test.junit5.CamelContextConfiguration;
import org.apache.camel.test.main.junit5.CamelMainTestSupport;
import org.junit.jupiter.api.Test;

Expand All @@ -33,8 +34,10 @@
class MainTinyTest extends CamelMainTestSupport {

@Override
protected Properties useOverridePropertiesWithPropertiesComponent() {
return asProperties("myPeriod", Integer.toString(500));
public void configureContext(CamelContextConfiguration camelContextConfiguration) {
super.configureContext(camelContextConfiguration);
Properties overridenProperties = asProperties("myPeriod", Integer.toString(500));
camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties);
}

@Test
Expand Down