Fix license header violations in sal-netconf-connector
[controller.git] / opendaylight / md-sal / sal-netconf-connector / src / test / java / org / opendaylight / controller / sal / connect / netconf / schema / mapping / NetconfMessageTransformerTest.java
index 669479d3d582809470739803dd7d14859402abf9..ae57bb7b0ee0f2ad03a518556bfe6e9104b4e4e8 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 
 package org.opendaylight.controller.sal.connect.netconf.schema.mapping;
@@ -94,6 +94,7 @@ public class NetconfMessageTransformerTest {
                 NetconfBaseOps.getLockContent(NETCONF_CANDIDATE_QNAME));
 
         assertThat(XmlUtil.toString(netconfMessage.getDocument()), CoreMatchers.containsString("<lock"));
+        assertThat(XmlUtil.toString(netconfMessage.getDocument()), CoreMatchers.containsString("<rpc"));
     }
 
     @Test
@@ -109,6 +110,8 @@ public class NetconfMessageTransformerTest {
     public void testDiscardChangesRequest() throws Exception {
         final NetconfMessage netconfMessage = netconfMessageTransformer.toRpcRequest(toPath(NETCONF_DISCARD_CHANGES_QNAME), null);
         assertThat(XmlUtil.toString(netconfMessage.getDocument()), CoreMatchers.containsString("<discard"));
+        assertThat(XmlUtil.toString(netconfMessage.getDocument()), CoreMatchers.containsString("<rpc"));
+        assertThat(XmlUtil.toString(netconfMessage.getDocument()), CoreMatchers.containsString("message-id"));
     }
 
     @Test
@@ -117,7 +120,7 @@ public class NetconfMessageTransformerTest {
                 NetconfRemoteSchemaYangSourceProvider.createGetSchemaRequest("module", Optional.of("2012-12-12")));
         assertSimilarXml(netconfMessage, "<rpc message-id=\"m-0\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">\n" +
                 "<get-schema xmlns=\"urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring\">\n" +
-                "<format xmlns:x=\"urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring\">x:yang</format>\n" +
+                "<format>yang</format>\n" +
                 "<identifier>module</identifier>\n" +
                 "<version>2012-12-12</version>\n" +
                 "</get-schema>\n" +
@@ -243,7 +246,7 @@ public class NetconfMessageTransformerTest {
                 "<schema>\n" +
                 "<identifier>module</identifier>\n" +
                 "<version>2012-12-12</version>\n" +
-                "<format xmlns:x=\"urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring\">x:yang</format>\n" +
+                "<format>yang</format>\n" +
                 "</schema>\n" +
                 "</schemas>\n" +
                 "</netconf-state>\n" +
@@ -282,7 +285,7 @@ public class NetconfMessageTransformerTest {
     }
 
     private NetconfMessageTransformer getTransformer(final SchemaContext schema) {
-        return new NetconfMessageTransformer(schema);
+        return new NetconfMessageTransformer(schema, true);
     }
 
     @Test