use of io.nem.symbol.sdk.model.account.AccountInfo in project nem2-sdk-java by nemtech.
the class StateProofServiceTest method account.
@Test
void account() throws Exception {
AccountRepository repository = mock(AccountRepository.class);
when(factory.createAccountRepository()).thenReturn(repository);
Address id = Address.generateRandom(NetworkType.MIJIN_TEST);
AccountInfo state = Mockito.mock(AccountInfo.class);
when(state.getAddress()).thenReturn(id);
when(state.serialize()).thenReturn(ConvertUtils.fromHexToBytes(serialized));
when(repository.getAccountInfo(eq(id))).thenReturn(Observable.just(state));
when(repository.getAccountInfoMerkle(eq(id))).thenReturn(Observable.just(tree));
StateMerkleProof<AccountInfo> proof = service.account(id).toFuture().get();
Assertions.assertTrue(proof.isValid());
Assertions.assertEquals(state, proof.getState());
}
Aggregations