### Question:
OneTimeTokenSessionDAO extends DefaultDAOBase<Integer, OneTimeTokenSession> { public int consumeToken(String token) { Query query = this.getSession().createQuery(CONSUME_TOKEN); query.setString("token", token); return query.executeUpdate(); } OneTimeTokenSessionDAO();  OneTimeTokenSessionDAO(EntityManager entityManager); int consumeToken(String token);  }### Answer:
@Test public void consumeToken() { String text = "FAKE!"; OneTimeTokenSession t = eg().createUniqueInstance(text); ds().persistAll(t); OneTimeTokenSessionDAO dao = createDaoForRollbackTransaction(); int n = dao.consumeToken(text); Assert.assertEquals(n, 1); }