Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6817997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:07:22+00:00 2026-05-26T21:07:22+00:00

I am running an Integration Test for a Grails application. I am using the

  • 0

I am running an Integration Test for a Grails application. I am using the easyb plugin. The problem is that the database doesn’t seem to get cleared out between Scenarios. My When I run standard Grails Integration Tests, the persistence context is cleared between each test. The easyb Stories are in the Integration folder, but the Grails Integration Test rules don’t seem to apply here… So how do you make easyb clean up after itself?

P.S. I’m defining multiple scenarios in the same groovy file fwiw, but I don’t think this is necessarily pertinent.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T21:07:23+00:00Added an answer on May 26, 2026 at 9:07 pm

    Just incase somebody like me is still dealing with this issue and looking for a way to rollback after each test scenario, below is a solution that works (thanks to Burt Beckwith’s blog).

    Wrap each easyb test scenario in a with transaction block and manually rollback at the end

    scenario "add person should be successful", {
    Person.withTransaction { status -> 
        given "no people in database", {
        }
        when "I add a person", {
            Person.build()
        }
        then "the number of people in database is one", {
            Person.list().size().shouldEqual 1
        }
        status.setRollbackOnly()
    }
    }
    
    scenario "database rollback should be successful", {
    given "the previous test created a person", {
    }
    when "queried for people", {
        people = Person.list().size()
    }
    then "the number of people should be zero", {
        people.shouldEqual 0
    }
    }
    

    The above test passes.
    Please post if you have a better solution to the problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to test my grails app using integration test that makes http requests.
Running into a problem where on certain servers we get an error that the
So i have a small integration test that houses 5 tests in total. Running
I get the following error when running any NUnit integration test - Assembly setup
I am running my tests for a rails application using test/unit and capybara. I
I have an integration test that needs to coordinate two DatagramSockets , each running
i'm having a problem running an integration test through Gallio. The test works fine
What techniques are available to profile services running in WebMethods Integration Server? That is,
I've got Hudson (continuous integration system) with the git plugin running on a Tomcat
We have been using TeamBuild and test for our continuous integration build for about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.