X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=openflowplugin-impl%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fopenflowplugin%2Fimpl%2Futil%2FMeterUtilTest.java;h=2008329b5fe7628899b7f76398f15b84d7f2648c;hb=777c94332871b8c34f56f7f2010de1536cb759ba;hp=04f58c05ac51d823d74ca8226d0af6de7f75cf4d;hpb=e2a2a5cb2bf24107ea8fcac048567cece947c371;p=openflowplugin.git diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/MeterUtilTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/MeterUtilTest.java index 04f58c05ac..2008329b5f 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/MeterUtilTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/MeterUtilTest.java @@ -31,9 +31,12 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.ba import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.batch.meter.output.list.grouping.BatchFailedMetersOutputBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.meters.service.rev160316.batch.meter.output.list.grouping.BatchFailedMetersOutputKey; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; -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.opendaylight.yangtools.yang.common.Uint32; /** * Test for {@link MeterUtil}. @@ -41,8 +44,8 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder; public class MeterUtilTest { public static final NodeId DUMMY_NODE_ID = new NodeId("dummyNodeId"); - private static final MeterId DUMMY_METER_ID = new MeterId(42L); - private static final MeterId DUMMY_METER_ID_2 = new MeterId(43L); + private static final MeterId DUMMY_METER_ID = new MeterId(Uint32.valueOf(42)); + private static final MeterId DUMMY_METER_ID_2 = new MeterId(Uint32.valueOf(43)); @Test public void testBuildGroupPath() { @@ -66,7 +69,7 @@ public class MeterUtilTest { final RpcResult> output = function.apply(Lists.newArrayList( RpcResultBuilder.success("a").build(), RpcResultBuilder.failed() - .withError(RpcError.ErrorType.APPLICATION, "ut-meter-error") + .withError(ErrorType.APPLICATION, "ut-meter-error") .build())); Assert.assertFalse(output.isSuccessful()); @@ -133,8 +136,9 @@ public class MeterUtilTest { private static RpcResult> createBatchOutcomeWithError() { return RpcResultBuilder.>failed() - .withError(RpcError.ErrorType.APPLICATION, "ut-flowAddFail") - .withResult(Collections.singletonList(new BatchFailedMetersOutputBuilder() + .withError(ErrorType.APPLICATION, "ut-flowAddFail") + .withResult(List.of(new BatchFailedMetersOutputBuilder() + .setBatchOrder(Uint16.ZERO) .setMeterId(DUMMY_METER_ID) .build())) .build(); @@ -220,14 +224,14 @@ public class MeterUtilTest { private static RpcResult createBarrierFailureOutcome() { return RpcResultBuilder.failed() - .withError(RpcError.ErrorType.APPLICATION, "ut-barrier-error") + .withError(ErrorType.APPLICATION, "ut-barrier-error") .build(); } private static RpcResult createAddMetersBatchSuccessOutput() { return RpcResultBuilder .success(new AddMetersBatchOutputBuilder() - .setBatchFailedMetersOutput(Collections.emptyMap()) + .setBatchFailedMetersOutput(Map.of()) .build()) .build(); } @@ -236,7 +240,7 @@ public class MeterUtilTest { final RpcResult> batchOutcomeWithError = createBatchOutcomeWithError(); return RpcResultBuilder.failed() .withResult(new AddMetersBatchOutputBuilder() - .setBatchFailedMetersOutput(batchOutcomeWithError.getResult()) + .setBatchFailedMetersOutput(BindingMap.ordered(batchOutcomeWithError.getResult())) .build()) .withRpcErrors(batchOutcomeWithError.getErrors()) .build();