Skip to content

Commit

Permalink
[judge-d-24] code polishing
Browse files Browse the repository at this point in the history
DONE:
* improved endpoint documentation
* test code indented and given section removed from ContractsControllerIT
  • Loading branch information
Karol Kalinski committed Jul 9, 2019
1 parent 2c1098f commit 58b4716
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public List<String> getAvailableServiceNames() {
}

@GetMapping(value = "/contracts", produces = MediaType.APPLICATION_JSON_VALUE)
@ApiOperation(value = "Get contracts registered", nickname = "get names of services")
@ApiOperation(value = "Get registered contracts", nickname = "get names of services")
@ApiResponses(value = {
@ApiResponse(code = 302, message = "Found")
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,11 @@ class ContractsControllerIT extends Specification {
objectMapper.readValue(response.getContentAsString(), new TypeReference<List<String>>() {})
}

def 'should calling /contracts should redirect to /contracts/services to improve api discovery'() {
given:
def 'should calling /contracts redirect to /contracts/services to improve api discovery'() {
when:
def response = mockMvc.perform(
get('/contracts')
).andReturn().getResponse()
def response = mockMvc.perform(
get('/contracts')
).andReturn().getResponse()
then:
response.getStatus() == 302
response.getRedirectedUrl() == "contracts/services"
Expand Down

0 comments on commit 58b4716

Please sign in to comment.