BUG-1513: finish migration of ChoiceNodes
[yangtools.git] / integration-test / yang-runtime-tests / src / test / java / org / opendaylight / yangtools / it / yang / runtime / tests / RuntimeCodecAugmentationWithGroupingsAndCasesTest.java
index 28b7879cd957ac8b0496be460da3a8452ab3a17a..a642b690c29afa6b60b56c678c53e519f10aa02e 100644 (file)
@@ -1,8 +1,10 @@
 package org.opendaylight.yangtools.it.yang.runtime.tests;
 
-import static junit.framework.Assert.assertNotNull;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
+import com.google.common.base.Optional;
+
 import java.util.AbstractMap.SimpleEntry;
 import java.util.Map.Entry;
 
@@ -25,8 +27,6 @@ import org.opendaylight.yangtools.yang.binding.util.BindingReflections;
 import org.opendaylight.yangtools.yang.data.api.CompositeNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
-import com.google.common.base.Optional;
-
 public class RuntimeCodecAugmentationWithGroupingsAndCasesTest {
 
     private static final InstanceIdentifier<ExtWithGroupingAugmentations> GROUPING_AUGMENTATIONS_PATH = InstanceIdentifier
@@ -54,9 +54,7 @@ public class RuntimeCodecAugmentationWithGroupingsAndCasesTest {
         assertNotNull(schemaContext);
         assertTrue(schemaContext.isPresent());
 
-        mappingService = new RuntimeGeneratedMappingServiceImpl(moduleInfoContext);
-        mappingService.setPool(ClassPool.getDefault());
-        mappingService.init();
+        mappingService = new RuntimeGeneratedMappingServiceImpl(ClassPool.getDefault(), moduleInfoContext);
         mappingService.onGlobalContextUpdated(schemaContext.get());
 
     }
@@ -65,14 +63,14 @@ public class RuntimeCodecAugmentationWithGroupingsAndCasesTest {
     public void testSerialization() {
 
         ExtWithGroupingAugmentations caseData = new ExtWithGroupingAugmentationsBuilder() //
-                .setGroupingData(new GroupingDataBuilder() //
-                        .addAugmentation(InUsesAugment.class, new InUsesAugmentBuilder() //
-                                .setExtAumentation("InUses") //
-                                .build()) //
-                        .build()) //
-                .build();
-
-        Entry<org.opendaylight.yangtools.yang.data.api.InstanceIdentifier, CompositeNode> result = mappingService
+        .setGroupingData(new GroupingDataBuilder() //
+        .addAugmentation(InUsesAugment.class, new InUsesAugmentBuilder() //
+        .setExtAumentation("InUses") //
+        .build()) //
+        .build()) //
+        .build();
+
+        Entry<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, CompositeNode> result = mappingService
                 .toDataDom(new SimpleEntry(GROUPING_AUGMENTATIONS_PATH, caseData));
         assertNotNull(result);
     }