- /**
- * Tests of status codes for "/datastore/{identifier}".
- */
- @Test
- public void getDatastoreStatusCodes() throws FileNotFoundException, UnsupportedEncodingException {
- mockReadOperationalDataMethod();
- String uri = createUri("/datastore/", "ietf-interfaces:interfaces/interface/eth0");
- assertEquals(200, get(uri, MediaType.APPLICATION_XML));
-
- uri = createUri("/datastore/", "wrong-module:interfaces/interface/eth0");
- assertEquals(400, get(uri, MediaType.APPLICATION_XML));
-
- // Test of request for not existing data. Returning status code 404
- uri = createUri("/datastore/", "ietf-interfaces:interfaces/interface/eth0");
- when(brokerFacade.readOperationalData(any(InstanceIdentifier.class))).thenReturn(null);
- assertEquals(404, get(uri, MediaType.APPLICATION_XML));
- }
-