-
Notifications
You must be signed in to change notification settings - Fork 41.2k
spring.test.database.replace property ignored #7229
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
Comments
What did you see that caused you to draw that conclusion? The |
Ah I was also getting some information from here, http://www.devthoughts.pl/2016/08/02/datajpatest-from-spring-boot/, but I guess that's wrong then. Is there any way to avoid the annotation based config? I'd rather not have to put an annotation on every test and instead use a property. |
There isn't currently a way to do this. I think it should be possible to create your own meta-annotation if that helps. Something like: @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
@DataJpaTest
@AutoConfigureTestDatabase(replace=Replace.NONE_
public @interface MyDataJpaTest {
} Doing something like we did for |
Ah, darn, I thought that might be the only way. Ok, well thank you for the help then. |
Closing in favour of PR #7560 |
* pr/7560: Polish contribution Add support for property spring.test.database.replace
Looking at the annotation
AutoConfigureTestDatabase
, I should be able to use the propertyspring.test.database.replace
to avoid annotation based configuration for all of my tests (we are using custom postgres dialect and can't get hsqldb to work). Attempting to use this property does not work though. I will attempt to create a project showing the problem later.The text was updated successfully, but these errors were encountered: