MME-14 Update recipe should be a PUT endpoint.
This commit is contained in:
parent
9c5b9a7150
commit
ca926d9ada
@ -254,7 +254,7 @@ public class RecipesControllerTests {
|
|||||||
final String updateBody = this.objectMapper.writeValueAsString(spec);
|
final String updateBody = this.objectMapper.writeValueAsString(spec);
|
||||||
|
|
||||||
this.mockMvc.perform(
|
this.mockMvc.perform(
|
||||||
post("/recipes/{username}/{slug}", owner.getUsername(), recipe.getSlug())
|
put("/recipes/{username}/{slug}", owner.getUsername(), recipe.getSlug())
|
||||||
.header("Authorization", "Bearer " + this.getAccessToken(owner))
|
.header("Authorization", "Bearer " + this.getAccessToken(owner))
|
||||||
.contentType(MediaType.APPLICATION_JSON)
|
.contentType(MediaType.APPLICATION_JSON)
|
||||||
.content(updateBody)
|
.content(updateBody)
|
||||||
@ -318,7 +318,7 @@ public class RecipesControllerTests {
|
|||||||
|
|
||||||
final String accessToken = this.getAccessToken(owner);
|
final String accessToken = this.getAccessToken(owner);
|
||||||
this.mockMvc.perform(
|
this.mockMvc.perform(
|
||||||
post("/recipes/{username}/{slug}", owner.getUsername(), recipe.getSlug())
|
put("/recipes/{username}/{slug}", owner.getUsername(), recipe.getSlug())
|
||||||
.header("Authorization", "Bearer " + accessToken)
|
.header("Authorization", "Bearer " + accessToken)
|
||||||
.contentType(MediaType.APPLICATION_JSON)
|
.contentType(MediaType.APPLICATION_JSON)
|
||||||
.content(body)
|
.content(body)
|
||||||
|
|||||||
@ -66,7 +66,7 @@ public class RecipesController {
|
|||||||
return ResponseEntity.ok(this.getFullViewWrapper(username, slug, view, viewer));
|
return ResponseEntity.ok(this.getFullViewWrapper(username, slug, view, viewer));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/{username}/{slug}")
|
@PutMapping("/{username}/{slug}")
|
||||||
public ResponseEntity<Map<String, Object>> updateByUsernameAndSlug(
|
public ResponseEntity<Map<String, Object>> updateByUsernameAndSlug(
|
||||||
@PathVariable String username,
|
@PathVariable String username,
|
||||||
@PathVariable String slug,
|
@PathVariable String slug,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user