Skip to content

@Transactional JUnit tests #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jansvajcr opened this issue Dec 17, 2019 · 3 comments
Closed

@Transactional JUnit tests #258

jansvajcr opened this issue Dec 17, 2019 · 3 comments
Labels
for: external-project For an external project and not something we can fix

Comments

@jansvajcr
Copy link

Since we have @Transactional working with R2DBC repositories in 1.0 M2 (as said here), I would like to ask if there is a way to make @Transactional working with JUnit (integration) tests (the same way we are able to do when using JDBC repositories). Is this currently possible? Will this even be possible? What is the right approach to achieve transactional tests ?

Currently, running a @Transactional @SpringBootTest gives me java.lang.IllegalStateException: Failed to retrieve PlatformTransactionManager for @Transactional test (the same problem as this guy has: http://disq.us/p/2425ot1).

@mp911de
Copy link
Member

mp911de commented Dec 17, 2019

Thanks for bringing up this topic. This ticket rather belongs to Spring Framework. Can you file there a copy of this ticket?

Right now, we don't have the possibility to use @Transactional on test methods when testing reactive transactions. The only supported approach is moving the Publisher into a @Transactional service method. Clearly, this approach allows testing of transactional flows but it won't roll back.

@mp911de mp911de added the for: external-project For an external project and not something we can fix label Dec 17, 2019
@jansvajcr
Copy link
Author

Here's a copy: spring-projects/spring-framework#24226

@mp911de
Copy link
Member

mp911de commented Dec 18, 2019

Thanks a lot. Closing this ticket in favor of the one in Spring Framework.

@mp911de mp911de closed this as completed Dec 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix
Projects
None yet
Development

No branches or pull requests

2 participants