Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@DataJpaTest
@ActiveProfiles("test")
/*
By default @DataJpaTest uses embeded h2 database and ignores the connection string declared in application.properties.
This annotation disables this behavior and db configured in bootstrap.yml will be used by @DataJpaTest test.
*/
@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE)
@Sql("classpath:my_data.sql")
class MyRepositoryTest {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment