Ecriture de tests unitaires coté java pour améliorer la stabilité de l'application

This commit is contained in:
2026-04-22 07:46:24 +02:00
parent 49a82d05f7
commit bf38b6695f
56 changed files with 5175 additions and 298 deletions

View File

@@ -1,10 +1,31 @@
# Configuration de test avec PostgreSQL
# Configuration de test : vraie base PostgreSQL loremind_test.
#
# La base `loremind_test` doit exister sur l'instance locale (port 5432).
# Les credentials sont ceux de `.env` a la racine du projet ; on les duplique
# ici car les tests Maven ne chargent pas le .env.
#
# Surchargables via variables d'environnement (CI) :
# SPRING_DATASOURCE_URL, SPRING_DATASOURCE_USERNAME, SPRING_DATASOURCE_PASSWORD
spring.datasource.url=${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/loremind_test}
spring.datasource.username=${SPRING_DATASOURCE_USERNAME:}
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:}
spring.datasource.username=${SPRING_DATASOURCE_USERNAME:ietm64}
spring.datasource.password=${SPRING_DATASOURCE_PASSWORD:M&Ipourlavie64}
spring.datasource.driver-class-name=org.postgresql.Driver
# Configuration JPA pour les tests
# Configuration JPA pour les tests : schema recree a chaque run, pas de logs SQL.
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=true
spring.jpa.show-sql=false
# Credentials admin factices pour satisfaire le fail-closed de SecurityConfig.
admin.username=test-admin
admin.password=test-admin-password
# Brain et MinIO : URLs factices — aucun appel reseau attendu dans les tests
# de persistence. MinioConfig est tolerant (PostConstruct capture).
brain.base-url=http://localhost:0
brain.timeout-seconds=5
brain.internal-secret=test-secret
minio.endpoint=http://localhost:9000
minio.access-key=test
minio.secret-key=test
minio.bucket=test-bucket