@Test
  public void testRollbackIllegalStateException() throws Exception {
    try {
      utx.begin();
      GlobalTransaction gtx = tm.getGlobalTransaction();
      gtx.setStatus(Status.STATUS_UNKNOWN);
      utx.rollback();
      fail("IllegalStateException not thrown on rollback");
    } catch (IllegalStateException e) {
      GlobalTransaction gtx = tm.getGlobalTransaction();
      gtx.setStatus(Status.STATUS_ACTIVE);
      utx.commit();
    }
  }
Check if the correct expectations are being thrown when they are supposed to.
geode-core/src/integrationTest/java/org/apache/geode/internal/jta/ExceptionJUnitTest.java