Skip to content

Commit

Permalink
add indexer test
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandskiy committed Jan 3, 2025
1 parent 93b2ee2 commit abe81ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/java/com/algorand/algosdk/unit/IndexerResponses.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
}
}
3 changes: 3 additions & 0 deletions src/test/unit.tags
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit abe81ff

Please sign in to comment.