Skip to content

Commit 05559a7

Browse files
committed
Replaced deprecated methods
Signed-off-by: Aurélien Pupier <apupier@ibm.com>
1 parent 29dca2e commit 05559a7

5 files changed

Lines changed: 10 additions & 11 deletions

File tree

couchbase-log/src/test/java/org/apache/camel/example/CouchbaseTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class CouchbaseTest extends CamelMainTestSupport {
5858
@BeforeAll
5959
static void init() {
6060
CLUSTER = Cluster.connect(
61-
SERVICE.getConnectionString(), SERVICE.getUsername(), SERVICE.getPassword()
61+
SERVICE.getConnectionString(), SERVICE.username(), SERVICE.password()
6262
);
6363
DesignDocument designDoc = new DesignDocument(
6464
CouchbaseConstants.DEFAULT_DESIGN_DOCUMENT_NAME,
@@ -84,10 +84,10 @@ static void destroy() {
8484
public void configureContext(CamelContextConfiguration camelContextConfiguration) {
8585
super.configureContext(camelContextConfiguration);
8686
Properties overridenProperties = asProperties(
87-
"couchbase.host", SERVICE.getHostname(),
88-
"couchbase.port", Integer.toString(SERVICE.getPort()),
89-
"couchbase.username", SERVICE.getUsername(),
90-
"couchbase.password", SERVICE.getPassword(),
87+
"couchbase.host", SERVICE.hostname(),
88+
"couchbase.port", Integer.toString(SERVICE.port()),
89+
"couchbase.username", SERVICE.username(),
90+
"couchbase.password", SERVICE.password(),
9191
"couchbase.bucket", BUCKET);
9292
camelContextConfiguration.withUseOverridePropertiesWithPropertiesComponent(overridenProperties);
9393
}

kafka/src/test/java/org/apache/camel/example/kafka/KafkaTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ protected CamelContext createCamelContext() throws Exception {
5959

6060
public void setupResources() throws Exception {
6161
// Replace the from endpoint to send messages easily
62-
// still use the deprecated method for now as method is not visible camelContextConfiguration().replaceRouteFromWith("input", "direct:in");
63-
replaceRouteFromWith("input", "direct:in");
62+
camelContextConfiguration().replaceRouteFromWith("input", "direct:in");
6463
super.setupResources();
6564
}
6665

main-health/src/test/java/org/apache/camel/example/MainHealthTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ public void configureContext(CamelContextConfiguration camelContextConfiguration
4343
@Override
4444
public void setupResources() throws Exception {
4545
// Prevent failure by replacing the failing endpoint
46-
// still use the deprecated method for now as method is not visible camelContextConfiguration().replaceRouteFromWith("netty", "direct:foo");
47-
replaceRouteFromWith("netty", "direct:foo");
46+
camelContextConfiguration().replaceRouteFromWith("netty", "direct:foo");
4847
super.setupResources();
4948
}
5049

mongodb/src/test/java/org/apache/camel/example/mongodb/MongoDBTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@
4040
class MongoDBTest extends CamelMainTestSupport {
4141

4242
private static final String BASE_URI = "http://localhost:8081";
43+
private static final String MONGODB_URL_PREFIX = "mongodb://";
4344

4445
@RegisterExtension
4546
private static final MongoDBService SERVICE = MongoDBServiceFactory.createService();
4647

4748
@Override
4849
protected void bindToRegistry(Registry registry) throws Exception {
49-
registry.bind("myDb", MongoClients.create(SERVICE.getReplicaSetUrl()));
50+
registry.bind("myDb", MongoClients.create(MONGODB_URL_PREFIX + SERVICE.hosts()));
5051
}
5152

5253
@Test

telegram/src/main/java/org/apache/camel/example/telegram/usage/LiveLocationUsage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class LiveLocationUsage implements TelegramMethodUsage {
3232
public void run(CamelContext context) throws InterruptedException {
3333
ProducerTemplate template = context.createProducerTemplate();
3434
SendLocationMessage msg = new SendLocationMessage(latitude, longitude);
35-
msg.setLivePeriod(new Integer(60));
35+
msg.setLivePeriod(Integer.valueOf(60));
3636
MessageResult firstLocationMessage = template.requestBody("direct:start", msg, MessageResult.class);
3737
System.out.println(firstLocationMessage);
3838

0 commit comments

Comments
 (0)