Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.75 KB | None | 0 0
  1. @Test
  2.     void factorialIterShouldThrowInputCanNotBeConvertedToIntegerException() {
  3.         try {
  4.             Constructor<FactorialIter> c = FactorialIter.class.getDeclaredConstructor();
  5.             c.setAccessible(true);
  6.             FactorialIter u = c.newInstance();
  7.             Class[] cArg = new Class[1];
  8.             cArg[0] = String.class;
  9.             Method method = FactorialIter.class.getDeclaredMethod("convertStringToInteger", cArg);
  10.             method.setAccessible(true);
  11.             Object out = method.invoke(u, "some input");
  12.             System.out.println(out);
  13.         } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException e) {
  14.             e.printStackTrace();
  15.         }
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement