Skip to content

Instantly share code, notes, and snippets.

@gilbertolptn
Last active February 26, 2021 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilbertolptn/fac0a3132219aec6e0bba9ed35e1f30c to your computer and use it in GitHub Desktop.
Save gilbertolptn/fac0a3132219aec6e0bba9ed35e1f30c to your computer and use it in GitHub Desktop.
@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