Skip to content

Commit

Permalink
feat: add sample to info route
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKellerer committed Dec 18, 2023
1 parent 7ad9746 commit b703a9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import org.genspectrum.lapis.model.SiloQueryModel
import org.genspectrum.lapis.request.LapisInfo
import org.springframework.http.MediaType
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

const val INFO_ROUTE = "/info"

@RestController
@RequestMapping("/sample")
class InfoController(private val siloQueryModel: SiloQueryModel) {
@GetMapping(INFO_ROUTE, produces = [MediaType.APPLICATION_JSON_VALUE])
@Operation(description = INFO_ENDPOINT_DESCRIPTION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders
import org.springframework.test.web.servlet.result.MockMvcResultMatchers
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.status

@SpringBootTest
@AutoConfigureMockMvc
Expand All @@ -26,8 +26,8 @@ class InfoControllerTest(
siloQueryModelMock.getInfo()
} returns InfoData("1234")

mockMvc.perform(MockMvcRequestBuilders.get(INFO_ROUTE))
.andExpect(MockMvcResultMatchers.status().isOk)
.andExpect(MockMvcResultMatchers.jsonPath("\$.dataVersion").value("1234"))
mockMvc.perform(getSample(INFO_ROUTE))
.andExpect(status().isOk)
.andExpect(jsonPath("\$.dataVersion").value("1234"))
}
}

0 comments on commit b703a9c

Please sign in to comment.