void run() throws TException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException, SignatureException { final TBase o = construct(); final long deviceToken = 99; final long notificationId = 999; notifier.put(deviceToken, new Notification(method, notificationId)); final PendingNotification pendingNotification = new PendingNotification(); pendingNotification.setId(notificationId); final ByteBuffer b = ByteBuffer.wrap(new TSerializer().serialize(o)); b.mark(); pendingNotification.setPayload(b); pendingNotificationDataStore.put(notificationId, pendingNotification); final LongId notificationLongId = new LongId(notificationId); final Future<T> future = new DefaultFutureResult<>(); call(notificationLongId, sign(notificationLongId, clientId), future); assertTrue(future.succeeded()); assertEquals(o, future.result()); }