|
|
@ -158,22 +158,22 @@ public class GetReceiptsFromPeerTaskTest { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testIsPartialSuccessForPartialSuccess() { |
|
|
|
public void testIsSuccessForPartialSuccess() { |
|
|
|
GetReceiptsFromPeerTask task = |
|
|
|
GetReceiptsFromPeerTask task = |
|
|
|
new GetReceiptsFromPeerTask(Collections.emptyList(), null, () -> null); |
|
|
|
new GetReceiptsFromPeerTask(Collections.emptyList(), null, () -> null); |
|
|
|
|
|
|
|
|
|
|
|
Assertions.assertTrue(task.isPartialSuccess(Collections.emptyMap())); |
|
|
|
Assertions.assertFalse(task.isSuccess(Collections.emptyMap())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void testIsPartialSuccessForFullSuccess() { |
|
|
|
public void testIsSuccessForFullSuccess() { |
|
|
|
GetReceiptsFromPeerTask task = |
|
|
|
GetReceiptsFromPeerTask task = |
|
|
|
new GetReceiptsFromPeerTask(Collections.emptyList(), null, () -> null); |
|
|
|
new GetReceiptsFromPeerTask(Collections.emptyList(), null, () -> null); |
|
|
|
|
|
|
|
|
|
|
|
Map<BlockHeader, List<TransactionReceipt>> map = new HashMap<>(); |
|
|
|
Map<BlockHeader, List<TransactionReceipt>> map = new HashMap<>(); |
|
|
|
map.put(mockBlockHeader(1), null); |
|
|
|
map.put(mockBlockHeader(1), null); |
|
|
|
|
|
|
|
|
|
|
|
Assertions.assertFalse(task.isPartialSuccess(map)); |
|
|
|
Assertions.assertTrue(task.isSuccess(map)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private BlockHeader mockBlockHeader(final long blockNumber) { |
|
|
|
private BlockHeader mockBlockHeader(final long blockNumber) { |
|
|
|