- ControllerContext.getInstance().setGlobalSchema( schemaContextModules );
-
- CompositeNode depth1Cont = toCompositeNode(
- toCompositeNodeData( toNestedQName( "depth1-cont" ),
- toCompositeNodeData( toNestedQName( "depth2-cont1" ),
- toCompositeNodeData( toNestedQName( "depth3-cont1" ),
- toCompositeNodeData( toNestedQName( "depth4-cont1" ),
- toSimpleNodeData( toNestedQName( "depth5-leaf1" ), "depth5-leaf1-value" )
- ),
- toSimpleNodeData( toNestedQName( "depth4-leaf1" ), "depth4-leaf1-value" )
- ),
- toSimpleNodeData( toNestedQName( "depth3-leaf1" ), "depth3-leaf1-value" )
- ),
- toCompositeNodeData( toNestedQName( "depth2-cont2" ),
- toCompositeNodeData( toNestedQName( "depth3-cont2" ),
- toCompositeNodeData( toNestedQName( "depth4-cont2" ),
- toSimpleNodeData( toNestedQName( "depth5-leaf2" ), "depth5-leaf2-value" )
- ),
- toSimpleNodeData( toNestedQName( "depth4-leaf2" ), "depth4-leaf2-value" )
- ),
- toSimpleNodeData( toNestedQName( "depth3-leaf2" ), "depth3-leaf2-value" )
- ),
- toSimpleNodeData( toNestedQName( "depth2-leaf1" ), "depth2-leaf1-value" )
- ) );
-
- when( brokerFacade.readConfigurationData( any( InstanceIdentifier.class ) ) )
- .thenReturn( depth1Cont );
+ ControllerContext.getInstance().setGlobalSchema(schemaContextModules);
+
+ CompositeNode depth1Cont = toCompositeNode(toCompositeNodeData(
+ toNestedQName("depth1-cont"),
+ toCompositeNodeData(
+ toNestedQName("depth2-cont1"),
+ toCompositeNodeData(
+ toNestedQName("depth3-cont1"),
+ toCompositeNodeData(toNestedQName("depth4-cont1"),
+ toSimpleNodeData(toNestedQName("depth5-leaf1"), "depth5-leaf1-value")),
+ toSimpleNodeData(toNestedQName("depth4-leaf1"), "depth4-leaf1-value")),
+ toSimpleNodeData(toNestedQName("depth3-leaf1"), "depth3-leaf1-value")),
+ toCompositeNodeData(
+ toNestedQName("depth2-cont2"),
+ toCompositeNodeData(
+ toNestedQName("depth3-cont2"),
+ toCompositeNodeData(toNestedQName("depth4-cont2"),
+ toSimpleNodeData(toNestedQName("depth5-leaf2"), "depth5-leaf2-value")),
+ toSimpleNodeData(toNestedQName("depth4-leaf2"), "depth4-leaf2-value")),
+ toSimpleNodeData(toNestedQName("depth3-leaf2"), "depth3-leaf2-value")),
+ toSimpleNodeData(toNestedQName("depth2-leaf1"), "depth2-leaf1-value")));
+
+ Module module = TestUtils.findModule(schemaContextModules.getModules(), "nested-module");
+ assertNotNull(module);
+
+ DataSchemaNode dataSchemaNode = TestUtils.resolveDataSchemaNode("depth1-cont", module);
+ assertNotNull(dataSchemaNode);
+
+ when(brokerFacade.readConfigurationData(any(YangInstanceIdentifier.class))).thenReturn(
+ TestUtils.compositeNodeToDatastoreNormalizedNode(depth1Cont, dataSchemaNode));