extends DefaultPromise {
+ private static class MockPushNotificationFuture extends PushNotificationFuture {
- private final P pushNotification;
-
- MockPushNotificationFuture(final EventExecutor eventExecutor, final P pushNotification) {
- super(eventExecutor);
- this.pushNotification = pushNotification;
+ MockPushNotificationFuture(final P pushNotification, final V response) {
+ super(pushNotification);
+ complete(response);
}
- MockPushNotificationFuture(final EventExecutor eventExecutor, final P pushNotification, final V response) {
- super(eventExecutor);
- this.pushNotification = pushNotification;
- setSuccess(response);
- }
-
- MockPushNotificationFuture(final EventExecutor eventExecutor, final P pushNotification, final Exception exception) {
- super(eventExecutor);
- this.pushNotification = pushNotification;
- setFailure(exception);
- }
-
-
- @Override
- public P getPushNotification() {
- return pushNotification;
+ MockPushNotificationFuture(final P pushNotification, final Exception exception) {
+ super(pushNotification);
+ completeExceptionally(exception);
}
}