Skip to content

Commit

Permalink
[CHORE] Correct info json schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Sikina authored and Luke-Sikina committed Sep 24, 2024
1 parent a0545f4 commit 3a33d15
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.UUID;

@Controller
public class InfoController {

@PostMapping("/info")
public ResponseEntity<InfoResponse> getInfo(@RequestBody Object ignored) {
return ResponseEntity.ok(new InfoResponse(":)"));
return ResponseEntity.ok(new InfoResponse(UUID.nameUUIDFromBytes(":)".getBytes()), ":)", List.of()));
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package edu.harvard.dbmi.avillach.dictionary.info;

public record InfoResponse(String response) {
}
import java.util.List;
import java.util.UUID;

public record InfoResponse(UUID id, String name, List<String> queryFormats) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

import java.util.List;
import java.util.UUID;


@SpringBootTest
class InfoControllerTest {
Expand All @@ -19,6 +22,6 @@ void shouldGetInfo() {
ResponseEntity<InfoResponse> actual = infoController.getInfo(new Object());

Assertions.assertEquals(HttpStatus.OK, actual.getStatusCode());
Assertions.assertEquals(new InfoResponse(":)"), actual.getBody());
Assertions.assertEquals(new InfoResponse(UUID.nameUUIDFromBytes(":)".getBytes()), ":)", List.of()), actual.getBody());
}
}

0 comments on commit 3a33d15

Please sign in to comment.