import static org.mockito.Mockito.when;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.openflowplugin.api.openflow.device.Xid;
final MultipartReply reply = new MultipartReplyBuilder()
.setMultipartReplyBody(new MultipartReplyFlowStatsBuilder()
- .setFlowAndStatisticsMapList(Collections.singletonList(flowStat))
+ .setFlowAndStatisticsMapList(List.of(flowStat))
.build())
.build();
final MultipartReply reply1 = new MultipartReplyBuilder()
.setMultipartReplyBody(new MultipartReplyFlowStatsBuilder()
- .setFlowAndStatisticsMapList(Collections.singletonList(flowStat1))
+ .setFlowAndStatisticsMapList(List.of(flowStat1))
.build())
.build();
final List<MultipartReply> input = new ArrayList<>();
when(stat.getTableId()).thenReturn(TABLE_NO);
when(stat.getMatch()).thenReturn(new MatchBuilder().build());
- final List<FlowAndStatisticsMapList> stats
- = Collections.singletonList(stat);
+ final List<FlowAndStatisticsMapList> stats = List.of(stat);
final GetFlowStatisticsOutput output = mock(GetFlowStatisticsOutput.class);
when(output.nonnullFlowAndStatisticsMapList()).thenReturn(stats);
- multipartWriterProvider.lookup(MultipartType.OFPMPFLOW).get().write(output, true);
+ multipartWriterProvider.lookup(MultipartType.OFPMPFLOW).orElseThrow().write(output, true);
verify(deviceContext).writeToTransactionWithParentsSlow(eq(LogicalDatastoreType.OPERATIONAL), any(), any());
}
}