Skip to content

Bug: Slice test with DataJpaTest not working #46963

@Cyber-Oscar

Description

@Cyber-Oscar

Good Morning! I have to create some test cases using Junit5 with Spring Boot Integration.

I followed the same steps in the official documentation:

  1. Create a configuration file which replace main Spring boot configuration using h2 database embedded
  2. Create a test case Class with DataJpaTest and Import annotation together to link the previous configuration file
  3. When I run the tests I have the following error:

16:33:51.761 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class TerritorioRepositorySliceTest does not declare any static, non-private, non-final, nested classes annotated with @configuration.
16:33:51.946 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration for test class

Image

RepositorySliceTest

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions