Migrate concepts to Jupiter API
[yangtools.git] / common / concepts / src / test / java / org / opendaylight / yangtools / concepts / AbstractIllegalArgumentCodecTest.java
1 /*
2  * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.concepts;
9
10 import static org.junit.jupiter.api.Assertions.assertThrows;
11
12 import org.junit.jupiter.api.Test;
13
14 @Deprecated(since = "8.0.0", forRemoval = true)
15 public class AbstractIllegalArgumentCodecTest {
16     private static final class TestCodec extends AbstractIllegalArgumentCodec<String, String> {
17         @Override
18         protected String deserializeImpl(final String product) {
19             throw new AssertionError("Should never be invoked");
20         }
21
22         @Override
23         protected String serializeImpl(final String input) {
24             throw new AssertionError("Should never be invoked");
25         }
26     }
27
28     private final TestCodec codec = new TestCodec();
29
30     @Test
31     public void testNullDeserialize() {
32         assertThrows(NullPointerException.class, () -> codec.deserialize(null));
33     }
34
35     @Test
36     public void testNullSerialize() {
37         assertThrows(NullPointerException.class, () -> codec.serialize(null));
38     }
39 }