- public void putDatastoreDataViaUrlTest200() throws UnsupportedEncodingException {
- mockCommitConfigurationDataPutMethod(TransactionStatus.COMMITED);
- putDataViaUrlTest("/datastore/", Draft01.MediaTypes.DATA + JSON, jsonData, 200);
- putDataViaUrlTest("/datastore/", Draft01.MediaTypes.DATA + XML, xmlData, 200);
- putDataViaUrlTest("/datastore/", MediaType.APPLICATION_JSON, jsonData, 200);
- putDataViaUrlTest("/datastore/", MediaType.APPLICATION_XML, xmlData, 200);
- putDataViaUrlTest("/datastore/", MediaType.TEXT_XML, xmlData, 200);
+ public void testRpcResultCommitedToStatusCodesWithMountPoint() throws UnsupportedEncodingException,
+ FileNotFoundException, URISyntaxException {
+
+ CheckedFuture<Void, TransactionCommitFailedException> dummyFuture = mock(CheckedFuture.class);
+
+ when(
+ brokerFacade.commitConfigurationDataPut(any(DOMMountPoint.class), any(YangInstanceIdentifier.class),
+ any(NormalizedNode.class))).thenReturn(dummyFuture);
+
+ DOMMountPoint mountInstance = mock(DOMMountPoint.class);
+ when(mountInstance.getSchemaContext()).thenReturn(schemaContextTestModule);
+ DOMMountPointService mockMountService = mock(DOMMountPointService.class);
+ when(mockMountService.getMountPoint(any(YangInstanceIdentifier.class))).thenReturn(Optional.of(mountInstance));
+
+ ControllerContext.getInstance().setMountService(mockMountService);
+
+ String uri = "/config/ietf-interfaces:interfaces/interface/0/yang-ext:mount/test-module:cont";
+ assertEquals(200, put(uri, MediaType.APPLICATION_XML, xmlData2));
+
+ uri = "/config/ietf-interfaces:interfaces/yang-ext:mount/test-module:cont";
+ assertEquals(200, put(uri, MediaType.APPLICATION_XML, xmlData2));