killbill-memoizeit

Merge branch 'payment-work' of github.com:alenad/killbill

12/5/2011 6:45:00 PM

Changes

payment/pom.xml 5(+5 -0)

pom.xml 8(+7 -1)

Details

diff --git a/api/src/main/java/com/ning/billing/payment/api/PaymentApi.java b/api/src/main/java/com/ning/billing/payment/api/PaymentApi.java
new file mode 100644
index 0000000..bc27211
--- /dev/null
+++ b/api/src/main/java/com/ning/billing/payment/api/PaymentApi.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2010-2011 Ning, Inc.
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.ning.billing.payment.api;
+
+import javax.annotation.Nullable;
+
+public interface PaymentApi {
+    Either<PaymentError, PaymentMethodInfo> getPaymentMethodInfo(@Nullable String accountId, String paymentMethodId);
+}
diff --git a/api/src/main/java/com/ning/billing/payment/api/PaymentMethodInfo.java b/api/src/main/java/com/ning/billing/payment/api/PaymentMethodInfo.java
new file mode 100644
index 0000000..23b4993
--- /dev/null
+++ b/api/src/main/java/com/ning/billing/payment/api/PaymentMethodInfo.java
@@ -0,0 +1,42 @@
+package com.ning.billing.payment.api;
+
+public class PaymentMethodInfo {
+    private final String id;
+    private final String accountId;
+    private final Boolean defaultMethod;
+    private final String email;
+    private final String type;
+
+    public PaymentMethodInfo(String id,
+                             String accountId,
+                             Boolean defaultMethod,
+                             String email,
+                             String type) {
+        this.id = id;
+        this.accountId = accountId;
+        this.defaultMethod = defaultMethod;
+        this.email = email;
+        this.type = type;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public String getAccountId() {
+        return accountId;
+    }
+
+    public Boolean getDefaultMethod() {
+        return defaultMethod;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+}
diff --git a/api/src/main/java/com/ning/billing/payment/api/PaymentService.java b/api/src/main/java/com/ning/billing/payment/api/PaymentService.java
new file mode 100644
index 0000000..c923c46
--- /dev/null
+++ b/api/src/main/java/com/ning/billing/payment/api/PaymentService.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2010-2011 Ning, Inc.
+ *
+ * Ning licenses this file to you under the Apache License, version 2.0
+ * (the "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at:
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.ning.billing.payment.api;
+
+import com.ning.billing.lifecycle.IService;
+
+public interface PaymentService extends IService {
+    @Override
+    String getName();
+
+    PaymentApi getPaymentApi();
+}

payment/pom.xml 5(+5 -0)

diff --git a/payment/pom.xml b/payment/pom.xml
index 8be82aa..ba9988b 100644
--- a/payment/pom.xml
+++ b/payment/pom.xml
@@ -47,6 +47,11 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
+            <groupId>com.google.inject.extensions</groupId>
+            <artifactId>guice-multibindings</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>joda-time</groupId>
             <artifactId>joda-time</artifactId>
         </dependency>
diff --git a/payment/src/main/java/com/ning/billing/payment/api/DefaultPaymentApi.java b/payment/src/main/java/com/ning/billing/payment/api/DefaultPaymentApi.java
new file mode 100644
index 0000000..a1ac50e
--- /dev/null
+++ b/payment/src/main/java/com/ning/billing/payment/api/DefaultPaymentApi.java
@@ -0,0 +1,40 @@
+package com.ning.billing.payment.api;
+
+import java.util.UUID;
+
+import javax.annotation.Nullable;
+
+import com.google.inject.Inject;
+import com.ning.billing.account.api.IAccount;
+import com.ning.billing.account.api.IAccountUserApi;
+import com.ning.billing.payment.RequestProcessor;
+import com.ning.billing.payment.provider.PaymentProviderPlugin;
+import com.ning.billing.payment.provider.PaymentProviderPluginRegistry;
+
+public class DefaultPaymentApi implements PaymentApi {
+    private final PaymentProviderPluginRegistry pluginRegistry;
+    private final IAccountUserApi accountUserApi;
+
+    @Inject
+    public DefaultPaymentApi(PaymentProviderPluginRegistry pluginRegistry, IAccountUserApi accountUserApi) {
+        this.pluginRegistry = pluginRegistry;
+        this.accountUserApi = accountUserApi;
+    }
+
+    @Override
+    public Either<PaymentError, PaymentMethodInfo> getPaymentMethodInfo(@Nullable String accountId, String paymentMethodId) {
+        final String paymentProviderName;
+
+        if (accountId == null) {
+            // TODO: backwards compatible mode: get provider name from config
+            paymentProviderName = null;
+        }
+        else {
+            final IAccount account = accountUserApi.getAccountFromId(UUID.fromString(accountId));
+            paymentProviderName = account.getFieldValue(RequestProcessor.PAYMENT_PROVIDER_KEY);
+        }
+        final PaymentProviderPlugin plugin = pluginRegistry.getPlugin(paymentProviderName);
+
+        return plugin.getPaymentMethodInfo(paymentMethodId);
+    }
+}
diff --git a/payment/src/main/java/com/ning/billing/payment/CreditCardPaymentMethod.java b/payment/src/main/java/com/ning/billing/payment/CreditCardPaymentMethod.java
index 98710dc..09f32c1 100644
--- a/payment/src/main/java/com/ning/billing/payment/CreditCardPaymentMethod.java
+++ b/payment/src/main/java/com/ning/billing/payment/CreditCardPaymentMethod.java
@@ -1,5 +1,7 @@
 package com.ning.billing.payment;
 
+import com.ning.billing.payment.api.PaymentMethodInfo;
+
 public class CreditCardPaymentMethod  extends PaymentMethodInfo {
     private final String cardHolderName;
     private final String cardType; // e.g. MasterCard
diff --git a/payment/src/main/java/com/ning/billing/payment/provider/PaymentProviderPlugin.java b/payment/src/main/java/com/ning/billing/payment/provider/PaymentProviderPlugin.java
index 52bb320..fa6b8a1 100644
--- a/payment/src/main/java/com/ning/billing/payment/provider/PaymentProviderPlugin.java
+++ b/payment/src/main/java/com/ning/billing/payment/provider/PaymentProviderPlugin.java
@@ -18,11 +18,11 @@ package com.ning.billing.payment.provider;
 
 import com.ning.billing.account.api.IAccount;
 import com.ning.billing.invoice.model.Invoice;
-import com.ning.billing.payment.PaymentError;
 import com.ning.billing.payment.PaymentInfo;
-import com.ning.billing.payment.PaymentMethodInfo;
 import com.ning.billing.payment.PaymentProviderAccount;
-import com.ning.billing.util.Either;
+import com.ning.billing.payment.api.Either;
+import com.ning.billing.payment.api.PaymentError;
+import com.ning.billing.payment.api.PaymentMethodInfo;
 
 public interface PaymentProviderPlugin {
     Either<PaymentError, PaymentInfo> processInvoice(IAccount account, Invoice invoice);
diff --git a/payment/src/main/java/com/ning/billing/payment/provider/PaymentProviderPluginRegistry.java b/payment/src/main/java/com/ning/billing/payment/provider/PaymentProviderPluginRegistry.java
index cee31d3..4aa942c 100644
--- a/payment/src/main/java/com/ning/billing/payment/provider/PaymentProviderPluginRegistry.java
+++ b/payment/src/main/java/com/ning/billing/payment/provider/PaymentProviderPluginRegistry.java
@@ -14,7 +14,7 @@ public class PaymentProviderPluginRegistry {
 
     @Inject
     public PaymentProviderPluginRegistry(PaymentConfig config) {
-        this.defaultPlugin = config.getDefaultPaymentProviderPlugin();
+        this.defaultPlugin = config.getDefaultPaymentProvider();
     }
 
     public void register(PaymentProviderPlugin plugin, String name) {
diff --git a/payment/src/main/java/com/ning/billing/payment/RequestProcessor.java b/payment/src/main/java/com/ning/billing/payment/RequestProcessor.java
index b175137..9359dd1 100644
--- a/payment/src/main/java/com/ning/billing/payment/RequestProcessor.java
+++ b/payment/src/main/java/com/ning/billing/payment/RequestProcessor.java
@@ -21,9 +21,10 @@ import com.google.inject.Inject;
 import com.ning.billing.account.api.IAccount;
 import com.ning.billing.account.api.IAccountUserApi;
 import com.ning.billing.invoice.model.Invoice;
+import com.ning.billing.payment.api.Either;
+import com.ning.billing.payment.api.PaymentError;
 import com.ning.billing.payment.provider.PaymentProviderPlugin;
 import com.ning.billing.payment.provider.PaymentProviderPluginRegistry;
-import com.ning.billing.util.Either;
 import com.ning.billing.util.eventbus.IEventBus;
 import com.ning.billing.util.eventbus.IEventBus.EventBusException;
 
diff --git a/payment/src/main/java/com/ning/billing/payment/setup/PaymentConfig.java b/payment/src/main/java/com/ning/billing/payment/setup/PaymentConfig.java
index b0e4b67..cdc5384 100644
--- a/payment/src/main/java/com/ning/billing/payment/setup/PaymentConfig.java
+++ b/payment/src/main/java/com/ning/billing/payment/setup/PaymentConfig.java
@@ -20,7 +20,7 @@ import org.skife.config.Config;
 import org.skife.config.DefaultNull;
 
 public interface PaymentConfig {
-    @Config("killbill.payment.provider.defaultPlugin")
+    @Config("killbill.payment.provider.default")
     @DefaultNull
-    public String getDefaultPaymentProviderPlugin();
+    public String getDefaultPaymentProvider();
 }
diff --git a/payment/src/main/java/com/ning/billing/payment/setup/PaymentModule.java b/payment/src/main/java/com/ning/billing/payment/setup/PaymentModule.java
index dc7f535..81649af 100644
--- a/payment/src/main/java/com/ning/billing/payment/setup/PaymentModule.java
+++ b/payment/src/main/java/com/ning/billing/payment/setup/PaymentModule.java
@@ -39,7 +39,8 @@ public class PaymentModule extends AbstractModule {
 
     @Override
     protected void configure() {
-        final PaymentConfig config = new ConfigurationObjectFactory(props).build(PaymentConfig.class);
+        final ConfigurationObjectFactory factory = new ConfigurationObjectFactory(props);
+        final PaymentConfig config = factory.build(PaymentConfig.class);
 
         bind(PaymentConfig.class).toInstance(config);
         bind(PaymentProviderPluginRegistry.class).asEagerSingleton();
diff --git a/payment/src/main/java/com/ning/billing/payment/util/EventBusFuture.java b/payment/src/main/java/com/ning/billing/payment/util/EventBusFuture.java
new file mode 100644
index 0000000..909c120
--- /dev/null
+++ b/payment/src/main/java/com/ning/billing/payment/util/EventBusFuture.java
@@ -0,0 +1,59 @@
+package com.ning.billing.payment.util;
+
+import javax.annotation.Nullable;
+
+import com.google.common.eventbus.Subscribe;
+import com.google.common.util.concurrent.AbstractFuture;
+import com.ning.billing.util.eventbus.IEventBus;
+import com.ning.billing.util.eventbus.IEventBus.EventBusException;
+
+public class EventBusFuture<T, V extends IEventBusResponseType<T>> extends AbstractFuture<V> {
+    public static <V, W extends IEventBusRequestType<V>, X extends IEventBusResponseType<V>> EventBusFuture<V, X> post(final IEventBus eventBus, final W event) throws EventBusException {
+        final EventBusFuture<V, X> responseFuture = new EventBusFuture<V, X>(eventBus, event.getId());
+
+        eventBus.register(responseFuture);
+        eventBus.post(event);
+        return responseFuture;
+    }
+
+    private final IEventBus eventBus;
+    private final T requestId;
+
+    private EventBusFuture(IEventBus eventBus, T requestId) {
+        this.eventBus = eventBus;
+        this.requestId = requestId;
+    }
+
+    @Subscribe
+    public void handleResponse(V response) {
+        if (requestId.equals(response.getRequestId())) {
+            set(response);
+        }
+    }
+
+    @Override
+    public boolean set(@Nullable V value) {
+        boolean result = super.set(value);
+
+        try {
+            eventBus.unregister(this);
+        }
+        catch (EventBusException ex) {
+            throw new RuntimeException(ex);
+        }
+        return result;
+    }
+
+    @Override
+    public boolean setException(Throwable throwable) {
+        boolean result = super.setException(throwable);
+
+        try {
+            eventBus.unregister(this);
+        }
+        catch (EventBusException ex) {
+            throw new RuntimeException(ex);
+        }
+        return result;
+    }
+}
diff --git a/payment/src/main/java/com/ning/billing/payment/util/IEventBusRequestType.java b/payment/src/main/java/com/ning/billing/payment/util/IEventBusRequestType.java
new file mode 100644
index 0000000..98ee280
--- /dev/null
+++ b/payment/src/main/java/com/ning/billing/payment/util/IEventBusRequestType.java
@@ -0,0 +1,7 @@
+package com.ning.billing.payment.util;
+
+import com.ning.billing.util.eventbus.IEventBusType;
+
+public interface IEventBusRequestType<T> extends IEventBusType {
+    T getId();
+}
diff --git a/payment/src/main/java/com/ning/billing/payment/util/IEventBusResponseType.java b/payment/src/main/java/com/ning/billing/payment/util/IEventBusResponseType.java
new file mode 100644
index 0000000..9f1f9da
--- /dev/null
+++ b/payment/src/main/java/com/ning/billing/payment/util/IEventBusResponseType.java
@@ -0,0 +1,7 @@
+package com.ning.billing.payment.util;
+
+import com.ning.billing.util.eventbus.IEventBusType;
+
+public interface IEventBusResponseType<T> extends IEventBusType {
+    T getRequestId();
+}
diff --git a/payment/src/test/java/com/ning/billing/payment/MockPaymentInfoReceiver.java b/payment/src/test/java/com/ning/billing/payment/MockPaymentInfoReceiver.java
index 2558b3a..fe207fb 100644
--- a/payment/src/test/java/com/ning/billing/payment/MockPaymentInfoReceiver.java
+++ b/payment/src/test/java/com/ning/billing/payment/MockPaymentInfoReceiver.java
@@ -5,6 +5,7 @@ import java.util.Collections;
 import java.util.List;
 
 import com.google.common.eventbus.Subscribe;
+import com.ning.billing.payment.api.PaymentError;
 
 public class MockPaymentInfoReceiver {
     private final List<PaymentInfo> processedPayments = Collections.synchronizedList(new ArrayList<PaymentInfo>());
diff --git a/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPlugin.java b/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPlugin.java
index 86f1129..25bf0ae 100644
--- a/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPlugin.java
+++ b/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPlugin.java
@@ -20,24 +20,17 @@ import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
 
-import com.google.inject.Inject;
 import com.ning.billing.account.api.IAccount;
 import com.ning.billing.invoice.model.Invoice;
-import com.ning.billing.payment.PaymentError;
 import com.ning.billing.payment.PaymentInfo;
-import com.ning.billing.payment.PaymentMethodInfo;
 import com.ning.billing.payment.PaymentProviderAccount;
-import com.ning.billing.util.Either;
+import com.ning.billing.payment.api.Either;
+import com.ning.billing.payment.api.PaymentError;
+import com.ning.billing.payment.api.PaymentMethodInfo;
 
 public class MockPaymentProviderPlugin implements PaymentProviderPlugin {
-    public static final String PLUGIN_NAME = "mock";
     private final Map<String, PaymentInfo> payments = new ConcurrentHashMap<String, PaymentInfo>();
 
-    @Inject
-    public MockPaymentProviderPlugin(PaymentProviderPluginRegistry registry) {
-        registry.register(this, PLUGIN_NAME);
-    }
-
     @Override
     public Either<PaymentError, PaymentInfo> processInvoice(IAccount account, Invoice invoice) {
         PaymentInfo payment = new PaymentInfo.Builder().setId(UUID.randomUUID().toString()).build();
diff --git a/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPluginModule.java b/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPluginModule.java
new file mode 100644
index 0000000..88b6f7c
--- /dev/null
+++ b/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPluginModule.java
@@ -0,0 +1,20 @@
+package com.ning.billing.payment.provider;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.name.Names;
+
+public class MockPaymentProviderPluginModule extends AbstractModule {
+    private final String instanceName;
+
+    public MockPaymentProviderPluginModule(String instanceName) {
+        this.instanceName = instanceName;
+    }
+
+    @Override
+    protected void configure() {
+        bind(MockPaymentProviderPlugin.class)
+            .annotatedWith(Names.named(instanceName))
+            .toProvider(new MockPaymentProviderPluginProvider(instanceName))
+            .asEagerSingleton();
+    }
+}
diff --git a/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPluginProvider.java b/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPluginProvider.java
new file mode 100644
index 0000000..6a6c289
--- /dev/null
+++ b/payment/src/test/java/com/ning/billing/payment/provider/MockPaymentProviderPluginProvider.java
@@ -0,0 +1,26 @@
+package com.ning.billing.payment.provider;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class MockPaymentProviderPluginProvider implements Provider<MockPaymentProviderPlugin> {
+    private PaymentProviderPluginRegistry registry;
+    private final String instanceName;
+
+    public MockPaymentProviderPluginProvider(String instanceName) {
+        this.instanceName = instanceName;
+    }
+
+    @Inject
+    public void setPaymentProviderPluginRegistry(PaymentProviderPluginRegistry registry) {
+        this.registry = registry;
+    }
+
+    @Override
+    public MockPaymentProviderPlugin get() {
+        MockPaymentProviderPlugin plugin = new MockPaymentProviderPlugin();
+
+        registry.register(plugin, instanceName);
+        return plugin;
+    }
+}
diff --git a/payment/src/test/java/com/ning/billing/payment/setup/PaymentTestModule.java b/payment/src/test/java/com/ning/billing/payment/setup/PaymentTestModule.java
index 2aa3c61..16cfdbd 100644
--- a/payment/src/test/java/com/ning/billing/payment/setup/PaymentTestModule.java
+++ b/payment/src/test/java/com/ning/billing/payment/setup/PaymentTestModule.java
@@ -21,18 +21,18 @@ import org.apache.commons.collections.MapUtils;
 import com.google.common.collect.ImmutableMap;
 import com.ning.billing.account.api.IAccountUserApi;
 import com.ning.billing.account.api.MockAccountUserApi;
-import com.ning.billing.payment.provider.MockPaymentProviderPlugin;
+import com.ning.billing.payment.provider.MockPaymentProviderPluginModule;
 import com.ning.billing.util.eventbus.IEventBus;
 import com.ning.billing.util.eventbus.MemoryEventBus;
 
 public class PaymentTestModule extends PaymentModule {
     public PaymentTestModule() {
-        super(MapUtils.toProperties(ImmutableMap.of("killbill.payment.provider.defaultPlugin", "mock")));
+        super(MapUtils.toProperties(ImmutableMap.of("killbill.payment.provider.default", "my-mock")));
     }
 
     @Override
     protected void installPaymentProviderPlugins(PaymentConfig config) {
-        bind(MockPaymentProviderPlugin.class).asEagerSingleton();
+        install(new MockPaymentProviderPluginModule("my-mock"));
     }
 
     @Override
diff --git a/payment/src/test/java/com/ning/billing/payment/TestPaymentProvider.java b/payment/src/test/java/com/ning/billing/payment/TestPaymentProvider.java
index d728021..eb882a8 100644
--- a/payment/src/test/java/com/ning/billing/payment/TestPaymentProvider.java
+++ b/payment/src/test/java/com/ning/billing/payment/TestPaymentProvider.java
@@ -41,6 +41,7 @@ import com.ning.billing.account.api.IAccountUserApi;
 import com.ning.billing.catalog.api.Currency;
 import com.ning.billing.invoice.model.Invoice;
 import com.ning.billing.invoice.model.InvoiceItem;
+import com.ning.billing.payment.api.PaymentError;
 import com.ning.billing.payment.setup.PaymentTestModule;
 import com.ning.billing.util.eventbus.IEventBus;
 import com.ning.billing.util.eventbus.IEventBus.EventBusException;
diff --git a/payment/src/test/java/com/ning/billing/payment/util/TestSyncWaitOnEventBus.java b/payment/src/test/java/com/ning/billing/payment/util/TestSyncWaitOnEventBus.java
new file mode 100644
index 0000000..9fdf72c
--- /dev/null
+++ b/payment/src/test/java/com/ning/billing/payment/util/TestSyncWaitOnEventBus.java
@@ -0,0 +1,86 @@
+package com.ning.billing.payment.util;
+
+import static org.testng.Assert.assertEquals;
+
+import java.util.UUID;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import com.google.common.eventbus.Subscribe;
+import com.ning.billing.util.eventbus.IEventBus;
+import com.ning.billing.util.eventbus.MemoryEventBus;
+
+@Test
+public class TestSyncWaitOnEventBus {
+    private static final class TestEvent implements IEventBusRequestType<UUID> {
+        private final UUID id;
+        private final String msg;
+
+        public TestEvent(UUID id, String msg) {
+            this.id = id;
+            this.msg = msg;
+        }
+
+        @Override
+        public UUID getId() {
+            return id;
+        }
+
+        public String getMsg() {
+            return msg;
+        }
+    }
+
+    private static final class TestResponse implements IEventBusResponseType<UUID> {
+        private final UUID id;
+        private final String msg;
+
+        public TestResponse(UUID id, String msg) {
+            this.id = id;
+            this.msg = msg;
+        }
+
+        @Override
+        public UUID getRequestId() {
+            return id;
+        }
+
+        public String getMsg() {
+            return msg;
+        }
+    }
+
+    private IEventBus eventBus;
+
+    @BeforeMethod(alwaysRun = true)
+    public void setUp() throws Exception {
+        eventBus = new MemoryEventBus();
+        eventBus.start();
+        eventBus.register(new Object() {
+            @Subscribe
+            public void handleEvent(TestEvent event) throws Exception {
+                Thread.sleep(100);
+                eventBus.post(new TestResponse(event.getId(), event.getMsg()));
+            }
+        });
+    }
+
+    @AfterMethod(alwaysRun = true)
+    public void tearDown() {
+        eventBus.stop();
+    }
+
+    public void test() throws Exception {
+        final TestEvent event = new TestEvent(UUID.randomUUID(), "Hello World!");
+
+        Future<TestResponse> future = EventBusFuture.post(eventBus, event);
+        TestResponse response = future.get(1, TimeUnit.SECONDS);
+
+        assertEquals(response.getRequestId(), event.getId());
+        assertEquals(response.getMsg(), event.getMsg());
+    }
+}

pom.xml 8(+7 -1)

diff --git a/pom.xml b/pom.xml
index bd1fb22..d7aed1c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -131,9 +131,15 @@
                 <scope>provided</scope>
             </dependency>
             <dependency>
+                <groupId>com.google.inject.extensions</groupId>
+                <artifactId>guice-multibindings</artifactId>
+                <version>3.0</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
                 <groupId>com.mogwee</groupId>
                 <artifactId>mogwee-executors</artifactId>
-                <version>1.1.0</version>
+                <version>1.2.0</version>
             </dependency>
             <dependency>
                 <groupId>com.mysql</groupId>