Sync: code local unifié
Synchronisation du code source local (fait foi). Signed-off-by: lions dev Team
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package dev.lions.unionflow.server.service;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||
|
||||
import dev.lions.unionflow.server.api.dto.dashboard.MembreDashboardSyntheseResponse;
|
||||
import io.quarkus.test.junit.QuarkusTest;
|
||||
import io.quarkus.test.security.TestSecurity;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.NotFoundException;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@QuarkusTest
|
||||
class MembreDashboardServiceTest {
|
||||
|
||||
@Inject
|
||||
MembreDashboardService service;
|
||||
|
||||
@Test
|
||||
@TestSecurity(user = "membre-dashboard-svc@unionflow.test", roles = { "MEMBRE" })
|
||||
@DisplayName("getDashboardData sans membre en base lance NotFoundException")
|
||||
void getDashboardData_membreInexistant_throws() {
|
||||
assertThatThrownBy(() -> service.getDashboardData())
|
||||
.isInstanceOf(NotFoundException.class)
|
||||
.hasMessageContaining("membre-dashboard-svc@unionflow.test");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestSecurity(user = "membre.mukefi@unionflow.test", roles = { "MEMBRE" })
|
||||
@DisplayName("getDashboardData avec membre seed retourne une synthèse")
|
||||
void getDashboardData_membreSeed_returnsSynthese() {
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.prenom()).isNotNull();
|
||||
assertThat(result.nom()).isNotNull();
|
||||
assertThat(result.statutCotisations()).isIn("À jour", "En retard", "En attente");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user