Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think you need to set up transactions properly, take a look at this link:</p> <p><a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/testing.html#testcontext-tx" rel="nofollow">http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/testing.html#testcontext-tx</a></p> <p>So you probably need the following annotations on your class:</p> <p>@ContextConfiguration(...) // context should include transaction manager<br> @TransactionConfiguration(...) // name of transaction manager if non-default<br> @Transactional</p> <p>By default I believe a transaction will then be created for each test and rolled back at the end of each test (so you won't see any changes to the db after the tests have run). </p> <p>Typically you don't want your test data persisted. If you do, you can change the default rollback behaviour within the @TransactionConfiguration annotation at class level or with the @Rollback annotation at test level, see:</p> <p><a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/testing.html#integration-testing-annotations" rel="nofollow">http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/testing.html#integration-testing-annotations</a></p> <p>In terms of testing updates/deletes, I don't suggest you change the default rollback behaviour. Instead you could find the object (within the same test and therefore transaction) after the update and assert your changes.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload