Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applications should not delete entire User records in tests. #26226

Open
1 task
mshima opened this issue May 22, 2024 · 3 comments
Open
1 task

Applications should not delete entire User records in tests. #26226

mshima opened this issue May 22, 2024 · 3 comments

Comments

@mshima
Copy link
Member

mshima commented May 22, 2024

Overview of the issue

Tests removes every User and Authorities in tests making more difficult to implement and test more advanced security based on Users.
Liquibase and any other bootstrapped data are removed.
We should avoid removing Users and Authorities in tests.


userRepository.deleteAll()<% if (reactive) { %>.block()<% } %>;

Related issues
Suggest a Fix
JHipster Version(s)
JHipster configuration
Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)
@mshima
Copy link
Member Author

mshima commented May 24, 2024

It’s partially implemented. Missing reactive sql and mongodb.

@mraible
Copy link
Contributor

mraible commented May 24, 2024

Since it's related, I recently had to workaround this in my 21-Points Health project. In case others run into this with v8.4.0 and previous, here's a fix: mraible/21-points@caa91ba.

This was referenced May 26, 2024
@mshima
Copy link
Member Author

mshima commented May 27, 2024

Cache seems to be influencing in tests.
Tests requiring workaround increased:

requiresDeleteAllUsers: data =>
data.authenticationTypeOauth2 ||
data.databaseTypeNeo4j ||
(reactive && data.databaseTypeSql) ||
(!reactive && data.databaseTypeMongodb) ||
(!reactive && data.databaseTypeCassandra),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants