From abe81ff45adccd1d4cd3e0c2958dc3c850349637 Mon Sep 17 00:00:00 2001 From: Pavel Zbitskiy Date: Fri, 3 Jan 2025 14:53:00 -0500 Subject: [PATCH] add indexer test --- .../com/algorand/algosdk/unit/IndexerResponses.java | 10 ++++++++++ src/test/unit.tags | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/test/java/com/algorand/algosdk/unit/IndexerResponses.java b/src/test/java/com/algorand/algosdk/unit/IndexerResponses.java index e50175a50..d860c08cd 100644 --- a/src/test/java/com/algorand/algosdk/unit/IndexerResponses.java +++ b/src/test/java/com/algorand/algosdk/unit/IndexerResponses.java @@ -1,6 +1,7 @@ package com.algorand.algosdk.unit; import static com.algorand.algosdk.unit.utils.TestingUtils.verifyResponse; +import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; import java.math.BigInteger; @@ -188,4 +189,13 @@ public void the_parsed_SearchAccounts_response_should_be_valid_on_round_and_the_ public void the_parsed_SearchForTransactions_response_should_be_valid_on_round_and_the_array_should_be_of_len_and_the_element_at_index_should_have_rekey_to(Integer int1, Integer int2, Integer int3, String string) throws IOException { verifyResponse(transactionsResponse, shared.bodyFile); } + + @When("the parsed SearchForTransactions response should be valid on round {int} and the array should be of len {int} and the element at index {int} should have hbaddress {string}") + public void the_parsed_SearchForTransactions_response_should_be_valid_on_round_and_the_array_should_be_of_len_and_the_element_at_index_should_have_hbaddress(Integer round, Integer length, Integer index, String hbaddress) throws IOException { + verifyResponse(transactionsResponse, shared.bodyFile); + + assertThat(transactionsResponse.body().currentRound).isEqualTo(round.longValue()); + assertThat(transactionsResponse.body().transactions.size()).isEqualTo(length.intValue()); + assertThat(transactionsResponse.body().transactions.get(index).heartbeatTransaction.hbAddress).isEqualTo(hbaddress); + } } diff --git a/src/test/unit.tags b/src/test/unit.tags index 8d8ea38d0..5a56f4ae1 100644 --- a/src/test/unit.tags +++ b/src/test/unit.tags @@ -14,6 +14,7 @@ @unit.indexer.ledger_refactoring @unit.indexer.logs @unit.indexer.rekey +@unit.indexer.heartbeat @unit.offline @unit.program_sanity_check @unit.ready @@ -35,6 +36,8 @@ @unit.stateproof.paths @unit.stateproof.responses @unit.stateproof.responses.msgp +@unit.heartbeat.responses +@unit.heartbeat.responses.msgp @unit.sync @unit.tealsign @unit.timestamp