@Test
public void testExpiredPaymentRequest() throws Exception {
MockPaymentSession paymentSession = new MockPaymentSession(newExpiredPaymentRequest());
assertTrue(paymentSession.isExpired());
tx.addInput(new TransactionInput(PARAMS, tx, outputToMe.getScriptBytes()));
ArrayList<Transaction> txns = new ArrayList<>();
txns.add(tx);
try {
paymentSession.sendPayment(txns, null, null);
} catch(PaymentProtocolException.Expired e) {
assertEquals(0, paymentSession.getPaymentLog().size());
assertEquals(e.getMessage(), "PaymentRequest is expired");
return;
}
fail("Expected exception due to expired PaymentRequest");
}