/* * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.mdsal.binding.javav2.dom.codec; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import org.junit.Test; import org.opendaylight.mdsal.binding.javav2.dom.codec.api.BindingNormalizedNodeCodec; import org.opendaylight.mdsal.binding.javav2.dom.codec.impl.NonCachingCodec; public class NonCachingCodecTest { @SuppressWarnings({ "rawtypes", "unchecked", "resource" }) @Test public void basicTest() throws Exception { final BindingNormalizedNodeCodec codec = mock(BindingNormalizedNodeCodec.class); doReturn(null).when(codec).serialize(null); doReturn(null).when(codec).deserialize(null); final NonCachingCodec nonCachingCodec = new NonCachingCodec<>(codec); nonCachingCodec.serialize(null); verify(codec).serialize(null); nonCachingCodec.deserialize(null); verify(codec).deserialize(null); } }