Skip to content

Commit 40fd4cb

Browse files
author
Karl Rieb
committed
Remove final modifier from DbxClientV2 and DbxTeamClientV2 for easier mocking.
1 parent 8d913c1 commit 40fd4cb

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

ChangeLog.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
---------------------------------------------
33
- Add configureRequest(..) method for simpler subclassing of OkHttpRequestor and OkHttp3Requestor.
44
- Fix BadRequest error when adding custom state to a DbxWebAuth.Request object.
5+
- Remove final modifier from DbxClientV2 and DbxTeamClientV2 class declarations for easier mocking in tests.
56

67
2.0.6 (2016-06-20)
78
---------------------------------------------

src/main/java/com/dropbox/core/v2/DbxClientV2.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* <p> This class has no mutable state, so it's thread safe as long as you pass
1717
* in a thread safe {@link HttpRequestor} implementation. </p>
1818
*/
19-
public final class DbxClientV2 extends DbxClientV2Base {
19+
public class DbxClientV2 extends DbxClientV2Base {
2020

2121
/**
2222
* Creates a client that uses the given OAuth 2 access token as

src/main/java/com/dropbox/core/v2/DbxTeamClientV2.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* <p> This class has no mutable state, so it's thread safe as long as you pass
2222
* in a thread safe {@link HttpRequestor} implementation. </p>
2323
*/
24-
public final class DbxTeamClientV2 extends DbxTeamClientV2Base {
24+
public class DbxTeamClientV2 extends DbxTeamClientV2Base {
2525
private final String accessToken;
2626

2727
/**

src/test/java/com/dropbox/core/DbxWebAuthTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ public void testFinishWithState() throws Exception {
158158
"\"token_type\":\"Bearer\"" +
159159
",\"access_token\":\"" + expected.getAccessToken() + "\"" +
160160
",\"uid\":\"" + expected.getUserId() + "\"" +
161-
",\"state\":\"" + expected.getUrlState() + "\"" +
162161
"}"
163162
).getBytes("UTF-8")
164163
);
@@ -186,9 +185,9 @@ public void testFinishWithState() throws Exception {
186185
"state", extractQueryParam(authorizationUrl, "state"))
187186
);
188187

189-
// verify the CRSF nonce was properly stripped from the finish request
188+
// verify the state param isn't send to the 'oauth2/token' endpoint
190189
String finishParams = new String(body.toByteArray(), "UTF-8");
191-
assertEquals(extractQueryParam(finishParams, "state"), state);
190+
assertNull(toParamsMap(finishParams).get("state"));
192191

193192
assertNotNull(actual);
194193
assertEquals(actual.getAccessToken(), expected.getAccessToken());

0 commit comments

Comments
 (0)