X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Frestconf%2Fimpl%2Ftest%2FRestGetOperationTest.java;h=6f507f96e27faf82550e4bc92a842528b888c5c0;hb=5aa8f995feede44d69bc26e70a67e6c44b01c758;hp=1e01020e78925f6b8b33606da8f43967a584ff12;hpb=fd8c7a6e7445ca9788c2557caa9da5af8c8a2153;p=controller.git diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java index 1e01020e78..6f507f96e2 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestGetOperationTest.java @@ -12,7 +12,6 @@ import static org.junit.Assert.assertTrue; 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; @@ -94,10 +93,10 @@ public class RestGetOperationTest extends JerseyTest { @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)); } @@ -107,10 +106,10 @@ public class RestGetOperationTest extends JerseyTest { @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)); } @@ -129,11 +128,10 @@ public class RestGetOperationTest extends JerseyTest { 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)); } @@ -149,7 +147,7 @@ public class RestGetOperationTest extends JerseyTest { 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)); } @@ -158,7 +156,7 @@ public class RestGetOperationTest extends JerseyTest { 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); @@ -172,7 +170,7 @@ public class RestGetOperationTest extends JerseyTest { 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()); @@ -197,7 +195,7 @@ public class RestGetOperationTest extends JerseyTest { 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()); @@ -238,7 +236,7 @@ public class RestGetOperationTest extends JerseyTest { 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()); @@ -329,7 +327,7 @@ public class RestGetOperationTest extends JerseyTest { 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()); @@ -371,8 +369,7 @@ public class RestGetOperationTest extends JerseyTest { 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());