Fix checkstyle in mdsal-binding-generator-impl
[mdsal.git] / binding / mdsal-binding-generator-impl / src / test / java / org / opendaylight / mdsal / binding / generator / impl / YangTextTemplateTest.java
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. 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.mdsal.binding.generator.impl;
9
10 import static org.junit.Assert.assertTrue;
11 import static org.junit.Assert.fail;
12
13 import java.lang.reflect.Constructor;
14 import java.lang.reflect.InvocationTargetException;
15 import org.junit.Test;
16 import org.opendaylight.mdsal.binding.model.util.FormattingUtils;
17
18 public class YangTextTemplateTest {
19     @Test
20     public void privateConstructTest() throws ReflectiveOperationException  {
21         final Constructor<FormattingUtils> constructor = FormattingUtils.class.getDeclaredConstructor();
22         constructor.setAccessible(true);
23         try {
24             constructor.newInstance();
25             fail();
26         } catch (InvocationTargetException e) {
27             assertTrue(e.getCause() instanceof UnsupportedOperationException);
28         }
29     }
30 }