diff --git a/couchbase-log/src/test/java/org/apache/camel/example/CouchbaseTest.java b/couchbase-log/src/test/java/org/apache/camel/example/CouchbaseTest.java index 62975d5cc..cf74a1c1d 100644 --- a/couchbase-log/src/test/java/org/apache/camel/example/CouchbaseTest.java +++ b/couchbase-log/src/test/java/org/apache/camel/example/CouchbaseTest.java @@ -58,7 +58,7 @@ class CouchbaseTest extends CamelMainTestSupport { @BeforeAll static void init() { CLUSTER = Cluster.connect( - SERVICE.getConnectionString(), SERVICE.getUsername(), SERVICE.getPassword() + SERVICE.getConnectionString(), SERVICE.username(), SERVICE.password() ); DesignDocument designDoc = new DesignDocument( CouchbaseConstants.DEFAULT_DESIGN_DOCUMENT_NAME, @@ -84,10 +84,10 @@ static void destroy() { 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.host", SERVICE.hostname(), + "couchbase.port", Integer.toString(SERVICE.port()), + "couchbase.username", SERVICE.username(), + "couchbase.password", SERVICE.password(), "couchbase.bucket", BUCKET); camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties); } diff --git a/kafka/src/test/java/org/apache/camel/example/kafka/KafkaTest.java b/kafka/src/test/java/org/apache/camel/example/kafka/KafkaTest.java index 539f7a9bc..eed118743 100644 --- a/kafka/src/test/java/org/apache/camel/example/kafka/KafkaTest.java +++ b/kafka/src/test/java/org/apache/camel/example/kafka/KafkaTest.java @@ -59,8 +59,7 @@ protected CamelContext createCamelContext() throws Exception { public void setupResources() throws Exception { // Replace the from endpoint to send messages easily - // still use the deprecated method for now as method is not visible camelContextConfiguration().replaceRouteFromWith("input", "direct:in"); - replaceRouteFromWith("input", "direct:in"); + camelContextConfiguration().replaceRouteFromWith("input", "direct:in"); super.setupResources(); } diff --git a/main-health/src/test/java/org/apache/camel/example/MainHealthTest.java b/main-health/src/test/java/org/apache/camel/example/MainHealthTest.java index a1924164e..f029a1a88 100644 --- a/main-health/src/test/java/org/apache/camel/example/MainHealthTest.java +++ b/main-health/src/test/java/org/apache/camel/example/MainHealthTest.java @@ -43,8 +43,7 @@ public void configureContext(CamelContextConfiguration camelContextConfiguration @Override public void setupResources() throws Exception { // Prevent failure by replacing the failing endpoint - // still use the deprecated method for now as method is not visible camelContextConfiguration().replaceRouteFromWith("netty", "direct:foo"); - replaceRouteFromWith("netty", "direct:foo"); + camelContextConfiguration().replaceRouteFromWith("netty", "direct:foo"); super.setupResources(); } diff --git a/mongodb/src/test/java/org/apache/camel/example/mongodb/MongoDBTest.java b/mongodb/src/test/java/org/apache/camel/example/mongodb/MongoDBTest.java index 2ff340d5e..9f6a771b6 100644 --- a/mongodb/src/test/java/org/apache/camel/example/mongodb/MongoDBTest.java +++ b/mongodb/src/test/java/org/apache/camel/example/mongodb/MongoDBTest.java @@ -40,13 +40,14 @@ class MongoDBTest extends CamelMainTestSupport { private static final String BASE_URI = "http://localhost:8081"; + private static final String MONGODB_URL_PREFIX = "mongodb://"; @RegisterExtension private static final MongoDBService SERVICE = MongoDBServiceFactory.createService(); @Override protected void bindToRegistry(Registry registry) throws Exception { - registry.bind("myDb", MongoClients.create(SERVICE.getReplicaSetUrl())); + registry.bind("myDb", MongoClients.create(MONGODB_URL_PREFIX + SERVICE.hosts())); } @Test diff --git a/telegram/src/main/java/org/apache/camel/example/telegram/usage/LiveLocationUsage.java b/telegram/src/main/java/org/apache/camel/example/telegram/usage/LiveLocationUsage.java index a9fa66992..75b6acf21 100644 --- a/telegram/src/main/java/org/apache/camel/example/telegram/usage/LiveLocationUsage.java +++ b/telegram/src/main/java/org/apache/camel/example/telegram/usage/LiveLocationUsage.java @@ -32,7 +32,7 @@ public class LiveLocationUsage implements TelegramMethodUsage { public void run(CamelContext context) throws InterruptedException { ProducerTemplate template = context.createProducerTemplate(); SendLocationMessage msg = new SendLocationMessage(latitude, longitude); - msg.setLivePeriod(new Integer(60)); + msg.setLivePeriod(Integer.valueOf(60)); MessageResult firstLocationMessage = template.requestBody("direct:start", msg, MessageResult.class); System.out.println(firstLocationMessage);