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 8539131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:17:25+00:00 2026-06-11T11:17:25+00:00

I am following an example in the Grails In Action book. My integration test

  • 0

I am following an example in the Grails In Action book. My integration test is failing because the searches in the example code are returning null references. I used a call to findAll() and now it appears my test data is not saving; all.size is coming back as zero.

void testBasicDynamicFinders() {

        new User(userId: 'glen', password: 'secret', profile: new Profile(email: 'glen@glensmith.com')).save()
        new User(userId: 'peter', password: 'sesame', profile: new Profile(homepage: 'http://www.peter.com/')).save()

        def all = User.findAll()
        assertEquals 2, all.size()
}

I have tried using save(flush: true) to no avail.

I have also enclosed one of the save statements in a try…catch structure, but no exception appears to be raised.

Grails is really kicking my butt. Please help me?

  • 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-06-11T11:17:26+00:00Added an answer on June 11, 2026 at 11:17 am

    If you use

    save( failOnError:true )
    

    Then it should show you any validation errors that are preventing the domain objects from being saved 🙂

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

Sidebar

Related Questions

I'm following the racetrack example from Jason Rudolph's book at InfoQ , using grails-1.2.1.
I was following the Grails in Action book in order to create the following
I am following the example in Grails in Action. I have an issue understanding
Following an example with custom exception handling in Grails, I came to the following
The grails manual shows the following example: <g:set var=now value=${new Date()} scope=request /> and
Take following example of code: (ASP.NET WebForms) <asp:Content ContentPlaceHolderID=Contents runat=server> <div class=blogpost-list> <asp:Repeater ID=blogList
The following example code (SSCCE) complains that local variable a must be final. public
Consider following example code: #include <iostream> #include <inttypes.h> using namespace std; int f(uint32_t i)
In following example: Line1 <br /> Line2 I'm using <br /> to force Line2
The following example will not compile for me: #include <iostream> #include <functional> #include <string>

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.