Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update Springboot properties at runtime Hibernate/JPA

I need to update the config spring.jpa.hibernate.ddl-auto for one of my test classes. It should remain as update for all classes except one.

How do I achieve this at run time when session is being managed by Springboot? Or is there some other way out? I had the option to create a session afresh and use it as here but session is not managed manually.

like image 831
Rajeev Ranjan Avatar asked Sep 08 '25 12:09

Rajeev Ranjan


1 Answers

Well, simply adding @TestPropertySource(properties = "spring.jpa.hibernate.ddl-auto = none") on a test class should work. That's all:)

like image 192
Dmitry Senkovich Avatar answered Sep 10 '25 03:09

Dmitry Senkovich