+ }
+
+ private static void prepareMocksForRestconf(Set<Module> modules, RestconfImpl restconf) {
+ ControllerContext controllerContext = ControllerContext.getInstance();
+ BrokerFacade mockedBrokerFacade = mock(BrokerFacade.class);
+
+ controllerContext.setSchemas(TestUtils.loadSchemaContext(modules));
+
+ when(mockedBrokerFacade.commitConfigurationDataPut(any(InstanceIdentifier.class), any(CompositeNode.class)))
+ .thenReturn(
+ new DummyFuture.Builder().rpcResult(
+ new DummyRpcResult.Builder<TransactionStatus>().result(TransactionStatus.COMMITED)
+ .build()).build());
+
+ restconf.setControllerContext(controllerContext);
+ restconf.setBroker(mockedBrokerFacade);
+ }
+
+ public static CompositeNode readInputToCnSn(String path, boolean dummyNamespaces,
+ MessageBodyReader<CompositeNode> reader) throws WebApplicationException {
+
+ InputStream inputStream = TestUtils.class.getResourceAsStream(path);