Search in sources :

Example 1 with MirrorTokenTransfer

use of com.hedera.mirror.test.e2e.acceptance.props.MirrorTokenTransfer in project hedera-mirror-node by hashgraph.

the class TokenFeature method verifyTokenTransfers.

private void verifyTokenTransfers(TokenId tokenId) {
    String transactionId = networkTransactionResponse.getTransactionIdStringNoCheckSum();
    MirrorTransactionsResponse mirrorTransactionsResponse = mirrorClient.getTransactions(transactionId);
    List<MirrorTransaction> transactions = mirrorTransactionsResponse.getTransactions();
    assertNotNull(transactions);
    assertThat(transactions).isNotEmpty();
    MirrorTransaction mirrorTransaction = transactions.get(0);
    assertThat(mirrorTransaction.getTransactionId()).isEqualTo(transactionId);
    assertThat(mirrorTransaction.getValidStartTimestamp()).isEqualTo(networkTransactionResponse.getValidStartString());
    assertThat(mirrorTransaction.getName()).isEqualTo("CRYPTOTRANSFER");
    boolean tokenIdFound = false;
    String tokenIdString = tokenId.toString();
    for (MirrorTokenTransfer tokenTransfer : mirrorTransaction.getTokenTransfers()) {
        if (tokenTransfer.getTokenId().equalsIgnoreCase(tokenIdString)) {
            tokenIdFound = true;
            break;
        }
    }
    assertTrue(tokenIdFound);
}
Also used : MirrorTokenTransfer(com.hedera.mirror.test.e2e.acceptance.props.MirrorTokenTransfer) MirrorTransaction(com.hedera.mirror.test.e2e.acceptance.props.MirrorTransaction) MirrorTransactionsResponse(com.hedera.mirror.test.e2e.acceptance.response.MirrorTransactionsResponse)

Aggregations

MirrorTokenTransfer (com.hedera.mirror.test.e2e.acceptance.props.MirrorTokenTransfer)1 MirrorTransaction (com.hedera.mirror.test.e2e.acceptance.props.MirrorTransaction)1 MirrorTransactionsResponse (com.hedera.mirror.test.e2e.acceptance.response.MirrorTransactionsResponse)1