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.sal.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.yangtools.yang.model.api.type.UnionTypeDefinition;
18 public class XtendHelperTest {
21 public void getTypesTest() throws Exception {
22 final UnionTypeDefinition unionTypeDefinition = mock(UnionTypeDefinition.class);
23 doReturn(null).when(unionTypeDefinition).getTypes();
24 XtendHelper.getTypes(unionTypeDefinition);
25 verify(unionTypeDefinition).getTypes();
28 @Test(expected = UnsupportedOperationException.class)
29 public void privateConstructTest() throws Throwable {
30 final Constructor constructor = XtendHelper.class.getDeclaredConstructor();
31 constructor.setAccessible(true);
33 constructor.newInstance();
34 } catch (Exception e) {