Skip to content

Commit 8981c0d

Browse files
fix: convert PATCH to PUT endpoint (#59)
Signed-off-by: Joris Mancini <[email protected]>
1 parent 85e1bd2 commit 8981c0d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/org/gridsuite/studyconfig/server/controller/SpreadsheetConfigController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public ResponseEntity<Void> updateSpreadsheetConfig(
101101
return ResponseEntity.noContent().build();
102102
}
103103

104-
@PatchMapping("/{id}/name")
104+
@PutMapping("/{id}/name")
105105
@Operation(summary = "Rename a spreadsheet configuration",
106106
description = "Updates the name of an existing spreadsheet configuration")
107107
@ApiResponse(responseCode = "204", description = "Configuration renamed")

src/test/java/org/gridsuite/studyconfig/server/SpreadsheetConfigIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ void testRenameSpreadsheetConfig() throws Exception {
456456
UUID configUuid = saveAndReturnId(configToRename);
457457

458458
String newName = "RenamedConfig";
459-
mockMvc.perform(patch(URI_SPREADSHEET_CONFIG_GET_PUT + configUuid + "/name")
459+
mockMvc.perform(put(URI_SPREADSHEET_CONFIG_GET_PUT + configUuid + "/name")
460460
.content(newName)
461461
.contentType(MediaType.APPLICATION_JSON))
462462
.andExpect(status().isNoContent());
@@ -473,7 +473,7 @@ void testRenameSpreadsheetConfig() throws Exception {
473473
@Test
474474
void testRenameNonExistentSpreadsheetConfig() throws Exception {
475475
UUID nonExistentUuid = UUID.randomUUID();
476-
mockMvc.perform(patch(URI_SPREADSHEET_CONFIG_GET_PUT + nonExistentUuid + "/name")
476+
mockMvc.perform(put(URI_SPREADSHEET_CONFIG_GET_PUT + nonExistentUuid + "/name")
477477
.content("NewName")
478478
.contentType(MediaType.APPLICATION_JSON))
479479
.andExpect(status().isNotFound());

0 commit comments

Comments
 (0)