Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Grails 2.0.3 Integration test failing for strange reason(save() on domain model not available for second call to setup method)
- import org.junit.*
- import grails.test.mixin.TestFor
- @TestFor(OrderController)
- class OrderControllerIntegrationTests {
- public EndUser user
- @Before public void initialize() {
- user = new EndUser(username: UUID.randomUUID().toString(), password: "secret");
- user.save()
- }
- @Test public void get() {
- assert true
- }
- @Test public void create() {
- assert true
- }
- }
- Testsuite: exampleapp.OrderControllerIntegrationTests
- Tests run: 2, Failures: 0, Errors: 1, Time elapsed: 0.769 sec
- ------------- Standard Output ---------------
- --Output from get--
- 2012-05-15 22:35:03,491 [main] DEBUG transaction.JDBCTransaction - begin
- 2012-05-15 22:35:03,493 [main] DEBUG transaction.JDBCTransaction - current autocommit status: true
- 2012-05-15 22:35:03,493 [main] DEBUG transaction.JDBCTransaction - disabling autocommit
- 2012-05-15 22:35:03,689 [main] DEBUG hibernate.SQL - insert into widget_user (id, version, password, username, class) values (null, ?, ?, ?, 'exampleapp.EndUser')
- 2012-05-15 22:35:03,970 [main] DEBUG transaction.JDBCTransaction - rollback
- 2012-05-15 22:35:03,970 [main] DEBUG transaction.JDBCTransaction - re-enabling autocommit
- 2012-05-15 22:35:03,970 [main] DEBUG transaction.JDBCTransaction - rolled back JDBC Connection
- --Output from create--
- 2012-05-15 22:35:03,979 [main] DEBUG transaction.JDBCTransaction - begin
- 2012-05-15 22:35:03,979 [main] DEBUG transaction.JDBCTransaction - current autocommit status: true
- 2012-05-15 22:35:03,979 [main] DEBUG transaction.JDBCTransaction - disabling autocommit
- 2012-05-15 22:35:04,207 [main] DEBUG transaction.JDBCTransaction - rollback
- 2012-05-15 22:35:04,207 [main] DEBUG transaction.JDBCTransaction - re-enabling autocommit
- 2012-05-15 22:35:04,207 [main] DEBUG transaction.JDBCTransaction - rolled back JDBC Connection
- ------------- ---------------- ---------------
- ------------- Standard Error -----------------
- --Output from get--
- --Output from create--
- ------------- ---------------- ---------------
- Testcase: get took 0.51 sec
- Testcase: create took 0.251 sec
- Caused an ERROR
- No signature of method: exampleapp.EndUser.save() is applicable for argument types: () values: []
- Possible solutions: save(), save(), save(boolean), save(java.util.Map), save(boolean), save(java.util.Map)
- groovy.lang.MissingMethodException: No signature of method: exampleapp.EndUser.save() is applicable for argument types: () values: []
- Possible solutions: save(), save(), save(boolean), save(java.util.Map), save(boolean), save(java.util.Map)
- at exampleapp.OrderControllerIntegrationTests.initialize(OrderControllerIntegrationTests.groovy:17)
- @TestFor(OrderController)
- @Mock([EndUser])
- class OrderControllerIntegrationTests{
Add Comment
Please, Sign In to add comment