Clean up revision formatting
[netconf.git] / restconf / sal-rest-connector / src / test / java / org / opendaylight / restconf / jersey / providers / JsonBodyReaderTest.java
index 4fffdb6d8eccd880a1c8c64a8152f478f9c42772..4b3bb46e9777f72946c02fb210c6e2a6dae7c8f8 100644 (file)
@@ -19,7 +19,6 @@ import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.net.URI;
 import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.Collection;
 import javax.ws.rs.core.MediaType;
 import org.junit.BeforeClass;
@@ -30,6 +29,7 @@ import org.opendaylight.controller.sal.rest.impl.test.providers.TestXmlBodyReade
 import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
+import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodes;
 import org.opendaylight.yangtools.yang.model.api.DataNodeContainer;
@@ -50,7 +50,7 @@ public class JsonBodyReaderTest extends AbstractBodyReaderTest {
     private static QNameModule initializeInstanceIdentifierModule() {
         try {
             return QNameModule.create(URI.create("instance:identifier:module"),
-                    new SimpleDateFormat("yyyy-MM-dd").parse("2014-01-17"));
+                SimpleDateFormatUtil.getRevisionFormat().parse("2014-01-17"));
         } catch (final ParseException e) {
             throw new Error(e);
         }
@@ -71,7 +71,6 @@ public class JsonBodyReaderTest extends AbstractBodyReaderTest {
             throws NoSuchFieldException, SecurityException, FileNotFoundException, SourceException, ReactorException {
         final Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
         testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
-        testFiles.addAll(TestRestconfUtils.loadFiles("/invoke-rpc"));
         schemaContext = YangParserTestUtils.parseYangSources(testFiles);
         controllerContext.setSchemas(schemaContext);
         when(mountPointServiceHandler.get()).thenReturn(mock(DOMMountPointService.class));
@@ -169,10 +168,10 @@ public class JsonBodyReaderTest extends AbstractBodyReaderTest {
         checkExpectValueNormalizeNodeContext(dataSchemaNode, returnValue, dataII);
     }
 
-    private void checkExpectValueNormalizeNodeContext(final DataSchemaNode dataSchemaNode,
+    private static void checkExpectValueNormalizeNodeContext(final DataSchemaNode dataSchemaNode,
             final NormalizedNodeContext nnContext, final YangInstanceIdentifier dataNodeIdent) {
         assertEquals(dataSchemaNode, nnContext.getInstanceIdentifierContext().getSchemaNode());
         assertEquals(dataNodeIdent, nnContext.getInstanceIdentifierContext().getInstanceIdentifier());
         assertNotNull(NormalizedNodes.findNode(nnContext.getData(), dataNodeIdent));
     }
-}
\ No newline at end of file
+}