2 * Copyright (c) 2016 Cisco Systems, Inc. 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.binding.data.codec.impl;
10 import static org.mockito.Mockito.doReturn;
11 import static org.mockito.Mockito.mock;
12 import static org.mockito.Mockito.verify;
14 import org.junit.Test;
15 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeCodec;
17 public class NonCachingCodecTest {
20 public void basicTest() throws Exception {
21 final BindingNormalizedNodeCodec codec = mock(BindingNormalizedNodeCodec.class);
22 doReturn(null).when(codec).serialize(null);
23 doReturn(null).when(codec).deserialize(null);
24 final NonCachingCodec nonCachingCodec = new NonCachingCodec<>(codec);
25 nonCachingCodec.serialize(null);
26 verify(codec).serialize(null);
27 nonCachingCodec.deserialize(null);
28 verify(codec).deserialize(null);