Skip to content

Commit

Permalink
support all relevant Spring Boot test slices
Browse files Browse the repository at this point in the history
  • Loading branch information
lbruun committed May 13, 2024
1 parent 867d264 commit dbfbd17
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 4 deletions.
14 changes: 11 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,18 @@ You should work on that first and only use this setting as a last resort.

=== Spring Boot tests

==== Spring Boot `@DataJpaTest` test slice
==== Spring Boot test slices

You can use Spring Boot's `@DataJpaTest` annotation as you normally would because the Pre-Liquibase module
registers itself as one of the auto-configs which are in-scope when this annotation is applied to a test class.
Pre-Liquibase directly supports the following Spring Boot test slices:

- `@DataJdbcTest` (since version 1.0.0)
- `@DataJpaTest` (since version 1.5.1)
- `@DataR2dbcTest` (since version 1.5.1)
- `@JdbcTest` (since version 1.5.1)
- `@JooqTest` (since version 1.5.1)

You can use the above annotations as you normally would because the Pre-Liquibase module
registers itself as one of the auto-configs which are in-scope when such annotation is applied to a test class.

The link:examples/example1/[example project] showcases this.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# (additional) AutoConfigureDataJdbc auto-configuration imports
# .. for tests.
#
# Add Pre-Liquibase class to list of classes autowired when @AutoConfigureDataJdbc
# or @DataJdbcTest annotations are used in unit tests.
net.lbruun.springboot.preliquibase.PreLiquibaseAutoConfiguration

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# (additional) AutoConfigureDataR2dbc auto-configuration imports
# .. for tests.
#
# Add Pre-Liquibase class to list of classes autowired when @AutoConfigureDataR2dbc
# or @DataR2dbcTest annotations are used in unit tests.
net.lbruun.springboot.preliquibase.PreLiquibaseAutoConfiguration

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# (additional) AutoConfigureJdbc auto-configuration imports
# .. for tests.
#
# Add Pre-Liquibase class to list of classes autowired when @AutoConfigureJdbc
# or @JdbcTest annotations are used in unit tests.
net.lbruun.springboot.preliquibase.PreLiquibaseAutoConfiguration

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# (additional) AutoConfigureJooq auto-configuration imports
# .. for tests.
#
# Add Pre-Liquibase class to list of classes autowired when @AutoConfigureJooq
# or @JooqTest annotations are used in unit tests.
net.lbruun.springboot.preliquibase.PreLiquibaseAutoConfiguration

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# (additional) AutoConfigureDataJpa auto-configuration imports
#
# .. for tests.
#
# Add Pre-Liquibase class to list of classes autowired when @AutoConfigureDataJpa
# or @DataJpaTest annotations are used in unit tests.
Expand Down

0 comments on commit dbfbd17

Please sign in to comment.