예제 #1
0
 @Before
 public void setup() throws Exception {
   securityService = context.mock(SecurityService.class);
   permissionInterceptor = new AuthorizationInterceptor(securityService);
   request = new MockHttpServletRequest();
   response = new MockHttpServletResponse();
 }
예제 #2
0
 private void assumeUserHasOperatePermissionForPipeline() {
   context.checking(
       new Expectations() {
         {
           one(securityService).hasOperatePermissionForPipeline(ANONYMOUS.getUsername(), "cruise");
           will(returnValue(true));
         }
       });
 }
예제 #3
0
 private void assumeUserHasOperatePermissionForFirstStage() {
   context.checking(
       new Expectations() {
         {
           one(securityService)
               .hasOperatePermissionForFirstStage(
                   "cruise", CaseInsensitiveString.str(ANONYMOUS.getUsername()));
           will(returnValue(true));
         }
       });
 }
예제 #4
0
 private void assumeUserHasViewPermission() {
   context.checking(
       new Expectations() {
         {
           one(securityService)
               .hasViewPermissionForPipeline(
                   CaseInsensitiveString.str(ANONYMOUS.getUsername()), "cruise");
           will(returnValue(true));
         }
       });
 }