See gh-37745
This commit is contained in:
Johnny Lim
2023-10-07 14:05:47 +09:00
committed by Andy Wilkinson
parent 5a1abb76f7
commit 303015ea2d
10 changed files with 15 additions and 15 deletions

View File

@@ -562,7 +562,7 @@ If that is not what you want, you can disable transaction management for a test
include::code:MyTransactionalTests[]
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `DataJpaTest`.
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `@DataJpaTest`.
(See "<<features#features.testing.spring-boot-applications.autoconfigured-spring-data-jpa>>".)
@@ -580,7 +580,7 @@ By default, Data JDBC tests are transactional and roll back at the end of each t
See the {spring-framework-docs}/testing.html#testcontext-tx-enabling-transactions[relevant section] in the Spring Framework Reference Documentation for more details.
If that is not what you want, you can disable transaction management for a test or for the whole test class as <<features#features.testing.spring-boot-applications.autoconfigured-jdbc,shown in the JDBC example>>.
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `DataJpaTest`.
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `@DataJpaTest`.
(See "<<features#features.testing.spring-boot-applications.autoconfigured-spring-data-jpa>>".)
@@ -588,7 +588,7 @@ If you prefer your test to run against a real database, you can use the `@AutoCo
[[features.testing.spring-boot-applications.autoconfigured-spring-data-r2dbc]]
==== Auto-configured Data R2DBC Tests
`@DataR2dbcTest` is similar to `@DataJdbcTest` but is for tests that use Spring Data R2DBC repositories.
By default, it configures an in-memory embedded database, a `R2dbcEntityTemplate`, and Spring Data R2DBC repositories.
By default, it configures an in-memory embedded database, an `R2dbcEntityTemplate`, and Spring Data R2DBC repositories.
Regular `@Component` and `@ConfigurationProperties` beans are not scanned when the `@DataR2dbcTest` annotation is used.
`@EnableConfigurationProperties` can be used to include `@ConfigurationProperties` beans.
@@ -596,7 +596,7 @@ TIP: A list of the auto-configurations that are enabled by `@DataR2dbcTest` can
By default, Data R2DBC tests are not transactional.
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `DataJpaTest`.
If you prefer your test to run against a real database, you can use the `@AutoConfigureTestDatabase` annotation in the same way as for `@DataJpaTest`.
(See "<<features#features.testing.spring-boot-applications.autoconfigured-spring-data-jpa>>".)

View File

@@ -276,7 +276,7 @@ Alternatively, rather than open all suffix patterns, it is more secure to only s
As of Spring Framework 5.3, Spring MVC supports two strategies for matching request paths to controllers.
By default, Spring Boot uses the `PathPatternParser` strategy.
`PathPatternParser` is an https://spring.io/blog/2020/06/30/url-matching-with-pathpattern-in-spring-mvc[optimized implementation] but comes with some restrictions compared to the `AntPathMatcher` strategy.
`PathPatternParser` restricts usage of {spring-framework-docs}/web.html#mvc-ann-requestmapping-uri-templates[some path patterns variants].
`PathPatternParser` restricts usage of {spring-framework-docs}/web.html#mvc-ann-requestmapping-uri-templates[some path pattern variants].
It is also incompatible with suffix pattern matching (configprop:spring.mvc.pathmatch.use-suffix-pattern[deprecated], configprop:spring.mvc.pathmatch.use-registered-suffix-pattern[deprecated]) and configuring the `DispatcherServlet` with a path prefix (configprop:spring.mvc.servlet.path[]).
The strategy can be configured using the configprop:spring.mvc.pathmatch.matching-strategy[] configuration property, as shown in the following example: