EntityTransactionImpl implements EntityTransaction { @Override public boolean isRollbackOnly() { verifyTransactionActive("isRollbackOnly"); return this.rollbackOnly; } EntityTransactionImpl(EntityTransactionWrapper wrapper); @Override void begin(); @Override void commit(); @Override void rollback(); @Override void setRollbackOnly(); @Override boolean isRollbackOnly(); @Override boolean isActive();  }
@Test public void testGetRollbackOnlyNotActive() { assertThrows(IllegalStateException.class, () -> transaction.isRollbackOnly()); }