X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-it%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fit%2FNetconfMonitoringITTest.java;h=f581342a9c946946a498afa9584eace953982711;hp=e36261c6eb4803b68498c592860d15f65381f357;hb=7f0272398ce3dab7ceddd998c7bb510df3b28838;hpb=f776809962df87deeaa533ba995cc6fceba64d0e diff --git a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java index e36261c6eb..f581342a9c 100644 --- a/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java +++ b/opendaylight/netconf/netconf-it/src/test/java/org/opendaylight/controller/netconf/it/NetconfMonitoringITTest.java @@ -10,11 +10,11 @@ package org.opendaylight.controller.netconf.it; import com.google.common.base.Charsets; import com.google.common.base.Optional; import com.google.common.collect.Sets; +import static org.opendaylight.controller.netconf.util.test.XmlUnitUtil.assertContainsElementWithText; import io.netty.channel.ChannelFuture; import junit.framework.Assert; import org.junit.Before; import org.junit.Test; -import org.junit.matchers.JUnitMatchers; import org.mockito.Mock; import org.opendaylight.controller.config.manager.impl.factoriesresolver.HardcodedModuleFactoriesResolver; import org.opendaylight.controller.config.spi.ModuleFactory; @@ -165,8 +165,13 @@ public class NetconfMonitoringITTest extends AbstractNetconfConfigTest { sock.close(); - org.junit.Assert.assertThat(responseBuilder.toString(), JUnitMatchers.containsString("urn:ietf:params:netconf:capability:candidate:1.0")); - org.junit.Assert.assertThat(responseBuilder.toString(), JUnitMatchers.containsString("tomas")); + String helloMsg = responseBuilder.substring(0, responseBuilder.indexOf(separator)); + Document doc = XmlUtil.readXmlToDocument(helloMsg); + assertContainsElementWithText(doc, "urn:ietf:params:netconf:capability:candidate:1.0"); + + String replyMsg = responseBuilder.substring(responseBuilder.indexOf(separator) + separator.length()); + doc = XmlUtil.readXmlToDocument(replyMsg); + assertContainsElementWithText(doc, "tomas"); } private void assertSessionElementsInResponse(Document document, int i) {