hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HTTPCLIENT-1652) AuthSchemeBase.challengeState doesn't survive serialisation in BasicAuthCache
Date Thu, 28 May 2015 13:13:33 GMT

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski resolved HTTPCLIENT-1652.
-------------------------------------------
       Resolution: Duplicate
    Fix Version/s: 4.5

> AuthSchemeBase.challengeState doesn't survive serialisation in BasicAuthCache
> -----------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1652
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1652
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpAuth
>    Affects Versions: 4.4.1
>            Reporter: Renat Sabitov
>             Fix For: 4.5
>
>
> If a BasicScheme with ChallengeState defined is put in a BasicAuthCache, it comes out
of the cache with null challengeState.
> This is a small test to demonstrate the problem:
> {code}
>     @Test
>     public void assertChallengeStateSurvivesSerialisation() throws Exception {
>         BasicAuthCache localCache = new BasicAuthCache();
>         HttpHost aHost = new HttpHost("sample.host", 80);
>         BasicScheme proxyScheme = new BasicScheme();
>         proxyScheme.processChallenge(
>                 new BasicHeader(HttpHeaders.PROXY_AUTHENTICATE, "Basic "));
>         assertThat(proxyScheme.getChallengeState(), is(ChallengeState.PROXY));
>         localCache.put(aHost, proxyScheme);
>         BasicScheme outOfCache = (BasicScheme) localCache.get(aHost);
>         assertThat(outOfCache.getChallengeState(), is(ChallengeState.PROXY));
>     }
> {code}
> result is:
> {noformat}
> java.lang.AssertionError: 
> Expected: is <PROXY>
>      but: was null
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message