How do I unit test a Grails service that uses a converter?
问题 I have a Grails service that sends out e-mails using a 3rd-party service by doing a HTTP call: class EmailService { def sendEmail(values) { def valueJson = values as JSON ... // does HTTP call to 3rd party service } } I've written a unit test to test this service (because an integration test spins up Hibernate and the entire domain framework, which I don't need): @TestFor(EmailService) class EmailServiceTests { void testEmailServiceWorks() { def values = [test: 'test', test2: 'test2'] service