Posts

Showing posts with the label @DataR2dbcTest

@DataR2dbcTest - Testing Spring Data R2DBC components

Image
In this section, we will learn how to test  Data R2DBC components  with @DataR2dbcTest in the Spring Boot application. About  @DataR2dbcTest Instead of bootstrapping the entire application context for every test,  @DataR2dbcTest  allows us to initialize only the parts of the Application context that are relevant to Data R2DBC components tests. Regular @Component , @Service or @Controller beans are not scanned when using this annotation.  This approach not only speeds up the testing process but also ensures a focused and efficient testing environment.  This approach is also known as " slicing " the application context. The annotation supports the following attributes: excludeAutoConfiguration :  Auto-configuration exclusions that should be applied for this test. excludeFilters : beans that would ordinarily be added to the application context can be filtered using a set of exclude filters. includeFilters : beans that would otherwise be filtered and added to the application e