Guest User

Untitled

a guest
Sep 10th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.82 KB | None | 0 0
  1. Grails 2.0.3 Integration test failing for strange reason(save() on domain model not available for second call to setup method)
  2. import org.junit.*
  3. import grails.test.mixin.TestFor
  4.  
  5. @TestFor(OrderController)
  6. class OrderControllerIntegrationTests {
  7.  
  8. public EndUser user
  9.  
  10. @Before public void initialize() {
  11. user = new EndUser(username: UUID.randomUUID().toString(), password: "secret");
  12. user.save()
  13. }
  14.  
  15. @Test public void get() {
  16. assert true
  17. }
  18.  
  19. @Test public void create() {
  20. assert true
  21. }
  22.  
  23. }
  24.  
  25. Testsuite: exampleapp.OrderControllerIntegrationTests
  26. Tests run: 2, Failures: 0, Errors: 1, Time elapsed: 0.769 sec
  27. ------------- Standard Output ---------------
  28. --Output from get--
  29. 2012-05-15 22:35:03,491 [main] DEBUG transaction.JDBCTransaction - begin
  30.  
  31. 2012-05-15 22:35:03,493 [main] DEBUG transaction.JDBCTransaction - current autocommit status: true
  32.  
  33. 2012-05-15 22:35:03,493 [main] DEBUG transaction.JDBCTransaction - disabling autocommit
  34.  
  35. 2012-05-15 22:35:03,689 [main] DEBUG hibernate.SQL - insert into widget_user (id, version, password, username, class) values (null, ?, ?, ?, 'exampleapp.EndUser')
  36.  
  37. 2012-05-15 22:35:03,970 [main] DEBUG transaction.JDBCTransaction - rollback
  38.  
  39. 2012-05-15 22:35:03,970 [main] DEBUG transaction.JDBCTransaction - re-enabling autocommit
  40.  
  41. 2012-05-15 22:35:03,970 [main] DEBUG transaction.JDBCTransaction - rolled back JDBC Connection
  42.  
  43. --Output from create--
  44. 2012-05-15 22:35:03,979 [main] DEBUG transaction.JDBCTransaction - begin
  45.  
  46. 2012-05-15 22:35:03,979 [main] DEBUG transaction.JDBCTransaction - current autocommit status: true
  47.  
  48. 2012-05-15 22:35:03,979 [main] DEBUG transaction.JDBCTransaction - disabling autocommit
  49.  
  50. 2012-05-15 22:35:04,207 [main] DEBUG transaction.JDBCTransaction - rollback
  51.  
  52. 2012-05-15 22:35:04,207 [main] DEBUG transaction.JDBCTransaction - re-enabling autocommit
  53.  
  54. 2012-05-15 22:35:04,207 [main] DEBUG transaction.JDBCTransaction - rolled back JDBC Connection
  55.  
  56. ------------- ---------------- ---------------
  57. ------------- Standard Error -----------------
  58. --Output from get--
  59. --Output from create--
  60. ------------- ---------------- ---------------
  61.  
  62. Testcase: get took 0.51 sec
  63. Testcase: create took 0.251 sec
  64. Caused an ERROR
  65. No signature of method: exampleapp.EndUser.save() is applicable for argument types: () values: []
  66. Possible solutions: save(), save(), save(boolean), save(java.util.Map), save(boolean), save(java.util.Map)
  67. groovy.lang.MissingMethodException: No signature of method: exampleapp.EndUser.save() is applicable for argument types: () values: []
  68. Possible solutions: save(), save(), save(boolean), save(java.util.Map), save(boolean), save(java.util.Map)
  69. at exampleapp.OrderControllerIntegrationTests.initialize(OrderControllerIntegrationTests.groovy:17)
  70.  
  71. @TestFor(OrderController)
  72. @Mock([EndUser])
  73. class OrderControllerIntegrationTests{
Add Comment
Please, Sign In to add comment