Skip to content

Commit ec5c9b0

Browse files
author
Luke Sikina
committed
[CHORE] Correct info json schema
1 parent cdd4caf commit ec5c9b0

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/main/java/edu/harvard/dbmi/avillach/dictionary/info/InfoController.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
import org.springframework.web.bind.annotation.PostMapping;
66
import org.springframework.web.bind.annotation.RequestBody;
77

8+
import java.util.List;
9+
import java.util.UUID;
10+
811
@Controller
912
public class InfoController {
1013

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

3-
public record InfoResponse(String response) {
4-
}
3+
import java.util.List;
4+
import java.util.UUID;
5+
6+
public record InfoResponse(UUID id, String name, List<String> queryFormats) {
7+
}

src/test/java/edu/harvard/dbmi/avillach/dictionary/info/InfoControllerTest.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
import org.springframework.http.HttpStatus;
88
import org.springframework.http.ResponseEntity;
99

10+
import java.util.List;
11+
import java.util.UUID;
12+
1013

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

2124
Assertions.assertEquals(HttpStatus.OK, actual.getStatusCode());
22-
Assertions.assertEquals(new InfoResponse(":)"), actual.getBody());
25+
Assertions.assertEquals(new InfoResponse(UUID.nameUUIDFromBytes(":)".getBytes()), ":)", List.of()), actual.getBody());
2326
}
2427
}

0 commit comments

Comments
 (0)