Skip to content

Conversation

@sachmii
Copy link
Contributor

@sachmii sachmii commented Jan 20, 2026

‼️MERGE PR #1704 FIRST - THESE ARE THE INTEGRATION TESTS ‼️

Checklist

General

Server

Motivation and Context

Closes #1737

Description

  • Forced spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver in the test context because Spring was picking the H2 driver while using a MySQL JDBC URL, causing driver/URL mismatch and context startup failures.
  • Pinned Testcontainers image to mysql:8.0.36 because MySQL 9.3 fails to start with unknown variable 'innodb_log_file_size' in our setup; 8.0.36 is compatible and stable.
  • Added retention integration tests covering applicant deletion cascade, professor anonymisation, dry‑run no‑op, unknown user skip, admin skip, mixed batch/idempotency.
  • Added job‑level integration tests for cutoff behaviour and dry‑run vs. enabled execution.
  • Added scheduling integration test to verify @Scheduled actually fires (using a short cron override).
  • Added @AutoConfigureMockMvc to IntegrationTest annotation because integration tests use/expect MockMvc; without it, the bean isn’t created and context loading fails.
  • Added @ActiveProfiles("test") to IntegrationTest annotation to ensure the test profile is always active so the test DB/Testcontainers configuration is consistently applied.

Review Progress

Code Review

  • Code Review 1

Manual Tests

  • Test 1

@sachmii sachmii self-assigned this Jan 20, 2026
@sachmii sachmii added the tests label Jan 20, 2026
@sachmii sachmii linked an issue Jan 20, 2026 that may be closed by this pull request
@github-actions github-actions bot added server Pull requests that update Java code. (Added Automatically!) database user management Code changes in user management module. job Code changes in job module. evaluation Code changes in evaluation module. labels Jan 20, 2026
@github-actions
Copy link
Contributor

📊 Server Test Coverage Too Low

🔍 View coverage locally:

./gradlew test jacocoTestReport
open build/reports/jacoco/test/html/index.html

🌐 View coverage from GitHub:
Download the "coverage-report-server" artifact from this workflow run.

@sachmii sachmii marked this pull request as ready for review January 20, 2026 07:50
@sachmii sachmii requested a review from az108 as a code owner January 20, 2026 07:50
@github-actions
Copy link
Contributor

🤖 No OpenAPI or client changes needed.

@github-actions
Copy link
Contributor

🤖 No OpenAPI or client changes needed.

Copy link
Contributor

@Kiara65 Kiara65 left a 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!

Comment on lines +80 to +88
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;
}
Copy link
Contributor

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) {
Copy link
Contributor

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?

@github-actions
Copy link
Contributor

🤖 No OpenAPI or client changes needed.

@github-actions
Copy link
Contributor

📊 Server Test Coverage Too Low

🔍 View coverage locally:

./gradlew test jacocoTestReport
open build/reports/jacoco/test/html/index.html

🌐 View coverage from GitHub:
Download the "coverage-report-server" artifact from this workflow run.

@sachmii sachmii requested a review from Kiara65 January 22, 2026 18:10
@github-actions
Copy link
Contributor

🤖 No OpenAPI or client changes needed.

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

Labels

config-change database evaluation Code changes in evaluation module. job Code changes in job module. ready for review server Pull requests that update Java code. (Added Automatically!) tests user management Code changes in user management module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests for deleting user data after inactivity

3 participants