Merge "Adding FlowRef,GroupRef and MeterRef for the ErrorNotification Message"
[controller.git] / opendaylight / netconf / netconf-impl / src / test / java / org / opendaylight / controller / netconf / impl / AdditionalHeaderParserTest.java
index 2f8fac23f5beac0e2461d0348baef9e4395f0846..97d9a98b5777b01e37468c00a98e8ea54f4dc889 100644 (file)
@@ -8,14 +8,16 @@
 package org.opendaylight.controller.netconf.impl;
 
 import junit.framework.Assert;
+
 import org.junit.Test;
+import org.opendaylight.controller.netconf.impl.util.AdditionalHeaderUtil;
 
 public class AdditionalHeaderParserTest {
 
     @Test
     public void testParsing() throws Exception {
         String s = "[netconf;10.12.0.102:48528;ssh;;;;;;]";
-        NetconfServerSessionNegotiator.AdditionalHeader header = new NetconfServerSessionNegotiator.AdditionalHeader(s);
+        NetconfServerSessionNegotiator.AdditionalHeader header = AdditionalHeaderUtil.fromString(s);
         Assert.assertEquals("netconf", header.getUsername());
         Assert.assertEquals("10.12.0.102", header.getAddress());
         Assert.assertEquals("ssh", header.getTransport());
@@ -24,7 +26,7 @@ public class AdditionalHeaderParserTest {
     @Test
     public void testParsing2() throws Exception {
         String s = "[tomas;10.0.0.0/10000;tcp;1000;1000;;/home/tomas;;]";
-        NetconfServerSessionNegotiator.AdditionalHeader header = new NetconfServerSessionNegotiator.AdditionalHeader(s);
+        NetconfServerSessionNegotiator.AdditionalHeader header = AdditionalHeaderUtil.fromString(s);
         Assert.assertEquals("tomas", header.getUsername());
         Assert.assertEquals("10.0.0.0", header.getAddress());
         Assert.assertEquals("tcp", header.getTransport());
@@ -33,6 +35,6 @@ public class AdditionalHeaderParserTest {
     @Test(expected = IllegalArgumentException.class)
     public void testParsingNoUsername() throws Exception {
         String s = "[10.12.0.102:48528;ssh;;;;;;]";
-        new NetconfServerSessionNegotiator.AdditionalHeader(s);
+        AdditionalHeaderUtil.fromString(s);
     }
 }