Skip to content

Commit

Permalink
fixed itests
Browse files Browse the repository at this point in the history
  • Loading branch information
zambrovski committed Apr 14, 2023
1 parent ab1dc86 commit 8521c24
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions components/tasklist-backend/src/main/api/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ paths:
'403':
description: Not authorized.

'/task/{id}/claim':
'/task/{taskId}/claim':
parameters:
- $ref: '#/components/parameters/TaskIdParam'
- $ref: '#/components/parameters/CurrentUserIdParam'
Expand All @@ -129,7 +129,7 @@ paths:
'404':
description: Task not found.

'/task/{id}/unclaim':
'/task/{taskId}/unclaim':
parameters:
- $ref: '#/components/parameters/TaskIdParam'
- $ref: '#/components/parameters/CurrentUserIdParam'
Expand All @@ -148,7 +148,7 @@ paths:
'404':
description: Task not found.

'/task/{id}/defer':
'/task/{taskId}/defer':
parameters:
- $ref: '#/components/parameters/TaskIdParam'
- $ref: '#/components/parameters/CurrentUserIdParam'
Expand All @@ -175,7 +175,7 @@ paths:
'404':
description: Task not found.

'/task/{id}/undefer':
'/task/{taskId}/undefer':
parameters:
- $ref: '#/components/parameters/TaskIdParam'
- $ref: '#/components/parameters/CurrentUserIdParam'
Expand All @@ -195,7 +195,7 @@ paths:
description: Task not found.


'/task/{id}/complete':
'/task/{taskId}/complete':
parameters:
- $ref: '#/components/parameters/TaskIdParam'
- $ref: '#/components/parameters/CurrentUserIdParam'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ internal class TaskResourceIT {
}

@Test
fun `should fallback to current user service if no user is passed and return forbidden if the user is not found`() {
fun `should not allow to claim without the user header`() {
val taskId = UUID.randomUUID().toString()

whenever(taskServiceGateway.getTask(any())).thenReturn(testTask(taskId))

this.mockMvc
.perform(
post("${REQUEST_PATH}/task/{id}/claim", taskId)
post("${REQUEST_PATH}/task/{taskId}/claim", taskId)
.servletPath(REQUEST_PATH)
)
.andExpect(status().isForbidden)
.andExpect(status().isBadRequest)
}

@Test
Expand All @@ -72,7 +72,7 @@ internal class TaskResourceIT {

this.mockMvc
.perform(
post("${REQUEST_PATH}/task/{id}/claim", taskId)
post("${REQUEST_PATH}/task/{taskId}/claim", taskId)
.header("X-Current-User-ID", "id1")
.servletPath(REQUEST_PATH)
)
Expand All @@ -90,7 +90,7 @@ internal class TaskResourceIT {

this.mockMvc
.perform(
post("${REQUEST_PATH}/task/{id}/claim", taskId)
post("${REQUEST_PATH}/task/{taskId}/claim", taskId)
.header("X-Current-User-ID", "id1")
.servletPath(REQUEST_PATH)
)
Expand All @@ -109,7 +109,7 @@ internal class TaskResourceIT {

this.mockMvc
.perform(
post("${REQUEST_PATH}/task/{id}/unclaim", taskId)
post("${REQUEST_PATH}/task/{taskId}/unclaim", taskId)
.header("X-Current-User-ID", "id1")
.servletPath(REQUEST_PATH)
)
Expand All @@ -130,7 +130,7 @@ internal class TaskResourceIT {

this.mockMvc
.perform(
post("${REQUEST_PATH}/task/{id}/defer", taskId)
post("${REQUEST_PATH}/task/{taskId}/defer", taskId)
.header("X-Current-User-ID", "id1")
.servletPath(REQUEST_PATH)
.contentType(MediaType.APPLICATION_JSON)
Expand All @@ -151,7 +151,7 @@ internal class TaskResourceIT {

this.mockMvc
.perform(
post("${REQUEST_PATH}/task/{id}/undefer", taskId)
post("${REQUEST_PATH}/task/{taskId}/undefer", taskId)
.header("X-Current-User-ID", "id1")
.servletPath(REQUEST_PATH)
)
Expand Down

0 comments on commit 8521c24

Please sign in to comment.