Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved. The copyrights to the contents of this file are licensed under the MIT License (http://www.opensource.org/licenses/mit-license.php)
 
 package org.jvnet.hudson.test;
 
 
A crumb issuer that issues a constant crumb value. Used for unit testing.

Author(s):
dty
public class TestCrumbIssuer extends CrumbIssuer
    @Override
    protected String issueCrumbServletRequest requestString salt )
    {
        return "test";
    }
    @Override
    public boolean validateCrumbServletRequest requestString saltString crumb )
    {
        return "test".equals(crumb);
    }
    @Extension
    public static final class DescriptorImpl extends CrumbIssuerDescriptor<TestCrumbIssuerimplements ModelObject {
        public DescriptorImpl()
        {
            super(nullnull);
            load();
        }
        @Override
        public String getDisplayName() {
            return "Test Crumb";
        }
        
        public TestCrumbIssuer newInstance(StaplerRequest reqJSONObject formDatathrows FormException {
            return new TestCrumbIssuer();
        }
    }
New to GrepCode? Check out our FAQ X