package org.opendaylight.mdsal.binding.java.api.generator;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import com.google.common.collect.ImmutableList;
import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
import org.junit.Test;
import org.opendaylight.mdsal.binding.model.api.ConcreteType;
import org.opendaylight.mdsal.binding.model.api.GeneratedProperty;
TypeUtils.getBaseYangType(innerType);
}
- @Test(expected = UnsupportedOperationException.class)
- public void constructTest() throws Throwable {
+ @Test
+ public void constructTest() throws ReflectiveOperationException {
final Constructor<TypeUtils> constructor = TypeUtils.class.getDeclaredConstructor();
constructor.setAccessible(true);
try {
constructor.newInstance();
- } catch (Exception e) {
- throw e.getCause();
+ fail();
+ } catch (InvocationTargetException e) {
+ assertTrue(e.getCause() instanceof UnsupportedOperationException);
}
}
}
\ No newline at end of file