2 * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.api.codec;
10 import static org.junit.jupiter.api.Assertions.assertThrows;
12 import org.junit.jupiter.api.Test;
14 public class AbstractIllegalArgumentCodecTest {
15 private static final class TestCodec extends AbstractIllegalArgumentCodec<String, String> {
17 protected String deserializeImpl(final String product) {
18 throw new AssertionError("Should never be invoked");
22 protected String serializeImpl(final String input) {
23 throw new AssertionError("Should never be invoked");
27 private final TestCodec codec = new TestCodec();
30 public void testNullDeserialize() {
31 assertThrows(NullPointerException.class, () -> codec.deserialize(null));
35 public void testNullSerialize() {
36 assertThrows(NullPointerException.class, () -> codec.serialize(null));