title: Integration vs Unit Testing
body: <p>Im developing with Grails.  Since the framework will bootstrap data and a fully flushed out spring context, I find that I write a lot of integration tests for services.  Let me rephrase that:  I find I write no unit tests for services, only integration tests.  Is this a bad idea?  The only downside I see to it is that my tests take a bit longer to run.  </p>
  
  <p>I do use unit testing on controllers, as in a controller I am testing the various application flows, result types, redirect logic, etc.  But the majority of tests I write are integration tests.  This seems a break from tradition J2EE tests, where mostly unit tests are written.  </p>
  
  <p>edit- to be clear, Im not writing integration tests because the code is so complicated only integration tests will do.  Im writing integration tests because it is easier to test everything together, since the framework gives you so much.  I do mock certain things, like if a service collaborates with the acegi authenticationService, I mock that.  I also mock anytime we interact with a webservice, because you have to in order to get a test that runs without special setup.  </p>