This is an automated email from the ASF dual-hosted git repository.
apupier pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-examples.git
The following commit(s) were added to refs/heads/main by this push:
new 05559a74 Replaced deprecated methods
05559a74 is described below
commit 05559a74ffd04eeb90aaffabaa13e2a8d05b31fe
Author: Aurélien Pupier <[email protected]>
AuthorDate: Tue Mar 3 17:11:47 2026 +0100
Replaced deprecated methods
Signed-off-by: Aurélien Pupier <[email protected]>
---
.../src/test/java/org/apache/camel/example/CouchbaseTest.java | 10 +++++-----
.../test/java/org/apache/camel/example/kafka/KafkaTest.java | 3 +--
.../src/test/java/org/apache/camel/example/MainHealthTest.java | 3 +--
.../java/org/apache/camel/example/mongodb/MongoDBTest.java | 3 ++-
.../apache/camel/example/telegram/usage/LiveLocationUsage.java | 2 +-
5 files changed, 10 insertions(+), 11 deletions(-)
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 62975d5c..cf74a1c1 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 @@ class CouchbaseTest extends CamelMainTestSupport {
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 539f7a9b..eed11874 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 @@ class KafkaTest extends CamelTestSupport {
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 a1924164..f029a1a8 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 @@ class MainHealthTest extends CamelMainTestSupport {
@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 2ff340d5..9f6a771b 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 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
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 a9fa6699..75b6acf2 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);