use of io.nem.symbol.sdk.model.receipt.ReceiptSource in project nem2-sdk-java by nemtech.
the class TransactionServiceTest method simulateStatement.
private void simulateStatement(BigInteger height, int primaryId, int secondaryId) {
Map<NamespaceId, Address> addressMap = new HashMap<>();
addressMap.put(addressNamespace1, address1);
addressMap.put(addressNamespace2, address2);
addressMap.put(addressNamespace3, address3);
Map<NamespaceId, MosaicId> mosaicMap = new HashMap<>();
mosaicMap.put(mosaicNamespace1, mosaicId1);
mosaicMap.put(mosaicNamespace2, mosaicId2);
mosaicMap.put(mosaicNamespace3, mosaicId3);
List<AddressResolutionStatement> addressResolutionStatements = addressMap.entrySet().stream().map(e -> new AddressResolutionStatement("abc", height, e.getKey(), Collections.singletonList(ResolutionEntry.forAddress(e.getValue(), new ReceiptSource(primaryId, secondaryId))))).collect(Collectors.toList());
List<MosaicResolutionStatement> mosaicResolutionStatements = mosaicMap.entrySet().stream().map(e -> new MosaicResolutionStatement("abc", height, e.getKey(), Collections.singletonList(ResolutionEntry.forMosaicId(e.getValue(), new ReceiptSource(primaryId, secondaryId))))).collect(Collectors.toList());
Mockito.when(receiptRepositoryMock.searchAddressResolutionStatements(Mockito.eq(new ResolutionStatementSearchCriteria().height(height)))).thenReturn(Observable.just(new Page<>(addressResolutionStatements)));
Mockito.when(receiptRepositoryMock.searchMosaicResolutionStatements(Mockito.eq(new ResolutionStatementSearchCriteria().height(height)))).thenReturn(Observable.just(new Page<>(mosaicResolutionStatements)));
}
Aggregations