Skip to content

Commit

Permalink
FIX : changement méthode http pour passage en attente vers de get ver…
Browse files Browse the repository at this point in the history
…s patch
  • Loading branch information
pierre-maraval committed Jun 28, 2024
1 parent c765e4c commit de7aa17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/src/main/java/fr/abes/item/web/DemandeRestService.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public String[] simulerLigne(@PathVariable("type") TYPE_DEMANDE type, @PathVaria
* @throws UserExistException : erreur sur l'utilisateur accédant à la méthode
* @throws ForbiddenException : erreur d'accès à la méthode
*/
@GetMapping("/passerEnAttente/{type}/{id}")
@PatchMapping("/passerEnAttente/{type}/{id}")
@PreAuthorize("hasAnyAuthority('USER','ADMIN')")
@Operation(summary = "permet de modifier le statut de la demande pour la passer à : en attente")
public DemandeWebDto passerEnAttente(@PathVariable("type") TYPE_DEMANDE type, @PathVariable("id") Integer numDemande, HttpServletRequest request) throws DemandeCheckingException, UserExistException, ForbiddenException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ void testPasserEnAttente() throws Exception {
DemandeExemp demande = (DemandeExemp) this.demandeExemps.get(0);
demande.setEtatDemande(new EtatDemande(3, "En attente"));
Mockito.when(demandeExempService.changeState(Mockito.any(), Mockito.anyInt())).thenReturn(demande);
this.mockMvc.perform(get("/api/v1/passerEnAttente/EXEMP/1").requestAttr("userNum", "1"))
this.mockMvc.perform(patch("/api/v1/passerEnAttente/EXEMP/1").requestAttr("userNum", "1"))
.andExpect(status().isOk())
.andExpect(jsonPath("$.id").value(1))
.andExpect(jsonPath("$.etatDemande").value("En attente"))
Expand Down

0 comments on commit de7aa17

Please sign in to comment.