X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Ftest%2FTestUtils.java;h=309fb6441ad91ab6db16282a30d687914979259b;hb=d468a5db1e6fe2c3949d3f6227c0645c6777ecb5;hp=20dfb31dab3362261fb1496dd1da9246fbc8052a;hpb=356f96ce57f8c099ce98e38b4053c075050bda10;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/TestUtils.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/TestUtils.java index 20dfb31dab..309fb6441a 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/TestUtils.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/TestUtils.java @@ -411,5 +411,20 @@ final class TestUtils { } } } + + public static void prepareMockForRestconfBeforeNormalization(Set modules, DataSchemaNode dataSchemaNode, + RestconfImpl restconf) { + ControllerContext instance = ControllerContext.getInstance(); + instance.setSchemas(TestUtils.loadSchemaContext(modules)); + restconf.setControllerContext(ControllerContext.getInstance()); + + BrokerFacade mockedBrokerFacade = mock(BrokerFacade.class); + when(mockedBrokerFacade.commitConfigurationDataPut(any(InstanceIdentifier.class), any(CompositeNode.class))) + .thenReturn( + new DummyFuture.Builder().rpcResult( + new DummyRpcResult.Builder().result(TransactionStatus.COMMITED) + .build()).build()); + restconf.setBroker(mockedBrokerFacade); + } }