From 82eb3f94c133e091ca5dd2f26450da9f121c12ca Mon Sep 17 00:00:00 2001 From: Tony Tkacik Date: Fri, 30 May 2014 16:39:36 +0200 Subject: [PATCH] Bug 981: Converted test to use BitsType.create() Change-Id: I759c55c48de64e48c5757aba5b7665f2478aa0fb Signed-off-by: Tony Tkacik --- .../restconf/impl/test/RestCodecExceptionsTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestCodecExceptionsTest.java b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestCodecExceptionsTest.java index 983377e1e8..024a93b78e 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestCodecExceptionsTest.java +++ b/opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestCodecExceptionsTest.java @@ -7,20 +7,28 @@ */ package org.opendaylight.controller.sal.restconf.impl.test; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; import static org.mockito.Mockito.mock; +import java.util.Collections; + import org.junit.Test; import org.opendaylight.controller.sal.restconf.impl.RestCodec; import org.opendaylight.yangtools.concepts.Codec; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.model.api.SchemaPath; +import org.opendaylight.yangtools.yang.model.api.type.BitsTypeDefinition.Bit; import org.opendaylight.yangtools.yang.model.api.type.IdentityrefTypeDefinition; import org.opendaylight.yangtools.yang.model.util.BitsType; public class RestCodecExceptionsTest { + private static final SchemaPath PATH = SchemaPath.create(true, QName.create("test", "2014-05-30", "test")); + @Test public void serializeExceptionTest() { - Codec codec = RestCodec.from(new BitsType(null), null); + Codec codec = RestCodec.from(BitsType.create(PATH, Collections.emptyList()), null); String serializedValue = (String) codec.serialize("incorrect value"); // set // expected assertEquals("incorrect value", serializedValue); -- 2.36.6