Skip to content

Consider removing in-memory database configuration from slice tests #42360

Closed as not planned
@vpavic

Description

@vpavic

To begin with, I'm aware of recent improvements made by #35253.

However, I'd still ask to consider removing in-memory database configuration from slice tests where it's used (@JdbcTest, @DataJpaTest, @DataJdbcTest) for the following reasons:

  • integration testing data access layer against an in-memory isn't really a best practice (and Spring Boot should guide developers towards best practices)
  • most major RDBMSs are available in containerized form (and Testcontainers is a obviously well established solution that helps there)
  • the aforementioned Reduce the need for @AutoConfigureTestDatabase(replace=NONE) when using a test-provided database #35253 IMO actually makes it easier to change the default as it should lower the impact
  • changing the default will align all relational database slices in this regard (@JooqTest doesn't configure an in-memory database)

In practice, I haven't worked on a project where data access layer was primarily tested using an in-memory database probably since ~2016 so that's a lot of occurrences of @AutoConfigureTestDatabase(replace=NONE).

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions