use of io.nem.symbol.sdk.openapi.okhttp_gson.model.AnnounceTransactionInfoDTO in project nem2-sdk-java by nemtech.
the class TransactionRepositoryOkHttpImplTest method shouldAnnounceAggregateBonded.
@Test
public void shouldAnnounceAggregateBonded() throws Exception {
SignedTransaction signedTransaction = getSignedTransaction();
AnnounceTransactionInfoDTO announceTransactionInfoDTO = new AnnounceTransactionInfoDTO();
announceTransactionInfoDTO.setMessage("SomeMessage");
mockRemoteCall(announceTransactionInfoDTO);
TransactionAnnounceResponse response = repository.announceAggregateBonded(signedTransaction).toFuture().get();
Assertions.assertNotNull(response);
Assertions.assertEquals(announceTransactionInfoDTO.getMessage(), announceTransactionInfoDTO.getMessage());
}
use of io.nem.symbol.sdk.openapi.okhttp_gson.model.AnnounceTransactionInfoDTO in project nem2-sdk-java by nemtech.
the class TransactionRepositoryOkHttpImplTest method shouldAnnounce.
@Test
public void shouldAnnounce() throws Exception {
SignedTransaction signedTransaction = getSignedTransaction();
AnnounceTransactionInfoDTO announceTransactionInfoDTO = new AnnounceTransactionInfoDTO();
announceTransactionInfoDTO.setMessage("SomeMessage");
mockRemoteCall(announceTransactionInfoDTO);
TransactionAnnounceResponse response = repository.announce(signedTransaction).toFuture().get();
Assertions.assertNotNull(response);
Assertions.assertEquals(announceTransactionInfoDTO.getMessage(), announceTransactionInfoDTO.getMessage());
}
use of io.nem.symbol.sdk.openapi.okhttp_gson.model.AnnounceTransactionInfoDTO in project nem2-sdk-java by nemtech.
the class TransactionRepositoryOkHttpImplTest method announceAggregateBondedCosignature.
@Test
public void announceAggregateBondedCosignature() throws Exception {
Account signer = Account.generateNewAccount(networkType);
BigInteger version = AggregateTransactionCosignature.DEFAULT_VERSION;
CosignatureSignedTransaction signedTransaction = new CosignatureSignedTransaction(version, "aParentHash", "aSignature", signer.getPublicAccount());
AnnounceTransactionInfoDTO announceTransactionInfoDTO = new AnnounceTransactionInfoDTO();
announceTransactionInfoDTO.setMessage("SomeMessage");
ArgumentCaptor<Object> parameter = mockRemoteCall(announceTransactionInfoDTO);
TransactionAnnounceResponse response = repository.announceAggregateBondedCosignature(signedTransaction).toFuture().get();
Assertions.assertNotNull(response);
Assertions.assertEquals(announceTransactionInfoDTO.getMessage(), announceTransactionInfoDTO.getMessage());
Cosignature cosignature = (Cosignature) parameter.getValue();
Assertions.assertEquals(signedTransaction.getParentHash(), cosignature.getParentHash());
Assertions.assertEquals(signedTransaction.getSignature(), cosignature.getSignature());
Assertions.assertEquals(signedTransaction.getSigner().getPublicKey().toHex(), cosignature.getSignerPublicKey());
}
Aggregations