feat: BackupService real pg_dump, OrganisationService region stats, SystemConfigService overrides
- BackupService: DB-persisted metadata (BackupRecord/BackupConfig entities + V16 Flyway migration), real pg_dump execution via ProcessBuilder, soft-delete on deleteBackup, pg_restore manual guidance - OrganisationService: repartitionRegion now queries Adresse entities (was Map.of() stub) - SystemConfigService: in-memory config overrides via AtomicReference (no DB dependency) - SystemMetricsService: null-guard on MemoryMXBean in getSystemStatus() (fixes test NPE) - Souscription workflow: SouscriptionService, SouscriptionResource, FormuleAbonnementRepository, V11 Flyway migration, admin REST clients - Flyway V8-V15: notes membres, types référence, type orga constraint, seed roles, première connexion, Wave checkout URL, Wave telephone column length fix - .gitignore: added uploads/ and .claude/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package dev.lions.unionflow.server.entity;
|
||||
|
||||
import dev.lions.unionflow.server.api.enums.abonnement.StatutSouscription;
|
||||
import dev.lions.unionflow.server.api.enums.abonnement.StatutValidationSouscription;
|
||||
import dev.lions.unionflow.server.api.enums.abonnement.TypePeriodeAbonnement;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -47,6 +48,24 @@ class SouscriptionOrganisationBranchTest {
|
||||
assertThat(s.getQuotaUtilise()).isEqualTo(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Branch manquante : statutValidation == null → la valeur par défaut EN_ATTENTE_PAIEMENT est affectée.
|
||||
*/
|
||||
@Test
|
||||
@DisplayName("onCreate: statutValidation null → initialisé à EN_ATTENTE_PAIEMENT")
|
||||
void onCreate_statutValidationNull_setsDefault() throws Exception {
|
||||
SouscriptionOrganisation s = new SouscriptionOrganisation();
|
||||
s.setDateDebut(LocalDate.now());
|
||||
s.setDateFin(LocalDate.now().plusMonths(1));
|
||||
s.setStatutValidation(null); // forcer null pour couvrir le then-branch de L168
|
||||
|
||||
Method onCreate = SouscriptionOrganisation.class.getDeclaredMethod("onCreate");
|
||||
onCreate.setAccessible(true);
|
||||
onCreate.invoke(s);
|
||||
|
||||
assertThat(s.getStatutValidation()).isEqualTo(StatutValidationSouscription.EN_ATTENTE_PAIEMENT);
|
||||
}
|
||||
|
||||
// ── decrementerQuota() ────────────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user