-
Notifications
You must be signed in to change notification settings - Fork 0
Development: Tests for deleting user data after inactivity
#1738
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
base: main
Are you sure you want to change the base?
Development: Tests for deleting user data after inactivity
#1738
Conversation
…/github.com/ls1intum/tum-apply into feat/1696-delete-user-data-after-inactivity
…r retention service/job with endpoint to get inactive users
|
📊 Server Test Coverage Too Low 🔍 View coverage locally: ./gradlew test jacocoTestReport
open build/reports/jacoco/test/html/index.html🌐 View coverage from GitHub: |
|
🤖 No OpenAPI or client changes needed. |
|
🤖 No OpenAPI or client changes needed. |
Kiara65
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it locally and all tests are passing, thank you 🥳
Left comments on the code, rest lgtm!
| private User saveApplicant(String email, LocalDateTime lastActivityAt) { | ||
| User applicantUser = UserTestData.newUserAll(UUID.randomUUID(), email, "Applicant", "User"); | ||
| ApplicantTestData.attachApplicantRole(applicantUser); | ||
| applicantUser.setUniversityId(UUID.randomUUID().toString().replace("-", "").substring(0, 7)); | ||
| applicantUser.setLastActivityAt(lastActivityAt); | ||
| User savedApplicantUser = userRepository.saveAndFlush(applicantUser); | ||
| ApplicantTestData.savedWithExistingUser(applicantRepository, savedApplicantUser); | ||
| return savedApplicantUser; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to define this method in the Applicant or User TestData?
| userRepository.save(deleted); | ||
| } | ||
|
|
||
| private User saveProfessor(ResearchGroup rg) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same applies to the save methods here. Could they be defined in the test data, or could existing test data methods be reused or adjusted so they can be used here as well?
…t/delete-user-data-after-inactivity
…ub.com/ls1intum/tum-apply into tests/1737-tests-for-deleting-user-data-after-inactivity
|
🤖 No OpenAPI or client changes needed. |
|
📊 Server Test Coverage Too Low 🔍 View coverage locally: ./gradlew test jacocoTestReport
open build/reports/jacoco/test/html/index.html🌐 View coverage from GitHub: |
…ub.com/ls1intum/tum-apply into tests/1737-tests-for-deleting-user-data-after-inactivity
|
🤖 No OpenAPI or client changes needed. |
Checklist
General
Server
Motivation and Context
Closes #1737
Description
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driverin the test context because Spring was picking the H2 driver while using a MySQL JDBC URL, causing driver/URL mismatch and context startup failures.unknown variable 'innodb_log_file_size'in our setup; 8.0.36 is compatible and stable.@Scheduledactually fires (using a short cron override).@AutoConfigureMockMvctoIntegrationTestannotation because integration tests use/expectMockMvc; without it, the bean isn’t created and context loading fails.@ActiveProfiles("test")toIntegrationTestannotation to ensure the test profile is always active so the test DB/Testcontainers configuration is consistently applied.Review Progress
Code Review
Manual Tests