X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=binding%2Fmdsal-binding-dom-codec%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Fbinding%2Fdom%2Fcodec%2Ftest%2FCachingCodecTest.java;h=7c8fa7a72950b820315c06dc8de13df81f6b90f7;hb=12b665bc9f60d2acdfb38549a091848338b1d38b;hp=6768bef5b70a6862e7139cc294c15806772c98c6;hpb=2b1823cca8327eeb762ccb4ec2cc6a6b8a77555c;p=mdsal.git diff --git a/binding/mdsal-binding-dom-codec/src/test/java/org/opendaylight/mdsal/binding/dom/codec/test/CachingCodecTest.java b/binding/mdsal-binding-dom-codec/src/test/java/org/opendaylight/mdsal/binding/dom/codec/test/CachingCodecTest.java index 6768bef5b7..7c8fa7a729 100644 --- a/binding/mdsal-binding-dom-codec/src/test/java/org/opendaylight/mdsal/binding/dom/codec/test/CachingCodecTest.java +++ b/binding/mdsal-binding-dom-codec/src/test/java/org/opendaylight/mdsal/binding/dom/codec/test/CachingCodecTest.java @@ -14,10 +14,10 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; -import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; import java.util.Collection; -import java.util.List; +import java.util.Map; import org.junit.Before; import org.junit.Test; import org.opendaylight.mdsal.binding.dom.codec.api.BindingDataObjectCodecTreeNode; @@ -47,8 +47,8 @@ public class CachingCodecTest extends AbstractBindingCodecTest { private static final NodeIdentifier TOP_LEVEL_LIST_ARG = new NodeIdentifier(TopLevelList.QNAME); private static final InstanceIdentifier TOP_PATH = InstanceIdentifier.create(Top.class); - private static final List TWO_LIST = createList(2); - private static final List THREE_LIST = createList(3); + private static final Map TWO_LIST = createList(2); + private static final Map THREE_LIST = createList(3); private static final Top TOP_TWO_LIST_DATA = new TopBuilder().setTopLevelList(TWO_LIST).build(); private static final Top TOP_THREE_LIST_DATA = new TopBuilder().setTopLevelList(THREE_LIST).build(); @@ -77,12 +77,11 @@ public class CachingCodecTest extends AbstractBindingCodecTest { contNode = registry.getCodecContext().getSubtreeCodec(CONT_PATH); } - private static List createList(final int num) { - - final ImmutableList.Builder builder = ImmutableList.builder(); + private static Map createList(final int num) { + final ImmutableMap.Builder builder = ImmutableMap.builder(); for (int i = 0; i < num; i++) { final TopLevelListKey key = new TopLevelListKey("test-" + i); - builder.add(new TopLevelListBuilder().withKey(key).build()); + builder.put(key, new TopLevelListBuilder().withKey(key).build()); } return builder.build(); } @@ -134,7 +133,7 @@ public class CachingCodecTest extends AbstractBindingCodecTest { final Top input = new TopBuilder().build(); assertNull(input.getTopLevelList()); - assertEquals(ImmutableList.of(), input.nonnullTopLevelList()); + assertEquals(ImmutableMap.of(), input.nonnullTopLevelList()); final NormalizedNode dom = cachingCodec.serialize(input); final Top output = cachingCodec.deserialize(dom); @@ -142,7 +141,7 @@ public class CachingCodecTest extends AbstractBindingCodecTest { assertTrue(output.equals(input)); assertNull(output.getTopLevelList()); - assertEquals(ImmutableList.of(), output.nonnullTopLevelList()); + assertEquals(ImmutableMap.of(), output.nonnullTopLevelList()); } @SafeVarargs