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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:08:20+00:00 2026-06-04T17:08:20+00:00

I have the following code: void testConfirmBookNotFound() { def book = new Book(id: 1,

  • 0

I have the following code:

void testConfirmBookNotFound() {

    def book = new Book(id: 1, title: 'test book')
    mockDomain(Book, [book])
    mockDomain(BookProject, [new BookProject(id: 1, book: book)])

    def controller = new CancelController()
    controller.params.id = 5140
    controller.confirm()

    assertEquals "/admin/cancel/index", controller.response.redirectedUrl
}

If my test class extends ControllerUnitTestCase then controller.response.redirectedUrl is always null. However, if my test class extends GrailsUnitTestCase (which I’ve read is the fix for the null url issue) then I get No such property: params. What do I need to do to get this test to work?

  • 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-04T17:08:24+00:00Added an answer on June 4, 2026 at 5:08 pm

    Try using controller.redirectArgs.action as in…

    assertThat(controller.redirectArgs.action, equalTo("index"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: void Processmethod() { QDialog *ProcessMessage = new QDialog; Ui::DialogProcessMessage
I have the following source code: void Processmethod() { QDialog *ProcessMessage = new QDialog;
I have following code public class TEST { public static void main(String arg[]){ try
Suppose I have the following code: void* my_alloc (size_t size) { return new char
SO I have the following code public void rand(int N){ double[]x=new double[N]; double[]y=new double[N];
I have the following code void foo() { char* pcBlock = new char[1000]; ...
I have the following code void Test() { BSTR aBstr = ::SysAllocString(Lblah); PrintBSTR(aBstr); ::SysFreeString(aBstr);
I have the following code : void testCopy(){ Balloon* b1=new Balloon(1,5,6,3); Balloon* b2=new Ballon(2,4,4,2);
I have the following source code: void Processmethod() { QDialog *ProcessMessage = new QDialog;
I have following code: private void ProcessQueue() { foreach (MessageQueueItem item in GetNextQueuedItem()) PerformAction(item);

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.