test(account): cover missing picker business date

This commit is contained in:
sechmachine
2026-08-15 14:36:11 +07:00
parent e70159a81b
commit 432389220f
2 changed files with 74 additions and 2 deletions
@@ -1,6 +1,7 @@
package com.lab.labtimesheet.feature.account.service;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import java.sql.Timestamp;
import java.time.Instant;
@@ -83,6 +84,13 @@ class EligibleInternOptionIntegrationTest {
assertThat(options).extracting(EligibleInternOption::userId).doesNotHaveDuplicates();
}
@Test
void rejectsMissingBusinessDate() {
assertThatThrownBy(() -> accounts.eligibleInternOptions(null))
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Business date is required");
}
private long activeIntern(String displayName, String studentCode, LocalDate startDate, LocalDate endDate) {
long userId = activeUser(GlobalRole.INTERN, displayName);
activeProfile(userId, studentCode, startDate, endDate);