Skip to content

Commit

Permalink
refactor path variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodriguezs2020 committed Jan 14, 2025
1 parent 10ac35b commit 5b6cc5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,9 @@ public ResponseEntity<Document> getDocument(@RequestParam("id") Long id) {
@PostMapping("/tests/{degreeName}/{subjectName}")
public ResponseEntity<Document> apiTest(@RequestBody MultipartFile file, @PathVariable String degreeName,
@PathVariable String subjectName) {

degreeName = degreeName.replace("%20", " ");
subjectName = subjectName.replace("%20", " ");

Optional<Degree> degree = degreeService.findByName(degreeName);
if (!degree.isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public void testSaveDocument_Success() throws Exception {

given()
.cookies(cookies)
.pathParam("degreeName", "Law") // Valid degree
.pathParam("subjectName", "Programming") // Valid subject
.pathParam("degreeName", "Software Engineering") // Valid degree
.pathParam("subjectName", "Math") // Valid subject
.multiPart("file", testFile) // File to upload
.when()
.post(API_URL)
Expand Down

0 comments on commit 5b6cc5a

Please sign in to comment.