Пример #1
0
 @Test
 public void shouldCheckOperatePermissionForPutRequest() throws Exception {
   request.setParameter("pipelineName", "cruise");
   request.setMethod("put");
   assumeUserHasOperatePermissionForPipeline();
   assertThat(permissionInterceptor.preHandle(request, response, null), is(true));
 }
Пример #2
0
 @Test
 public void shouldNotCheckViewPermissionIfPipelineNameNotPresent() throws Exception {
   assertThat(
       "shouldCheckViewPermissionIfPipelineNamePresent",
       permissionInterceptor.preHandle(request, response, null),
       is(true));
 }
Пример #3
0
 @Test
 public void shouldNotCheckOperatePermissionForEditingConfigurationRequest() throws Exception {
   request.setParameter("pipelineName", "cruise");
   request.setRequestURI("/admin/restful/configuration");
   request.setMethod("post");
   assertThat(permissionInterceptor.preHandle(request, response, null), is(true));
 }
Пример #4
0
 @Test
 public void shouldCheckOperatePermissionOnFirstStageForForcePipelineRequest() throws Exception {
   request.setParameter("pipelineName", "cruise");
   request.setRequestURI("/admin/force");
   request.setMethod("post");
   assumeUserHasOperatePermissionForFirstStage();
   assertThat(permissionInterceptor.preHandle(request, response, null), is(true));
 }
Пример #5
0
 @Test
 public void shouldCheckViewPermissionForGetRequestIfPipelineNamePresent() throws Exception {
   request.setParameter("pipelineName", "cruise");
   request.setMethod("get");
   assumeUserHasViewPermission();
   assertThat(
       "shouldCheckViewPermissionIfPipelineNamePresent",
       permissionInterceptor.preHandle(request, response, null),
       is(true));
 }