Refactoring - Version stable

This commit is contained in:
dahoud
2026-03-28 14:21:30 +00:00
parent 00b981c510
commit a740c172ef
4402 changed files with 88517 additions and 1555 deletions

View File

@@ -0,0 +1,35 @@
package dev.lions.unionflow.server.service;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import io.quarkus.test.junit.QuarkusTest;
import jakarta.inject.Inject;
import jakarta.ws.rs.NotFoundException;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.util.UUID;
/**
* Tests pour TicketService — couvre la branche {@code ticket == null} dans
* {@code obtenirTicket()} via un UUID inexistant en base.
*
* <p>{@code BaseRepository.findById(UUID)} appelle {@code entityManager.find()}
* qui retourne {@code null} pour un ID inexistant → branche {@code ticket == null} couverte.
*/
@QuarkusTest
@DisplayName("TicketService — branche ticket == null dans obtenirTicket:40")
class TicketServiceMockCoverageTest {
@Inject
TicketService ticketService;
@Test
@DisplayName("obtenirTicket avec UUID inexistant → findById retourne null → NotFoundException (branche ticket == null)")
void obtenirTicket_findByIdRetourneNull_throwsNotFoundException() {
UUID inexistantId = UUID.randomUUID();
assertThatThrownBy(() -> ticketService.obtenirTicket(inexistantId))
.isInstanceOf(NotFoundException.class);
}
}