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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:28:35+00:00 2026-05-25T09:28:35+00:00

I am having problems integration testing my Grails service because the service under test

  • 0

I am having problems integration testing my Grails service because the service under test is not being injected in to my test. I have followed the advice from answers to questions else where on Stackoverflow but as yet can not get my service injected. The following class is under /<project_root>/test/integration/com/example:

package com.example

import grails.test.GrailsUnitTestCase

class MyServiceIntegrationTest extends GroovyTestCase {

    MyService service;

    public void testService() {
        assert service != null
    }
}

I have tried executing both from the command-line (grails test-app) and from within IDEA both result in the same failure, namely service is null

This is Grails 1.3.6

Any suggestions on how to get my integration test working please?

  • 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-25T09:28:36+00:00Added an answer on May 25, 2026 at 9:28 am

    Autowiring works the same way in integration tests as in other parts of the framework, so you need to make sure the property is named like the service except with the appropriate unCamelCase.

    class MyServiceIntegrationTest extends GroovyTestCase {
        def myService
    
    }
    

    Assuming your service is an object named MyService.

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

Sidebar

Related Questions

I'm having problems making Capybara work with Rails. Just testing that suposedly interesting test
Im having problems with classpaths. I have used them before with import but I'm
I have recently started having problems with TortoiseCVS, or more specifically with plink, the
I'm having a problem with setting up a WCF web service integration with a
I am after some advice and pointers on integration testing for a web app.
I am having some problems while trying to create integration tests with Selenium and
i'm having a problem running an integration test through Gallio. The test works fine
I have SQL Server 2005 install on my PC and am having execution problems
I'm having some problems integrating MS MapPoint 2009 into my WinForms .Net 2.0 application
Having problems with a small awk script, Im trying to choose the newest of

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.