HDDS-1559. Fix TestReplicationManager. Contributed by Bharat Viswanadham. (#856)
This commit is contained in:
parent
ec92ca6575
commit
b70d1be685
@ -96,10 +96,10 @@ public void setup() throws IOException, InterruptedException {
|
|||||||
containerPlacementPolicy = Mockito.mock(ContainerPlacementPolicy.class);
|
containerPlacementPolicy = Mockito.mock(ContainerPlacementPolicy.class);
|
||||||
|
|
||||||
Mockito.when(containerPlacementPolicy.chooseDatanodes(
|
Mockito.when(containerPlacementPolicy.chooseDatanodes(
|
||||||
Mockito.anyListOf(DatanodeDetails.class), null,
|
Mockito.anyListOf(DatanodeDetails.class),
|
||||||
Mockito.anyInt(), Mockito.anyLong()))
|
Mockito.anyListOf(DatanodeDetails.class), Mockito.anyInt(),
|
||||||
.thenAnswer(invocation -> {
|
Mockito.anyLong())).thenAnswer(invocation -> {
|
||||||
int count = (int) invocation.getArguments()[1];
|
int count = (int) invocation.getArguments()[2];
|
||||||
return IntStream.range(0, count)
|
return IntStream.range(0, count)
|
||||||
.mapToObj(i -> randomDatanodeDetails())
|
.mapToObj(i -> randomDatanodeDetails())
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
Loading…
Reference in New Issue
Block a user