test_class.file: model/src/test/java/com/abiquo/server/core/enterprise/OneTimeTokenSessionDAOTest.java
test_class.identifier: OneTimeTokenSessionDAOTest
test_class.superclass: extends
      DefaultDAOTestBase<OneTimeTokenSessionDAO, OneTimeTokenSession>
test_case.body: @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);
      }
test_case.class_method_signature: OneTimeTokenSessionDAOTest.consumeToken()
test_case.full_signature: @Test public void consumeToken()
test_case.identifier: consumeToken
test_case.invocations: createUniqueInstance eg persistAll ds createDaoForRollbackTransaction consumeToken assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void consumeToken()
focal_class.declarator: CONSUME_TOKEN = "delete " + OneTimeTokenSession.class.getSimpleName()
          + " where token = :token"
focal_class.modifier: private static
focal_class.original_string: private static String CONSUME_TOKEN = "delete " + OneTimeTokenSession.class.getSimpleName()
          + " where token = :token";
focal_class.type: String
focal_class.var_name: CONSUME_TOKEN
focal_class.file: model/src/main/java/com/abiquo/server/core/enterprise/OneTimeTokenSessionDAO.java
focal_class.identifier: OneTimeTokenSessionDAO
focal_class.class_method_signature: OneTimeTokenSessionDAO.OneTimeTokenSessionDAO()
focal_class.full_signature: public  OneTimeTokenSessionDAO()
focal_class.identifier: OneTimeTokenSessionDAO
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  OneTimeTokenSessionDAO()
focal_class.class_method_signature: OneTimeTokenSessionDAO.OneTimeTokenSessionDAO(EntityManager entityManager)
focal_class.full_signature: public  OneTimeTokenSessionDAO(EntityManager entityManager)
focal_class.identifier: OneTimeTokenSessionDAO
focal_class.modifiers: public
focal_class.parameters: (EntityManager entityManager)
focal_class.signature:  OneTimeTokenSessionDAO(EntityManager entityManager)
focal_class.class_method_signature: OneTimeTokenSessionDAO.consumeToken(String token)
focal_class.full_signature: public int consumeToken(String token)
focal_class.identifier: consumeToken
focal_class.modifiers: public
focal_class.parameters: (String token)
focal_class.return: int
focal_class.signature: int consumeToken(String token)
focal_class.superclass: extends DefaultDAOBase<Integer, OneTimeTokenSession>
focal_method.body: public int consumeToken(String token)
      {
          Query query = this.getSession().createQuery(CONSUME_TOKEN);
          query.setString("token", token);
          return query.executeUpdate();
      }
focal_method.class_method_signature: OneTimeTokenSessionDAO.consumeToken(String token)
focal_method.full_signature: public int consumeToken(String token)
focal_method.identifier: consumeToken
focal_method.invocations: createQuery getSession setString executeUpdate
focal_method.modifiers: public
focal_method.parameters: (String token)
focal_method.return: int
focal_method.signature: int consumeToken(String token)