* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.impl.util;
import com.google.common.collect.Lists;
-import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
+import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import org.opendaylight.openflowplugin.impl.services.batch.BatchPlanStep;
import org.opendaylight.openflowplugin.impl.services.batch.BatchStepType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.ProcessFlatBatchOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.ProcessFlatBatchOutputBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.failure.ids.aug.FlatBatchFailureFlowIdCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.flow.crud._case.aug.FlatBatchAddFlowCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.flow.crud._case.aug.FlatBatchRemoveFlowCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.flow.crud._case.aug.FlatBatchUpdateFlowCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.flow.crud._case.aug.flat.batch.add.flow._case.FlatBatchAddFlow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.flow.crud._case.aug.flat.batch.add.flow._case.FlatBatchAddFlowBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.flow.crud._case.aug.flat.batch.add.flow._case.FlatBatchAddFlowKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.flow.crud._case.aug.flat.batch.remove.flow._case.FlatBatchRemoveFlow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.flow.crud._case.aug.flat.batch.remove.flow._case.FlatBatchRemoveFlowBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.flow.crud._case.aug.flat.batch.remove.flow._case.FlatBatchRemoveFlowKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.flow.crud._case.aug.flat.batch.update.flow._case.FlatBatchUpdateFlow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.flow.crud._case.aug.flat.batch.update.flow._case.FlatBatchUpdateFlowBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.flow.crud._case.aug.flat.batch.update.flow._case.FlatBatchUpdateFlowKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.group.crud._case.aug.FlatBatchAddGroupCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.group.crud._case.aug.FlatBatchRemoveGroupCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.group.crud._case.aug.FlatBatchUpdateGroupCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.group.crud._case.aug.flat.batch.add.group._case.FlatBatchAddGroup;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.group.crud._case.aug.flat.batch.add.group._case.FlatBatchAddGroupBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.group.crud._case.aug.flat.batch.add.group._case.FlatBatchAddGroupKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.group.crud._case.aug.flat.batch.remove.group._case.FlatBatchRemoveGroup;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.group.crud._case.aug.flat.batch.remove.group._case.FlatBatchRemoveGroupBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.group.crud._case.aug.flat.batch.remove.group._case.FlatBatchRemoveGroupKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.group.crud._case.aug.flat.batch.update.group._case.FlatBatchUpdateGroup;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.group.crud._case.aug.flat.batch.update.group._case.FlatBatchUpdateGroupBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.group.crud._case.aug.flat.batch.update.group._case.FlatBatchUpdateGroupKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.meter.crud._case.aug.FlatBatchAddMeterCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.meter.crud._case.aug.FlatBatchRemoveMeterCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.meter.crud._case.aug.FlatBatchUpdateMeterCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.meter.crud._case.aug.flat.batch.add.meter._case.FlatBatchAddMeter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.meter.crud._case.aug.flat.batch.add.meter._case.FlatBatchAddMeterBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.meter.crud._case.aug.flat.batch.add.meter._case.FlatBatchAddMeterKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.meter.crud._case.aug.flat.batch.remove.meter._case.FlatBatchRemoveMeter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.meter.crud._case.aug.flat.batch.remove.meter._case.FlatBatchRemoveMeterBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.meter.crud._case.aug.flat.batch.remove.meter._case.FlatBatchRemoveMeterKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.meter.crud._case.aug.flat.batch.update.meter._case.FlatBatchUpdateMeter;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.meter.crud._case.aug.flat.batch.update.meter._case.FlatBatchUpdateMeterBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.flat.batch.meter.crud._case.aug.flat.batch.update.meter._case.FlatBatchUpdateMeterKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.Batch;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.BatchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.BatchChoice;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.FlatBatchAddFlowCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.FlatBatchAddGroupCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.FlatBatchAddMeterCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.FlatBatchRemoveFlowCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.FlatBatchRemoveGroupCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.FlatBatchRemoveMeterCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.FlatBatchUpdateFlowCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.FlatBatchUpdateGroupCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.FlatBatchUpdateMeterCaseBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.add.flow._case.FlatBatchAddFlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.add.group._case.FlatBatchAddGroupBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.add.meter._case.FlatBatchAddMeterBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.remove.flow._case.FlatBatchRemoveFlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.remove.group._case.FlatBatchRemoveGroupBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.remove.meter._case.FlatBatchRemoveMeterBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.update.flow._case.FlatBatchUpdateFlowBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.update.group._case.FlatBatchUpdateGroupBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.input.batch.batch.choice.flat.batch.update.meter._case.FlatBatchUpdateMeterBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.output.BatchFailure;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.output.BatchFailureBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.output.batch.failure.batch.item.id.choice.FlatBatchFailureFlowIdCaseBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flat.batch.service.rev160321.process.flat.batch.output.BatchFailureKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
-import org.opendaylight.yangtools.yang.common.RpcError;
+import org.opendaylight.yangtools.yang.binding.util.BindingMap;
+import org.opendaylight.yangtools.yang.common.ErrorType;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
checkBarriersBetween(BatchStepType.FLOW_UPDATE, BatchStepType.METER_REMOVE);
}
- private void checkBarriersBetween(final BatchStepType typeOfFirst, final BatchStepType typeOfSecond) {
+ private static void checkBarriersBetween(final BatchStepType typeOfFirst, final BatchStepType typeOfSecond) {
final List<Batch> batches = Lists.newArrayList(createBatch(typeOfFirst), createBatch(typeOfSecond));
final List<BatchPlanStep> batchPlan = FlatBatchUtil.assembleBatchPlan(batches);
FlatBatchUtil.markBarriersWhereNeeded(batchPlan);
@Test
public void testMarkBarriersWhereNeeded_single() {
- final List<Batch> batches = Lists.newArrayList(
+ final List<Batch> batches = List.of(
//general part - no flush required
createBatch(BatchStepType.GROUP_REMOVE)
);
checkSegment(batchPlanSteps.get(index++), BatchStepType.GROUP_UPDATE, 3);
}
- private void checkSegment(final BatchPlanStep planStep, final BatchStepType stepType, final int expected) {
+ private static void checkSegment(final BatchPlanStep planStep, final BatchStepType stepType, final int expected) {
Assert.assertEquals(stepType, planStep.getStepType());
Assert.assertEquals(expected, planStep.getTaskBag().size());
}
}
}
- private Batch createBatch(BatchStepType type) {
+ private static Batch createBatch(final BatchStepType type) {
return createBatch(type, 1);
}
- private Batch createBatch(BatchStepType type, final int size) {
+ private static Batch createBatch(final BatchStepType type, final int size) {
final BatchChoice batchCase;
switch (type) {
case FLOW_ADD:
batchCase = new FlatBatchAddFlowCaseBuilder()
- .setFlatBatchAddFlow(repeatIntoList(new FlatBatchAddFlowBuilder().build(), size))
+ .setFlatBatchAddFlow(repeatFlatBatchAddFlowIntoList(size))
.build();
break;
case FLOW_REMOVE:
batchCase = new FlatBatchRemoveFlowCaseBuilder()
- .setFlatBatchRemoveFlow(repeatIntoList(new FlatBatchRemoveFlowBuilder().build(), size))
+ .setFlatBatchRemoveFlow(repeatFlatBatchRemoveFlowIntoList(size))
.build();
break;
case FLOW_UPDATE:
batchCase = new FlatBatchUpdateFlowCaseBuilder()
- .setFlatBatchUpdateFlow(repeatIntoList(new FlatBatchUpdateFlowBuilder().build(), size))
+ .setFlatBatchUpdateFlow(repeatFlatBatchUpdateFlowIntoList(size))
.build();
break;
case GROUP_ADD:
batchCase = new FlatBatchAddGroupCaseBuilder()
- .setFlatBatchAddGroup(repeatIntoList(new FlatBatchAddGroupBuilder().build(), size))
+ .setFlatBatchAddGroup(repeatFlatBatchAddGroupIntoList(size))
.build();
break;
case GROUP_REMOVE:
batchCase = new FlatBatchRemoveGroupCaseBuilder()
- .setFlatBatchRemoveGroup(repeatIntoList(new FlatBatchRemoveGroupBuilder().build(), size))
+ .setFlatBatchRemoveGroup(repeatFlatBatchRemoveGroupIntoList(size))
.build();
break;
case GROUP_UPDATE:
batchCase = new FlatBatchUpdateGroupCaseBuilder()
- .setFlatBatchUpdateGroup(repeatIntoList(new FlatBatchUpdateGroupBuilder().build(), size))
+ .setFlatBatchUpdateGroup(repeatFlatBatchUpdateGroupIntoList(size))
.build();
break;
case METER_ADD:
batchCase = new FlatBatchAddMeterCaseBuilder()
- .setFlatBatchAddMeter(repeatIntoList(new FlatBatchAddMeterBuilder().build(), size))
+ .setFlatBatchAddMeter(repeatFlatBatchAddMeterIntoList(size))
.build();
break;
case METER_REMOVE:
batchCase = new FlatBatchRemoveMeterCaseBuilder()
- .setFlatBatchRemoveMeter(repeatIntoList(new FlatBatchRemoveMeterBuilder().build(), size))
+ .setFlatBatchRemoveMeter(repeatFlatBatchRemoveMeterIntoList(size))
.build();
break;
case METER_UPDATE:
batchCase = new FlatBatchUpdateMeterCaseBuilder()
- .setFlatBatchUpdateMeter(repeatIntoList(new FlatBatchUpdateMeterBuilder().build(), size))
+ .setFlatBatchUpdateMeter(repeatFlatBatchUpdateMeterIntoList(size))
.build();
break;
default:
}
return new BatchBuilder()
+ .setBatchOrder(Uint16.ZERO)
.setBatchChoice(batchCase)
.build();
}
- private <T> List<T> repeatIntoList(final T element, final int size) {
- final List<T> list = new ArrayList<>();
+ private static Map<FlatBatchAddGroupKey, FlatBatchAddGroup> repeatFlatBatchAddGroupIntoList(final int size) {
+ final var list = BindingMap.<FlatBatchAddGroupKey, FlatBatchAddGroup>orderedBuilder(size);
+ for (int i = 0; i < size; i++) {
+ list.add(new FlatBatchAddGroupBuilder().withKey(new FlatBatchAddGroupKey(Uint16.valueOf(i))).build());
+ }
+ return list.build();
+ }
+
+ private static Map<FlatBatchUpdateGroupKey, FlatBatchUpdateGroup> repeatFlatBatchUpdateGroupIntoList(
+ final int size) {
+ final var list = BindingMap.<FlatBatchUpdateGroupKey, FlatBatchUpdateGroup>orderedBuilder(size);
+ for (int i = 0; i < size; i++) {
+ list.add(new FlatBatchUpdateGroupBuilder().withKey(new FlatBatchUpdateGroupKey(Uint16.valueOf(i))).build());
+ }
+ return list.build();
+ }
+
+ private static Map<FlatBatchRemoveGroupKey, FlatBatchRemoveGroup> repeatFlatBatchRemoveGroupIntoList(
+ final int size) {
+ final var list = BindingMap.<FlatBatchRemoveGroupKey, FlatBatchRemoveGroup>orderedBuilder(size);
+ for (int i = 0; i < size; i++) {
+ list.add(new FlatBatchRemoveGroupBuilder().withKey(new FlatBatchRemoveGroupKey(Uint16.valueOf(i))).build());
+ }
+ return list.build();
+ }
+
+ private static Map<FlatBatchAddFlowKey, FlatBatchAddFlow> repeatFlatBatchAddFlowIntoList(final int size) {
+ final var list = BindingMap.<FlatBatchAddFlowKey, FlatBatchAddFlow>orderedBuilder(size);
+ for (int i = 0; i < size; i++) {
+ list.add(new FlatBatchAddFlowBuilder().withKey(new FlatBatchAddFlowKey(Uint16.valueOf(i))).build());
+ }
+ return list.build();
+ }
+
+ private static Map<FlatBatchUpdateFlowKey, FlatBatchUpdateFlow> repeatFlatBatchUpdateFlowIntoList(final int size) {
+ final var list = BindingMap.<FlatBatchUpdateFlowKey, FlatBatchUpdateFlow>orderedBuilder(size);
+ for (int i = 0; i < size; i++) {
+ list.add(new FlatBatchUpdateFlowBuilder().withKey(new FlatBatchUpdateFlowKey(Uint16.valueOf(i))).build());
+ }
+ return list.build();
+ }
+
+ private static Map<FlatBatchRemoveFlowKey, FlatBatchRemoveFlow> repeatFlatBatchRemoveFlowIntoList(final int size) {
+ final var list = BindingMap.<FlatBatchRemoveFlowKey, FlatBatchRemoveFlow>orderedBuilder(size);
+ for (int i = 0; i < size; i++) {
+ list.add(new FlatBatchRemoveFlowBuilder().withKey(new FlatBatchRemoveFlowKey(Uint16.valueOf(i))).build());
+ }
+ return list.build();
+ }
+
+ private static Map<FlatBatchAddMeterKey, FlatBatchAddMeter> repeatFlatBatchAddMeterIntoList(final int size) {
+ final var list = BindingMap.<FlatBatchAddMeterKey, FlatBatchAddMeter>orderedBuilder(size);
+ for (int i = 0; i < size; i++) {
+ list.add(new FlatBatchAddMeterBuilder().withKey(new FlatBatchAddMeterKey(Uint16.valueOf(i))).build());
+ }
+ return list.build();
+ }
+
+ private static Map<FlatBatchUpdateMeterKey, FlatBatchUpdateMeter> repeatFlatBatchUpdateMeterIntoList(
+ final int size) {
+ final var list = BindingMap.<FlatBatchUpdateMeterKey, FlatBatchUpdateMeter>orderedBuilder(size);
for (int i = 0; i < size; i++) {
- list.add(element);
+ list.add(new FlatBatchUpdateMeterBuilder().withKey(new FlatBatchUpdateMeterKey(Uint16.valueOf(i))).build());
}
- return list;
+ return list.build();
+ }
+
+ private static Map<FlatBatchRemoveMeterKey, FlatBatchRemoveMeter> repeatFlatBatchRemoveMeterIntoList(
+ final int size) {
+ final var list = BindingMap.<FlatBatchRemoveMeterKey, FlatBatchRemoveMeter>orderedBuilder(size);
+ for (int i = 0; i < size; i++) {
+ list.add(new FlatBatchRemoveMeterBuilder().withKey(new FlatBatchRemoveMeterKey(Uint16.valueOf(i))).build());
+ }
+ return list.build();
}
@Test
public void testMergeJobsResultsFutures() {
final BatchFailure batchFailure = new BatchFailureBuilder()
- .setBatchOrder(9)
+ .setBatchOrder(Uint16.valueOf(9))
+ .setBatchItemIdChoice(new FlatBatchFailureFlowIdCaseBuilder()
+ .setFlowId(new FlowId("11"))
+ .build())
+ .withKey(new BatchFailureKey(Uint16.ZERO))
+ .build();
+ final BatchFailure batchFailure_1 = new BatchFailureBuilder()
+ .setBatchOrder(Uint16.valueOf(9))
.setBatchItemIdChoice(new FlatBatchFailureFlowIdCaseBuilder()
.setFlowId(new FlowId("11"))
.build())
+ .withKey(new BatchFailureKey(Uint16.ONE))
.build();
final ProcessFlatBatchOutput output
- = new ProcessFlatBatchOutputBuilder().setBatchFailure(Lists.newArrayList(batchFailure)).build();
+ = new ProcessFlatBatchOutputBuilder().setBatchFailure(BindingMap.of(batchFailure)).build();
+
+ final ProcessFlatBatchOutput output_1
+ = new ProcessFlatBatchOutputBuilder().setBatchFailure(BindingMap.of(batchFailure_1)).build();
final RpcResult<ProcessFlatBatchOutput> rpcResultFailed = RpcResultBuilder.<ProcessFlatBatchOutput>failed()
- .withError(RpcError.ErrorType.APPLICATION, "ut-rpcError")
+ .withError(ErrorType.APPLICATION, "ut-rpcError")
.withResult(output).build();
+
+ final RpcResult<ProcessFlatBatchOutput> rpcResultFailed_1 = RpcResultBuilder.<ProcessFlatBatchOutput>failed()
+ .withError(ErrorType.APPLICATION, "ut-rpcError")
+ .withResult(output_1).build();
final RpcResult<ProcessFlatBatchOutput> rpcResultSuccess = RpcResultBuilder.<ProcessFlatBatchOutput>success()
- .withResult(new ProcessFlatBatchOutputBuilder().setBatchFailure(new ArrayList<>())).build();
+ .withResult(new ProcessFlatBatchOutputBuilder().setBatchFailure(Map.of()).build()).build();
final RpcResult<ProcessFlatBatchOutput> rpcResult1
= FlatBatchUtil.mergeRpcResults().apply(Lists.newArrayList(rpcResultFailed, rpcResultSuccess));
Assert.assertFalse(rpcResult1.isSuccessful());
final RpcResult<ProcessFlatBatchOutput> rpcResult2
- = FlatBatchUtil.mergeRpcResults().apply(Lists.newArrayList(rpcResultFailed, rpcResultFailed));
+ = FlatBatchUtil.mergeRpcResults().apply(Lists.newArrayList(rpcResultFailed, rpcResultFailed_1));
Assert.assertEquals(2, rpcResult2.getErrors().size());
Assert.assertFalse(rpcResult2.isSuccessful());