@Test
public void throwIfSenderCannotCoverFees() throws Throwable {

    setUpWireMockForCall("invokescript", "invokescript_transfer_with_fixed_sysfee.json");
    setUpWireMockForCall("invokefunction", "invokefunction_balanceOf_1000000.json",
            "668e0c1f9d7b70a99dd9e06eadd4c784d641afbc",
            "balanceOf",
            "721e1376b75fe93889023d47832c160fcc5d4a06");
    Wallet w = Wallet.withAccounts(account1);
    TransactionBuilder b = new NeoToken(neow)
            .invokeFunction(NEP5_TRANSFER,
                    ContractParameter.hash160(account1.getScriptHash()),
                    ContractParameter.hash160(recipient),
                    ContractParameter.integer(5))
            .wallet(w)
            .validUntilBlock(2000000)
            .signers(Signer.calledByEntry(account1.getScriptHash()))
            .throwIfSenderCannotCoverFees(
                    () -> new IllegalStateException("test throwIfSenderCannotCoverFees"));
    exceptionRule.expect(IllegalStateException.class);
    exceptionRule.expectMessage("test throwIfSenderCannotCoverFees");
    b.buildTransaction();
}