Skip to content

Commit 1a5e2c2

Browse files
Tobianasihrasko
authored andcommitted
Create a workaround for NETCONF-1218
Because base path is hard-coded in ODL, we need to make this application use /rests base. This commit should be reverted after NETCONF-1218 is resolved and implemented. Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech> Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
1 parent cc448b4 commit 1a5e2c2

File tree

2 files changed

+9
-5
lines changed
  • lighty-examples/lighty-community-restconf-netconf-app/src

2 files changed

+9
-5
lines changed

lighty-examples/lighty-community-restconf-netconf-app/src/main/java/io/lighty/examples/controllers/restconfapp/Main.java

+4
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ private void startLighty(final ControllerConfiguration controllerConfiguration,
133133
throws ConfigurationException, ExecutionException, InterruptedException, TimeoutException,
134134
ModuleStartupException {
135135

136+
//FIXME remove this after paths NETCONF-1218 is resolved.
137+
restconfConfiguration.setRestconfServletContextPath("/rests");
138+
restconfConfiguration.setHttpPort(8181);
139+
136140
//1. initialize and start Lighty controller (MD-SAL, Controller, YangTools, Akka)
137141
LightyControllerBuilder lightyControllerBuilder = new LightyControllerBuilder();
138142
this.lightyController = lightyControllerBuilder.from(controllerConfiguration).build();

lighty-examples/lighty-community-restconf-netconf-app/src/test/java/io/lighty/examples/controllers/restconfapp/tests/RestconfAppTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class RestconfAppTest {
3737
public static void init() {
3838
restconfApp = new Main();
3939
restconfApp.start();
40-
restClient = new RestClient("http://localhost:8888/");
40+
restClient = new RestClient("http://localhost:8181/");
4141
}
4242

4343
/**
@@ -46,7 +46,7 @@ public static void init() {
4646
@Test
4747
public void simpleApplicationTest() throws IOException, InterruptedException {
4848
HttpResponse<String> operations;
49-
restClient.POST("restconf/data/network-topology:network-topology/topology=topology-netconf",
49+
restClient.POST("rests/data/network-topology:network-topology/topology=topology-netconf",
5050
"""
5151
{
5252
"netconf-topology:node": [
@@ -56,11 +56,11 @@ public void simpleApplicationTest() throws IOException, InterruptedException {
5656
]
5757
}""");
5858

59-
operations = restClient.GET("restconf/operations");
59+
operations = restClient.GET("rests/operations");
6060
Assert.assertEquals(operations.statusCode(), 200);
61-
operations = restClient.GET("restconf/data/network-topology:network-topology?content=config");
61+
operations = restClient.GET("rests/data/network-topology:network-topology?content=config");
6262
Assert.assertEquals(operations.statusCode(), 200);
63-
operations = restClient.GET("restconf/data/network-topology:network-topology?content=nonconfig");
63+
operations = restClient.GET("rests/data/network-topology:network-topology?content=nonconfig");
6464
Assert.assertEquals(operations.statusCode(), 200);
6565
}
6666

0 commit comments

Comments
 (0)