File tree Expand file tree Collapse file tree 4 files changed +7
-8
lines changed
main/java/com/github/scribejava/core
test/java/com/github/scribejava/core/builder Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 1+ [SNAPSHOT]
2+ * allow 'null' as callback. It's an optional parameter. Remove "oob" as default (thanks to https://github.com/massongit)
3+
14[5.1.0]
25 * drop optional dependency on Apache commons-codec
36 * add API - Dataporten (https://docs.dataporten.no/) (thanks to https://github.com/xibriz)
Original file line number Diff line number Diff line change 44import com .github .scribejava .core .httpclient .HttpClient ;
55import com .github .scribejava .core .httpclient .HttpClientConfig ;
66import com .github .scribejava .core .model .OAuthConfig ;
7- import com .github .scribejava .core .model .OAuthConstants ;
87import com .github .scribejava .core .oauth .OAuthService ;
98import com .github .scribejava .core .utils .Preconditions ;
109
1514 */
1615public class ServiceBuilder {
1716
18- private String callback = OAuthConstants . OUT_OF_BAND ;
17+ private String callback ;
1918 private String apiKey ;
2019 private String apiSecret ;
2120 private String scope ;
@@ -38,7 +37,6 @@ public ServiceBuilder(String apiKey) {
3837 * @return the {@link ServiceBuilder} instance for method chaining
3938 */
4039 public ServiceBuilder callback (String callback ) {
41- Preconditions .checkNotNull (callback , "Callback can't be null" );
4240 this .callback = callback ;
4341 return this ;
4442 }
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ public interface OAuthConstants {
1717 String PARAM_PREFIX = "oauth_" ;
1818 String TOKEN = "oauth_token" ;
1919 String TOKEN_SECRET = "oauth_token_secret" ;
20- String OUT_OF_BAND = "oob" ;
2120 String VERIFIER = "oauth_verifier" ;
2221 String HEADER = "Authorization" ;
2322 String SCOPE = "scope" ;
Original file line number Diff line number Diff line change 55import org .junit .Test ;
66import com .github .scribejava .core .builder .api .DefaultApi20 ;
77import com .github .scribejava .core .model .OAuthConfig ;
8- import com .github .scribejava .core .model .OAuthConstants ;
98import com .github .scribejava .core .oauth .OAuth20Service ;
109
1110public class ServiceBuilderTest {
@@ -26,7 +25,7 @@ public void shouldReturnConfigDefaultValues() {
2625 final OAuthConfig config = api .getConfig ();
2726 assertEquals (config .getApiKey (), "key" );
2827 assertEquals (config .getApiSecret (), "secret" );
29- assertEquals (config .getCallback (), OAuthConstants . OUT_OF_BAND );
28+ assertEquals (config .getCallback (), null );
3029 }
3130
3231 @ Test
@@ -39,8 +38,8 @@ public void shouldAcceptValidCallbackUrl() {
3938 assertEquals (config .getCallback (), "http://example.com" );
4039 }
4140
42- @ Test ( expected = IllegalArgumentException . class )
43- public void shouldNotAcceptNullAsCallback () {
41+ @ Test
42+ public void shouldAcceptNullAsCallback () {
4443 builder .apiKey ("key" ).apiSecret ("secret" ).callback (null ).build (api );
4544 }
4645
You can’t perform that action at this time.
0 commit comments