import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-import static org.opendaylight.controller.sal.restconf.impl.test.RestOperationUtils.createUri;
import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
@Test
public void getOperationalStatusCodes() throws UnsupportedEncodingException {
mockReadOperationalDataMethod();
- String uri = createUri("/operational/", "ietf-interfaces:interfaces/interface/eth0");
+ String uri = "/operational/ietf-interfaces:interfaces/interface/eth0";
assertEquals(200, get(uri, MediaType.APPLICATION_XML));
- uri = createUri("/operational/", "wrong-module:interfaces/interface/eth0");
+ uri = "/operational/wrong-module:interfaces/interface/eth0";
assertEquals(400, get(uri, MediaType.APPLICATION_XML));
}
@Test
public void getConfigStatusCodes() throws UnsupportedEncodingException {
mockReadConfigurationDataMethod();
- String uri = createUri("/config/", "ietf-interfaces:interfaces/interface/eth0");
+ String uri = "/config/ietf-interfaces:interfaces/interface/eth0";
assertEquals(200, get(uri, MediaType.APPLICATION_XML));
- uri = createUri("/config/", "wrong-module:interfaces/interface/eth0");
+ uri = "/config/wrong-module:interfaces/interface/eth0";
assertEquals(400, get(uri, MediaType.APPLICATION_XML));
}
ControllerContext.getInstance().setMountService(mockMountService);
- String uri = createUri("/config/",
- "ietf-interfaces:interfaces/interface/0/yang-ext:mount/test-module:cont/cont1");
+ String uri = "/config/ietf-interfaces:interfaces/interface/0/yang-ext:mount/test-module:cont/cont1";
assertEquals(200, get(uri, MediaType.APPLICATION_XML));
- uri = createUri("/config/", "ietf-interfaces:interfaces/yang-ext:mount/test-module:cont/cont1");
+ uri = "/config/ietf-interfaces:interfaces/yang-ext:mount/test-module:cont/cont1";
assertEquals(200, get(uri, MediaType.APPLICATION_XML));
}
ControllerContext.getInstance().setMountService(mockMountService);
- String uri = createUri("/config/", "ietf-interfaces:interfaces/interface/0/yang-ext:mount/");
+ String uri = "/config/ietf-interfaces:interfaces/interface/0/yang-ext:mount/";
assertEquals(200, get(uri, MediaType.APPLICATION_XML));
}
public void getModulesTest() throws UnsupportedEncodingException, FileNotFoundException {
ControllerContext.getInstance().setGlobalSchema(schemaContextModules);
- String uri = createUri("/modules", "");
+ String uri = "/modules";
Response response = target(uri).request("application/yang.api+json").get();
validateModulesResponseJson(response);
public void getModuleTest() throws FileNotFoundException, UnsupportedEncodingException {
ControllerContext.getInstance().setGlobalSchema(schemaContextModules);
- String uri = createUri("/modules/module/module2/2014-01-02", "");
+ String uri = "/modules/module/module2/2014-01-02";
Response response = target(uri).request("application/yang.api+xml").get();
assertEquals(200, response.getStatus());
public void getOperationsTest() throws FileNotFoundException, UnsupportedEncodingException {
ControllerContext.getInstance().setGlobalSchema(schemaContextModules);
- String uri = createUri("/operations", "");
+ String uri = "/operations";
Response response = target(uri).request("application/yang.api+xml").get();
assertEquals(200, response.getStatus());
controllerContext.setMountService(mockMountService);
- String uri = createUri("/operations/", "ietf-interfaces:interfaces/interface/0/yang-ext:mount/");
+ String uri = "/operations/ietf-interfaces:interfaces/interface/0/yang-ext:mount/";
Response response = target(uri).request("application/yang.api+xml").get();
assertEquals(200, response.getStatus());
controllerContext.setMountService(mockMountService);
- String uri = createUri("/modules/", "ietf-interfaces:interfaces/interface/0/yang-ext:mount/");
+ String uri = "/modules/ietf-interfaces:interfaces/interface/0/yang-ext:mount/";
Response response = target(uri).request("application/yang.api+json").get();
assertEquals(200, response.getStatus());
controllerContext.setMountService(mockMountService);
- String uri = createUri("/modules/module/",
- "ietf-interfaces:interfaces/interface/0/yang-ext:mount/module1-behind-mount-point/2014-02-03");
+ String uri = "/modules/module/ietf-interfaces:interfaces/interface/0/yang-ext:mount/module1-behind-mount-point/2014-02-03";
Response response = target(uri).request("application/yang.api+json").get();
assertEquals(200, response.getStatus());