//when
final List<User> users = tx.execute(new TransactionCallback<List<User>>() {
@Override
public List<User> doInTransaction(TransactionStatus status) {
final User user = new User("john", new Date(), 0, false);
userRepository.save(user);
return userRepository.findAll();
}
});
//then