Skip to content

Commit

Permalink
feature: add error message to interval < 1 minute by using bean valid…
Browse files Browse the repository at this point in the history
…ation annotation to topic request #46

ohsome-contributions-stats-service: 'Consider introducing 'Jakarta Bean validation' standard '
#46
  • Loading branch information
mmerdes committed Feb 7, 2024
1 parent b77ad30 commit 93d3c26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class TopicController {
@Parameter(description = "the granularity defined as Intervals in ISO 8601 time format eg: P1M")
@RequestParam(name = "interval", defaultValue = "P1M", required = false)
@ParseableInterval
// @AtLeastOneMinuteInterval
@AtLeastOneMinuteInterval
interval: String,

@Parameter(description = "A comma separated list of countries, can also only be one country")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ class TopicControllerMVCTests {
}


//TODO: check error message
@Test
fun `topic stats per interval throws error for interval under one Minute`() {

Expand All @@ -281,6 +280,8 @@ class TopicControllerMVCTests {
.queryParam("startdate", "2017-10-01T04:00:00Z")
.queryParam("enddate", "2020-10-01T04:00:00Z")
.queryParam("interval", "PT1S")
.queryParam("hashtag", "missingmaps")


this.mockMvc.perform(GET)
.andExpect(status().isBadRequest)
Expand Down

0 comments on commit 93d3c26

Please sign in to comment.