Fix workflow gitea action pour e2e (tests automatisés via playwright) + correction d'une incohérence dans l'API coté java. Ajout d'autres tests utilisateur
Some checks failed
E2E Tests / e2e (push) Failing after 2m31s
Some checks failed
E2E Tests / e2e (push) Failing after 2m31s
This commit is contained in:
@@ -40,17 +40,11 @@ public class ArcController {
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<List<ArcDTO>> getAllArcs() {
|
||||
List<Arc> arcs = arcService.getAllArcs();
|
||||
List<ArcDTO> arcDTOs = arcs.stream()
|
||||
.map(arcMapper::toDTO)
|
||||
.collect(Collectors.toList());
|
||||
return ResponseEntity.ok(arcDTOs);
|
||||
}
|
||||
|
||||
@GetMapping("/campaign/{campaignId}")
|
||||
public ResponseEntity<List<ArcDTO>> getArcsByCampaignId(@PathVariable String campaignId) {
|
||||
List<Arc> arcs = arcService.getArcsByCampaignId(campaignId);
|
||||
public ResponseEntity<List<ArcDTO>> getAllArcs(
|
||||
@RequestParam(value = "campaignId", required = false) String campaignId) {
|
||||
List<Arc> arcs = (campaignId != null && !campaignId.isBlank())
|
||||
? arcService.getArcsByCampaignId(campaignId)
|
||||
: arcService.getAllArcs();
|
||||
List<ArcDTO> arcDTOs = arcs.stream()
|
||||
.map(arcMapper::toDTO)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@@ -40,17 +40,11 @@ public class ChapterController {
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<List<ChapterDTO>> getAllChapters() {
|
||||
List<Chapter> chapters = chapterService.getAllChapters();
|
||||
List<ChapterDTO> chapterDTOs = chapters.stream()
|
||||
.map(chapterMapper::toDTO)
|
||||
.collect(Collectors.toList());
|
||||
return ResponseEntity.ok(chapterDTOs);
|
||||
}
|
||||
|
||||
@GetMapping("/arc/{arcId}")
|
||||
public ResponseEntity<List<ChapterDTO>> getChaptersByArcId(@PathVariable String arcId) {
|
||||
List<Chapter> chapters = chapterService.getChaptersByArcId(arcId);
|
||||
public ResponseEntity<List<ChapterDTO>> getAllChapters(
|
||||
@RequestParam(value = "arcId", required = false) String arcId) {
|
||||
List<Chapter> chapters = (arcId != null && !arcId.isBlank())
|
||||
? chapterService.getChaptersByArcId(arcId)
|
||||
: chapterService.getAllChapters();
|
||||
List<ChapterDTO> chapterDTOs = chapters.stream()
|
||||
.map(chapterMapper::toDTO)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@@ -40,17 +40,11 @@ public class SceneController {
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<List<SceneDTO>> getAllScenes() {
|
||||
List<Scene> scenes = sceneService.getAllScenes();
|
||||
List<SceneDTO> sceneDTOs = scenes.stream()
|
||||
.map(sceneMapper::toDTO)
|
||||
.collect(Collectors.toList());
|
||||
return ResponseEntity.ok(sceneDTOs);
|
||||
}
|
||||
|
||||
@GetMapping("/chapter/{chapterId}")
|
||||
public ResponseEntity<List<SceneDTO>> getScenesByChapterId(@PathVariable String chapterId) {
|
||||
List<Scene> scenes = sceneService.getScenesByChapterId(chapterId);
|
||||
public ResponseEntity<List<SceneDTO>> getAllScenes(
|
||||
@RequestParam(value = "chapterId", required = false) String chapterId) {
|
||||
List<Scene> scenes = (chapterId != null && !chapterId.isBlank())
|
||||
? sceneService.getScenesByChapterId(chapterId)
|
||||
: sceneService.getAllScenes();
|
||||
List<SceneDTO> sceneDTOs = scenes.stream()
|
||||
.map(sceneMapper::toDTO)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
@@ -79,7 +79,7 @@ class ArcControllerTest {
|
||||
@Test
|
||||
void getByCampaign_pathVariant() throws Exception {
|
||||
arcRepository.save(Arc.builder().campaignId(campaignId).name("A").order(0).build());
|
||||
mockMvc.perform(get("/api/arcs/campaign/{id}", campaignId))
|
||||
mockMvc.perform(get("/api/arcs").param("campaignId", campaignId))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$").isArray());
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class ChapterControllerTest {
|
||||
@Test
|
||||
void getByArc_pathVariant() throws Exception {
|
||||
chapterRepository.save(Chapter.builder().arcId(arcId).name("A").order(0).build());
|
||||
mockMvc.perform(get("/api/chapters/arc/{id}", arcId))
|
||||
mockMvc.perform(get("/api/chapters").param("arcId", arcId))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$").isArray());
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ class SceneControllerTest {
|
||||
@Test
|
||||
void getByChapter_pathVariant() throws Exception {
|
||||
sceneRepository.save(Scene.builder().chapterId(chapterId).name("A").order(0).build());
|
||||
mockMvc.perform(get("/api/scenes/chapter/{id}", chapterId))
|
||||
mockMvc.perform(get("/api/scenes").param("chapterId", chapterId))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$").isArray());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user