File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
main/java/org/scribe/model
test/java/org/scribe/model Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 11package org .scribe .model ;
22
3+ import org .scribe .utils .*;
4+
35/**
46 * Represents an OAuth verifier code.
57 *
68 * @author Pablo Fernandez
79 */
810public class Verifier
911{
12+
1013 private final String value ;
1114
1215 /**
@@ -16,7 +19,7 @@ public class Verifier
1619 */
1720 public Verifier (String value )
1821 {
19- this .value = value ;
22+ this .value = URLUtils . percentDecode ( value ) ;
2023 }
2124
2225 public String getValue ()
Original file line number Diff line number Diff line change 1+ package org .scribe .model ;
2+
3+ import static org .junit .Assert .*;
4+
5+ import org .junit .*;
6+
7+ public class VerifierTest
8+ {
9+ @ Test
10+ public void shouldParse ()
11+ {
12+ Verifier verifier = new Verifier ("p8k%2BGIjIL9PblXq%2BpH6LmT9l" );
13+ assertEquals (verifier .getValue (), "p8k+GIjIL9PblXq+pH6LmT9l" );
14+ }
15+
16+ @ Test (expected = IllegalArgumentException .class )
17+ public void shouldThrowErrorForNullString ()
18+ {
19+ new Verifier (null );
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments