@Test
public void testThrowing() throws Exception {

  Logger logger = createNiceMock(Logger.class);
  Formatter formatter = createNiceMock(Formatter.class);
  Exception exception = new IllegalStateException("Something went wrong!");
  JpaLogger jpaLogger = new TestJpaLogger(logger, formatter);
  // set expectations
  logger.error(null, exception);
  // replay
  replay(logger, formatter);
  jpaLogger.throwing(exception);
  // verify
  verify(logger, formatter);
}