https://codereview.appspot.com/79990043/diff/20001/google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java File google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java (right): https://codereview.appspot.com/79990043/diff/20001/google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java#newcode49 google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java:49: Do we need this empty line here? https://codereview.appspot.com/79990043/diff/20001/google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java#newcode67 google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java:67: ...
12 years, 7 months ago
(2014-03-26 20:43:06 UTC)
#5
Applied all open comments. https://codereview.appspot.com/79990043/diff/20001/google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java File google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java (right): https://codereview.appspot.com/79990043/diff/20001/google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java#newcode49 google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java:49: On 2014/03/26 20:43:06, Orest wrote: ...
12 years, 7 months ago
(2014-03-26 23:29:15 UTC)
#6
Applied all open comments.
https://codereview.appspot.com/79990043/diff/20001/google-api-client-appengin...
File
google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java
(right):
https://codereview.appspot.com/79990043/diff/20001/google-api-client-appengin...
google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java:49:
On 2014/03/26 20:43:06, Orest wrote:
> Do we need this empty line here?
Done.
https://codereview.appspot.com/79990043/diff/20001/google-api-client-appengin...
google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java:67:
assertTrue(headerContainsToken);
On 2014/03/26 20:43:06, Orest wrote:
> I would call assertTrue on 'authHeader.contains(EXPECTED_ACCESS_TOKEN)', thus
> avoiding creating the headerContainsToken local variable.
Done.
https://codereview.appspot.com/79990043/diff/20001/google-api-client-appengin...
google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/AppIdentityCredentialTest.java:68:
On 2014/03/26 20:43:06, Orest wrote:
> Do we need this empty line here?
Done.
https://codereview.appspot.com/79990043/diff/20001/google-api-client-appengin...
File
google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/MockAppIdentityService.java
(right):
https://codereview.appspot.com/79990043/diff/20001/google-api-client-appengin...
google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/MockAppIdentityService.java:73:
public GetAccessTokenResult getAccessTokenUncached(Iterable<String> arg0) {
On 2014/03/26 20:43:06, Orest wrote:
> s/arg0/scopes/
Done.
https://codereview.appspot.com/79990043/diff/20001/google-api-client-appengin...
google-api-client-appengine/src/test/java/com/google/api/client/googleapis/extensions/appengine/auth/oauth2/MockAppIdentityService.java:83:
public ParsedAppId parseFullAppId(String arg0) {
On 2014/03/26 20:43:06, Orest wrote:
> s/arg0/fullAppId/
Done.
https://codereview.appspot.com/79990043/diff/20001/google-api-client/src/test...
File
google-api-client/src/test/java/com/google/api/client/googleapis/GoogleUtilsTest.java
(right):
https://codereview.appspot.com/79990043/diff/20001/google-api-client/src/test...
google-api-client/src/test/java/com/google/api/client/googleapis/GoogleUtilsTest.java:49:
public static Map<String, String> parseQuery(String query) throws IOException {
On 2014/03/26 20:43:06, Orest wrote:
> The spirit of this class is to do just testing for GoogleUtils class.
>
> I think you may want to put your new method here:
>
https://code.google.com/p/google-api-java-client/source/browse/google-api-cli...
> .
Agreed this is the wrong place. Since it is only currently needed by test code,
we should avoid making it public production code, so I put it in a new class
TestUtils.
https://codereview.appspot.com/79990043/diff/20001/google-api-client/src/test...
File
google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredentialTest.java
(right):
https://codereview.appspot.com/79990043/diff/20001/google-api-client/src/test...
google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredentialTest.java:49:
.setJsonFactory(new JacksonFactory())
On 2014/03/26 20:43:06, Orest wrote:
> Couldn't we use JSON_FACTORY here, instead of creating another object?
Done.
https://codereview.appspot.com/79990043/diff/20001/google-api-client/src/test...
google-api-client/src/test/java/com/google/api/client/googleapis/auth/oauth2/GoogleCredentialTest.java:71:
credential.setRefreshToken(REFRESH_TOKEN);
On 2014/03/26 20:43:06, Orest wrote:
> Shouldn't the builder figure the refresh token out from the information you've
> already provided it via the transport?
The one passed to the transport is to simulate the token server having the
refresh token stored in its tables, while the copy passed to the credential
simulates getting the token from a callback at the end of a 3LO flow. So it
would not really make sense for the builder to pull this out of the mock
transport.
On 2014/03/27 01:59:05, beaton wrote: > Please do fix the string references to "UTF-8" to ...
12 years, 7 months ago
(2014-03-27 17:53:39 UTC)
#11
On 2014/03/27 01:59:05, beaton wrote:
> Please do fix the string references to "UTF-8" to use a constant defined
> somewhere. Other than that, LGTM.
For this initial test checkin there are no references to UTF-8. The following
checkin has some that I'll make sure we use a constant for. Thanks.
On 2014/03/27 17:53:39, Anthony Moore wrote: > On 2014/03/27 01:59:05, beaton wrote: > > Please ...
12 years, 7 months ago
(2014-03-27 17:59:15 UTC)
#12
On 2014/03/27 17:53:39, Anthony Moore wrote:
> On 2014/03/27 01:59:05, beaton wrote:
> > Please do fix the string references to "UTF-8" to use a constant defined
> > somewhere. Other than that, LGTM.
>
> For this initial test checkin there are no references to UTF-8. The following
> checkin has some that I'll make sure we use a constant for. Thanks.
My mistake. Fixed the remaining ones in TestUtils.
Issue 79990043: Tests and test helpers for credentials.
(Closed)
Created 12 years, 7 months ago by Anthony Moore
Modified 12 years, 6 months ago
Reviewers: Orest, wonderfly, beaton
Base URL: https://code.google.com/p/google-api-java-client/
Comments: 23