### Question:
JdbcMethodInvocation { public void invoke(final Object target) { try { method.invoke(target, arguments); } catch (final IllegalAccessException | InvocationTargetException ex) { throw new ShardingJdbcException("Invoke jdbc method exception", ex); } }  void invoke(final Object target);  }### Answer:
@Test public void assertInvokeSuccess() throws NoSuchMethodException, SecurityException { JdbcMethodInvocation actual = new JdbcMethodInvocation(String.class.getMethod("length"), new Object[] {}); actual.invoke(""); }
@Test(expected = ShardingJdbcException.class) public void assertInvokeFailure() throws NoSuchMethodException, SecurityException { JdbcMethodInvocation actual = new JdbcMethodInvocation(String.class.getDeclaredMethod("indexOfSupplementary", int.class, int.class), new Object[] {1, 1}); actual.invoke(""); }