- when(brokerFacade.commitConfigurationDataPost(any(InstanceIdentifier.class), any(CompositeNode.class)))
- .thenReturn(dummyFuture);
+ ArgumentCaptor<YangInstanceIdentifier> instanceIdCaptor = ArgumentCaptor.forClass(YangInstanceIdentifier.class);
+ ArgumentCaptor<NormalizedNode> compNodeCaptor = ArgumentCaptor.forClass(NormalizedNode.class);
+
+ String URI_1 = "/config";
+ assertEquals(204, post(URI_1, Draft02.MediaTypes.DATA + XML, xmlTestInterface));
+ verify(brokerFacade).commitConfigurationDataPost(instanceIdCaptor.capture(), compNodeCaptor.capture());
+ String identifier = "[(urn:ietf:params:xml:ns:yang:test-interface?revision=2014-07-01)interfaces]";
+ assertEquals(identifier, instanceIdCaptor.getValue().getPath().toString());
+
+ String URI_2 = "/config/test-interface:interfaces";
+ assertEquals(204, post(URI_2, Draft02.MediaTypes.DATA + XML, xmlBlockData));
+ verify(brokerFacade, times(2))
+ .commitConfigurationDataPost(instanceIdCaptor.capture(), compNodeCaptor.capture());
+ identifier = "[(urn:ietf:params:xml:ns:yang:test-interface?revision=2014-07-01)interfaces, (urn:ietf:params:xml:ns:yang:test-interface?revision=2014-07-01)block]";
+ assertEquals(identifier, instanceIdCaptor.getValue().getPath().toString());