- org.junit.Assert.assertThat(responseBuilder.toString(), JUnitMatchers.containsString("<capability>urn:ietf:params:netconf:capability:candidate:1.0</capability>"));
- org.junit.Assert.assertThat(responseBuilder.toString(), JUnitMatchers.containsString("<username>tomas</username>"));
+ 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");