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