Code example for AuthState

0
 
    @Before 
    public void setUp() throws Exception { 
        this.authScheme = Mockito.mock(ContextAwareAuthScheme.class);
        this.credentials = Mockito.mock(Credentials.class);
        this.authState = new AuthState();
        this.context = new BasicHttpContext();
        this.context.setAttribute("test-auth-state", this.authState);
        this.interceptor = new TestRequestAuthentication();
    } 
 
    @Test 
    public void testAuthFailureState() throws Exception { 
        HttpRequest request = new BasicHttpRequest("GET", "/");
        this.authState.setState(AuthProtocolState.FAILURE);
        this.authState.update(this.authScheme, this.credentials);
 
        this.interceptor.process(request, this.context);
 
        Assert.assertFalse(request.containsHeader(AUTH.WWW_AUTH_RESP));
Connect your IDE to all the code out there  Get Codota for Java