package org.opendaylight.yangtools.yang.data.impl.codecs;
import static org.junit.Assert.assertEquals;
+
import org.junit.Test;
import org.opendaylight.yangtools.yang.data.api.codec.BooleanCodec;
import org.opendaylight.yangtools.yang.model.util.type.BaseTypes;
@SuppressWarnings("unchecked")
@Test
public void testSerialize() {
- BooleanCodec<String> codec = TypeDefinitionAwareCodecTestHelper.getCodec(BaseTypes.booleanType(), BooleanCodec.class);
+ BooleanCodec<String> codec = TypeDefinitionAwareCodecTestHelper.getCodec(BaseTypes.booleanType(),
+ BooleanCodec.class);
assertEquals("serialize", "", codec.serialize(null));
- assertEquals("serialize", "true", codec.serialize(true));
- assertEquals("serialize", "false", codec.serialize(false));
+ assertEquals("serialize", "true", codec.serialize(Boolean.TRUE));
+ assertEquals("serialize", "false", codec.serialize(Boolean.FALSE));
}
@SuppressWarnings("unchecked")
@Test
public void testDeserialize() {
- BooleanCodec<String> codec = TypeDefinitionAwareCodecTestHelper.getCodec(BaseTypes.booleanType(), BooleanCodec.class);
+ BooleanCodec<String> codec = TypeDefinitionAwareCodecTestHelper.getCodec(BaseTypes.booleanType(),
+ BooleanCodec.class);
assertEquals("deserialize", Boolean.TRUE, codec.deserialize("true"));
assertEquals("deserialize", Boolean.TRUE, codec.deserialize("TRUE"));