You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/03/11 13:08:25 UTC
[camel] branch master updated: Camel-AWS-DDB: Use the
BindToRegistry annotations where possible in tests
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new df956da Camel-AWS-DDB: Use the BindToRegistry annotations where possible in tests
df956da is described below
commit df956dace5f8b7f98604004f7e1f3ea9e54dc630
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Mar 11 14:07:45 2019 +0100
Camel-AWS-DDB: Use the BindToRegistry annotations where possible in tests
---
.../apache/camel/component/aws/ddb/DdbComponentTest.java | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/components/camel-aws-ddb/src/test/java/org/apache/camel/component/aws/ddb/DdbComponentTest.java b/components/camel-aws-ddb/src/test/java/org/apache/camel/component/aws/ddb/DdbComponentTest.java
index 8f91b29..f14ad8e 100644
--- a/components/camel-aws-ddb/src/test/java/org/apache/camel/component/aws/ddb/DdbComponentTest.java
+++ b/components/camel-aws-ddb/src/test/java/org/apache/camel/component/aws/ddb/DdbComponentTest.java
@@ -16,15 +16,16 @@
*/
package org.apache.camel.component.aws.ddb;
+import org.apache.camel.BindToRegistry;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultProducerTemplate;
-import org.apache.camel.impl.JndiRegistry;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;
public class DdbComponentTest extends CamelTestSupport {
- private AmazonDDBClientMock amazonDDBClient;
+ @BindToRegistry("amazonDDBClient")
+ private AmazonDDBClientMock amazonDDBClient = new AmazonDDBClientMock();
@Test
public void whenTableExistsThenDoesntCreateItOnStart() throws Exception {
@@ -59,16 +60,6 @@ public class DdbComponentTest extends CamelTestSupport {
}
@Override
- protected JndiRegistry createRegistry() throws Exception {
- JndiRegistry registry = super.createRegistry();
-
- amazonDDBClient = new AmazonDDBClientMock();
- registry.bind("amazonDDBClient", amazonDDBClient);
-
- return registry;
- }
-
- @Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override