Merge "Bug 9092: revert to org.json temporarily"
[netconf.git] / restconf / sal-rest-connector / src / test / java / org / opendaylight / restconf / jersey / providers / JsonBodyReaderTest.java
index 43c4d1ac8eb8de466e808ec41af8ecea791584c7..9aa4407b2884bcac79c877e99c1977697b645b51 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);
         }
@@ -72,8 +72,8 @@ public class JsonBodyReaderTest extends AbstractBodyReaderTest {
         final Collection<File> testFiles = TestRestconfUtils.loadFiles("/instanceidentifier/yang");
         testFiles.addAll(TestRestconfUtils.loadFiles("/modules"));
         schemaContext = YangParserTestUtils.parseYangSources(testFiles);
-        controllerContext.setSchemas(schemaContext);
-        when(mountPointServiceHandler.get()).thenReturn(mock(DOMMountPointService.class));
+        CONTROLLER_CONTEXT.setSchemas(schemaContext);
+        when(MOUNT_POINT_SERVICE_HANDLER.get()).thenReturn(mock(DOMMountPointService.class));
     }
 
     @Test
@@ -152,10 +152,10 @@ public class JsonBodyReaderTest extends AbstractBodyReaderTest {
         final QName augmentChoice1QName = QName.create(augmentModule.getQNameModule(), "augment-choice1");
         final QName augmentChoice2QName = QName.create(augmentChoice1QName, "augment-choice2");
         final QName containerQName = QName.create(augmentChoice1QName, "case-choice-case-container1");
-        final YangInstanceIdentifier.AugmentationIdentifier augChoice1II = new YangInstanceIdentifier.AugmentationIdentifier(
-                Sets.newHashSet(augmentChoice1QName));
-        final YangInstanceIdentifier.AugmentationIdentifier augChoice2II = new YangInstanceIdentifier.AugmentationIdentifier(
-                Sets.newHashSet(augmentChoice2QName));
+        final YangInstanceIdentifier.AugmentationIdentifier augChoice1II =
+                new YangInstanceIdentifier.AugmentationIdentifier(Sets.newHashSet(augmentChoice1QName));
+        final YangInstanceIdentifier.AugmentationIdentifier augChoice2II =
+                new YangInstanceIdentifier.AugmentationIdentifier(Sets.newHashSet(augmentChoice2QName));
         final YangInstanceIdentifier dataII = YangInstanceIdentifier.of(dataSchemaNode.getQName()).node(augChoice1II)
                 .node(augmentChoice1QName).node(augChoice2II).node(augmentChoice2QName).node(containerQName);
         final String uri = "instance-identifier-module:cont";