title: Cannot create mock for class LoginService. Mocking of non-interface types requires the CGLIB library..?
body: <p>I'm using grails 2.4.2 and by default it already has spock installed right? Well, one of my controller tests isn't working quite right. I'm trying to mock several of my services, but I keep getting this error:</p>
  
  <pre><code> Failure:  confirmEmailAddress() when verification failed(com.zee.RegistrationControllerSpec)
  |  org.spockframework.mock.CannotCreateMockException: Cannot create mock for class com.zee.LoginService. Mocking of non-interface types requires the CGLIB library. Please put cglib-nodep-2.2 or higher on the class path.
      at org.spockframework.mock.runtime.ProxyBasedMockFactory.create(ProxyBasedMockFactory.java:52)
      at org.spockframework.mock.runtime.JavaMockFactory.create(JavaMockFactory.java:51)
      at org.spockframework.mock.runtime.CompositeMockFactory.create(CompositeMockFactory.java:44)
      at org.spockframework.lang.SpecInternals.createMock(SpecInternals.java:47)
      at org.spockframework.lang.SpecInternals.createMockImpl(SpecInternals.java:282)
      at org.spockframework.lang.SpecInternals.MockImpl(SpecInternals.java:83)
      at com.zee.RegistrationControllerSpec.setup(RegistrationControllerSpec.groovy:22)
  </code></pre>
  
  <p>I couldn't really find anything on the internet about this. My controllerSpec looks like this:</p>
  
  <pre><code>import grails.test.mixin.TestFor
  import spock.lang.Specification
  
  @TestFor(RegistrationController)
  class RegistrationControllerSpec extends Specification {
  
      LoginService loginService
  
      EmailAddressConfirmationService emailAddressConfirmationService
  
      EmailNotificationService emailNotificationService
  
      AccountRecordService accountRecordService
  
      def setup() {
          loginService = Mock()
          emailAddressConfirmationService = Mock()
          emailNotificationService = Mock()
          accountRecordService = Mock()
  
          controller.loginService = loginService
          controller.emailAddressConfirmationService = emailAddressConfirmationService
          controller.emailNotificationService = emailNotificationService
          controller.accountRecordService = accountRecordService
      }
  
      def cleanup() {
      }
  
      void "confirmEmailAddress() when verification failed"() {
          // some test here....
      }
  }
  </code></pre>
  
  <p>My Service is even simpler:</p>
  
  <pre><code>import grails.transaction.Transactional
  
  @Transactional
  class LoginService {
  
      def registerUser(Login login) {
          login.pincode = "";
          login.groupId = Login.REGISTERED_USER_GROUP_ID
          login.save(flush :true)
      }
  
      public void userJoined(Login login) {
          login.save(flush: true)
      }
  }
  </code></pre>
  
  <p>I am stomped. Even a grails clean wouldn't do the trick.. Any help? D:</p>