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.mdsal.binding.generator.util;
10 import static org.mockito.Mockito.doReturn;
11 import static org.mockito.Mockito.mock;
12 import static org.mockito.Mockito.verify;
14 import java.lang.reflect.Constructor;
15 import org.junit.Test;
16 import org.opendaylight.mdsal.binding.generator.util.XtendHelper;
17 import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition;
19 public class XtendHelperTest {
22 public void getTypesTest() throws Exception {
23 final UnionTypeDefinition unionTypeDefinition = mock(UnionTypeDefinition.class);
24 doReturn(null).when(unionTypeDefinition).getTypes();
25 XtendHelper.getTypes(unionTypeDefinition);
26 verify(unionTypeDefinition).getTypes();
29 @Test(expected = UnsupportedOperationException.class)
30 public void privateConstructTest() throws Throwable {
31 final Constructor constructor = XtendHelper.class.getDeclaredConstructor();
32 constructor.setAccessible(true);
34 constructor.newInstance();
35 } catch (Exception e) {