HDDS-1559. Fix TestReplicationManager. Contributed by Bharat Viswanadham. (#856)

This commit is contained in:
Bharat Viswanadham 2019-05-27 17:52:09 -07:00 committed by Xiaoyu Yao
parent ec92ca6575
commit b70d1be685
1 changed files with 4 additions and 4 deletions

View File

@ -96,10 +96,10 @@ public class TestReplicationManager {
containerPlacementPolicy = Mockito.mock(ContainerPlacementPolicy.class);
Mockito.when(containerPlacementPolicy.chooseDatanodes(
Mockito.anyListOf(DatanodeDetails.class), null,
Mockito.anyInt(), Mockito.anyLong()))
.thenAnswer(invocation -> {
int count = (int) invocation.getArguments()[1];
Mockito.anyListOf(DatanodeDetails.class),
Mockito.anyListOf(DatanodeDetails.class), Mockito.anyInt(),
Mockito.anyLong())).thenAnswer(invocation -> {
int count = (int) invocation.getArguments()[2];
return IntStream.range(0, count)
.mapToObj(i -> randomDatanodeDetails())
.collect(Collectors.toList());