@Test public void shouldCheckOperatePermissionForPutRequest() throws Exception { request.setParameter("pipelineName", "cruise"); request.setMethod("put"); assumeUserHasOperatePermissionForPipeline(); assertThat(permissionInterceptor.preHandle(request, response, null), is(true)); }
@Test public void shouldNotCheckViewPermissionIfPipelineNameNotPresent() throws Exception { assertThat( "shouldCheckViewPermissionIfPipelineNamePresent", permissionInterceptor.preHandle(request, response, null), is(true)); }
@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)); }
@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)); }
@Test public void shouldCheckViewPermissionForGetRequestIfPipelineNamePresent() throws Exception { request.setParameter("pipelineName", "cruise"); request.setMethod("get"); assumeUserHasViewPermission(); assertThat( "shouldCheckViewPermissionIfPipelineNamePresent", permissionInterceptor.preHandle(request, response, null), is(true)); }