- try (NetconfClient persisterClient = new NetconfClient("persister", tcpAddress, 4000, clientDispatcher)) {
- ConfigPersisterNotificationHandler configPersisterNotificationHandler = new ConfigPersisterNotificationHandler(
- platformMBeanServer, persisterClient, mockedAggregator,
- Pattern.compile(""));
- configPersisterNotificationHandler.init();
-
- try (NetconfClient netconfClient = new NetconfClient("client", tcpAddress, 4000, clientDispatcher)) {
- NetconfMessage response = netconfClient.sendMessage(loadGetConfigMessage());
- assertResponse(response, "<modules");
- assertResponse(response, "<services");
- response = netconfClient.sendMessage(loadCommitMessage());
- assertResponse(response, "ok");
-
- response = netconfClient.sendMessage(loadEditConfigMessage());
- assertResponse(response, "ok");
- response = netconfClient.sendMessage(loadCommitMessage());
- assertResponse(response, "ok");
+ try (TestingNetconfClient persisterClient = new TestingNetconfClient("persister", tcpAddress, 4000, clientDispatcher)) {
+ try (ConfigPersisterNotificationHandler configPersisterNotificationHandler = new ConfigPersisterNotificationHandler(
+ platformMBeanServer, mockedAggregator)) {
+
+
+ try (TestingNetconfClient netconfClient = new TestingNetconfClient("client", tcpAddress, 4000, clientDispatcher)) {
+ NetconfMessage response = netconfClient.sendMessage(loadGetConfigMessage());
+ assertContainsElementWithName(response.getDocument(), "modules");
+ assertContainsElementWithName(response.getDocument(), "services");
+ response = netconfClient.sendMessage(loadCommitMessage());
+ assertContainsElementWithName(response.getDocument(), "ok");
+
+ response = netconfClient.sendMessage(loadEditConfigMessage());
+ assertContainsElementWithName(response.getDocument(), "ok");
+ response = netconfClient.sendMessage(loadCommitMessage());
+ assertContainsElementWithName(response.getDocument(), "ok");
+ }