Skip to content

Commit

Permalink
EPMRPP-97060 upload bugfix (#2144)
Browse files Browse the repository at this point in the history
  • Loading branch information
grabsefx authored Jan 15, 2025
1 parent 109ebf4 commit ca6fd32
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion reportportal-common-api
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ public ResponseEntity<Resource> getUsersUserIdAvatar(Long userId, Boolean thumbn
@Transactional
@PreAuthorize(ALLOWED_TO_USER_ITSELF)
public ResponseEntity<Void> postUsersUserIdAvatar(Long userId,
@Parameter(name = "file", description = "")
@RequestPart(value = "file", required = false) MultipartFile file) {
@Parameter(name = "file")
@RequestPart(value = "file") MultipartFile file) {

editUserHandler.uploadPhoto(userId, file);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
return new ResponseEntity<>(HttpStatus.CREATED);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void userPhoto() throws Exception {
.contentType(MediaType.MULTIPART_FORM_DATA);

mockMvc.perform(requestBuilder.with(token(oAuthHelper.getDefaultToken())))
.andExpect(status().isNoContent());
.andExpect(status().isCreated());

mockMvc.perform(get("/users/2/avatar").with(token(oAuthHelper.getDefaultToken())))
.andExpect(status().isOk());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ void userPhoto() throws Exception {
.contentType(MediaType.MULTIPART_FORM_DATA);

mockMvc.perform(requestBuilder.with(token(oAuthHelper.getDefaultToken())))
.andExpect(status().isNoContent());
.andExpect(status().isCreated());

mockMvc.perform(get("/users/2/avatar?thumbnail=false")
.with(token(oAuthHelper.getDefaultToken())))
Expand Down

0 comments on commit ca6fd32

Please sign in to comment.