@Test
  public void testInsert() throws Exception {
    final Connection cnn = databaseTestUtils.getConnection();
    try {
      int recordCountBefore = countUsers(cnn);

      // persist the user
      final UserEntityHandler handler = new UserEntityHandler();
      final int userId = handler.insert(cnn, "test@test" + (new Random().nextInt()) + ".com");

      assertTrue("Expected the user to have an ID after a persist", userId > 0);

      int recordCountAfter = countUsers(cnn);
      assertEquals(
          "Expected there to be only one record in the database after the persist",
          recordCountBefore + 1,
          recordCountAfter);
    } finally {
      DbUtils.close(cnn);
    }
  }