fix java9 compilation

This commit is contained in:
Boaz Leskes 2017-12-01 15:12:51 +01:00
parent 99db391344
commit c203cff692
1 changed files with 4 additions and 2 deletions

View File

@ -211,8 +211,10 @@ public class RecoverySourceHandlerTests extends ESTestCase {
assertThat(result.totalOperations, equalTo(expectedOps)); assertThat(result.totalOperations, equalTo(expectedOps));
final ArgumentCaptor<List> shippedOpsCaptor = ArgumentCaptor.forClass(List.class); final ArgumentCaptor<List> shippedOpsCaptor = ArgumentCaptor.forClass(List.class);
verify(recoveryTarget).indexTranslogOperations(shippedOpsCaptor.capture(), ArgumentCaptor.forClass(Integer.class).capture()); verify(recoveryTarget).indexTranslogOperations(shippedOpsCaptor.capture(), ArgumentCaptor.forClass(Integer.class).capture());
List<Translog.Operation> shippedOps = shippedOpsCaptor.getAllValues().stream() List<Translog.Operation> shippedOps = new ArrayList<>();
.flatMap(List::stream).map(o -> (Translog.Operation) o).collect(Collectors.toList()); for (List list: shippedOpsCaptor.getAllValues()) {
shippedOps.addAll(list);
}
shippedOps.sort(Comparator.comparing(Translog.Operation::seqNo)); shippedOps.sort(Comparator.comparing(Translog.Operation::seqNo));
assertThat(shippedOps.size(), equalTo(expectedOps)); assertThat(shippedOps.size(), equalTo(expectedOps));
for (int i = 0; i < shippedOps.size(); i++) { for (int i = 0; i < shippedOps.size(); i++) {