@Test
public void recursiveDependencyDownloadDisabled() throws Exception {

    peer.setDownloadTxDependencies(false);
    connect();
    // Check that if we request dependency download to be disabled and receive a relevant tx, things work correctly.
    Transaction tx = FakeTxBuilder.createFakeTx(PARAMS, COIN, address);
    final Transaction[] result = new Transaction[1];
    wallet.addCoinsReceivedEventListener(new WalletCoinsReceivedEventListener() {
        @Override
        public void onCoinsReceived(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) {
            result[0] = tx;
        }
    });
    inbound(writeTarget, tx);
    pingAndWait(writeTarget);
    assertEquals(tx, result[0]);
}