|
|
@ -21,6 +21,7 @@ import static org.mockito.ArgumentMatchers.isA; |
|
|
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; |
|
|
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; |
|
|
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; |
|
|
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; |
|
|
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; |
|
|
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; |
|
|
|
|
|
|
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; |
|
|
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; |
|
|
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; |
|
|
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; |
|
|
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; |
|
|
|
|
|
|
|
|
|
|
@ -103,7 +104,7 @@ public class SchedulerControllerTest extends AbstractControllerTest { |
|
|
|
isA(String.class), isA(WarningType.class), isA(Integer.class), isA(FailureStrategy.class), |
|
|
|
isA(String.class), isA(WarningType.class), isA(Integer.class), isA(FailureStrategy.class), |
|
|
|
isA(Priority.class), isA(String.class))).thenReturn(success()); |
|
|
|
isA(Priority.class), isA(String.class))).thenReturn(success()); |
|
|
|
|
|
|
|
|
|
|
|
MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/schedules/{id}",123) |
|
|
|
MvcResult mvcResult = mockMvc.perform(put("/projects/{projectCode}/schedules/{id}",123, 37) |
|
|
|
.header(SESSION_ID, sessionId) |
|
|
|
.header(SESSION_ID, sessionId) |
|
|
|
.params(paramsMap)) |
|
|
|
.params(paramsMap)) |
|
|
|
.andExpect(status().isOk()) |
|
|
|
.andExpect(status().isOk()) |
|
|
@ -123,7 +124,7 @@ public class SchedulerControllerTest extends AbstractControllerTest { |
|
|
|
Mockito.when(schedulerService.setScheduleState(isA(User.class), isA(Long.class), isA(Integer.class), |
|
|
|
Mockito.when(schedulerService.setScheduleState(isA(User.class), isA(Long.class), isA(Integer.class), |
|
|
|
isA(ReleaseState.class))).thenReturn(success()); |
|
|
|
isA(ReleaseState.class))).thenReturn(success()); |
|
|
|
|
|
|
|
|
|
|
|
MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/schedules/{id}/online",123) |
|
|
|
MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/schedules/{id}/online",123, 37) |
|
|
|
.header(SESSION_ID, sessionId) |
|
|
|
.header(SESSION_ID, sessionId) |
|
|
|
.params(paramsMap)) |
|
|
|
.params(paramsMap)) |
|
|
|
.andExpect(status().isOk()) |
|
|
|
.andExpect(status().isOk()) |
|
|
@ -143,7 +144,7 @@ public class SchedulerControllerTest extends AbstractControllerTest { |
|
|
|
Mockito.when(schedulerService.setScheduleState(isA(User.class), isA(Long.class), isA(Integer.class), |
|
|
|
Mockito.when(schedulerService.setScheduleState(isA(User.class), isA(Long.class), isA(Integer.class), |
|
|
|
isA(ReleaseState.class))).thenReturn(success()); |
|
|
|
isA(ReleaseState.class))).thenReturn(success()); |
|
|
|
|
|
|
|
|
|
|
|
MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/schedules/{id}/offline",123) |
|
|
|
MvcResult mvcResult = mockMvc.perform(post("/projects/{projectCode}/schedules/{id}/offline",123, 28) |
|
|
|
.header(SESSION_ID, sessionId) |
|
|
|
.header(SESSION_ID, sessionId) |
|
|
|
.params(paramsMap)) |
|
|
|
.params(paramsMap)) |
|
|
|
.andExpect(status().isOk()) |
|
|
|
.andExpect(status().isOk()) |
|
|
@ -221,7 +222,7 @@ public class SchedulerControllerTest extends AbstractControllerTest { |
|
|
|
Mockito.when(schedulerService.deleteScheduleById(isA(User.class), isA(Long.class), isA(Integer.class))) |
|
|
|
Mockito.when(schedulerService.deleteScheduleById(isA(User.class), isA(Long.class), isA(Integer.class))) |
|
|
|
.thenReturn(success()); |
|
|
|
.thenReturn(success()); |
|
|
|
|
|
|
|
|
|
|
|
MvcResult mvcResult = mockMvc.perform(delete("/projects/{projectCode}/schedules/{id}",123) |
|
|
|
MvcResult mvcResult = mockMvc.perform(delete("/projects/{projectCode}/schedules/{id}",123, 37) |
|
|
|
.header(SESSION_ID, sessionId) |
|
|
|
.header(SESSION_ID, sessionId) |
|
|
|
.params(paramsMap)) |
|
|
|
.params(paramsMap)) |
|
|
|
.andExpect(status().isOk()) |
|
|
|
.andExpect(status().isOk()) |
|
|
|