Skip to content

Commit

Permalink
Review author message is actually a UserProfile message
Browse files Browse the repository at this point in the history
  • Loading branch information
yeriomin committed Aug 3, 2018
1 parent 988b3aa commit 8815b92
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 25 deletions.
14 changes: 5 additions & 9 deletions src/main/proto/GooglePlay.proto
Original file line number Diff line number Diff line change
Expand Up @@ -980,10 +980,6 @@ message PayloadApi {
message UserProfileResponse {
optional UserProfile userProfile = 1;
}
message UserProfile {
optional string userId = 2;
repeated Image image = 10;
}
message ServerCommands {
optional bool clearCache = 1;
optional string displayErrorMessage = 2;
Expand All @@ -1006,20 +1002,20 @@ message Review {
optional string deviceName = 19;
optional string replyText = 29;
optional int64 replyTimestampMsec = 30;
optional Author author = 31;
optional Author2 author2 = 33;
optional ReviewAuthor author = 31;
optional UserProfile userProfile = 33;
}
message Author {
message ReviewAuthor {
optional string name = 2;
optional Image avatar = 5;
}
message Author2 {
message UserProfile {
optional string personIdString = 1;
optional string personId = 2;
optional int32 unknown1 = 3;
optional int32 unknown2 = 4;
optional string name = 5;
optional Image avatar = 10;
repeated Image image = 10;
optional string googlePlusUrl = 19;
optional string googlePlusTagline = 22;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,10 @@ public void currentReview() throws Exception {
Assert.assertEquals(1, response.getGetResponse().getReviewCount());
Assert.assertEquals(4, response.getGetResponse().getReview(0).getStarRating());
Assert.assertEquals("Good", response.getGetResponse().getReview(0).getComment());
Assert.assertEquals("Yalp Store", response.getGetResponse().getReview(0).getAuthor2().getName());
Assert.assertEquals("https://lh5.googleusercontent.com/-O1xATtrLivM/AAAAAAAAAAI/AAAAAAAAAAA/AAnnY7pEJJJVH9ZwCTIz_Ve-QLleM9qn7A/photo.jpg", response.getGetResponse().getReview(0).getAuthor2().getAvatar().getImageUrl());
Assert.assertEquals("117839429276925272251", response.getGetResponse().getReview(0).getAuthor2().getPersonId());
Assert.assertEquals("person-117839429276925272251", response.getGetResponse().getReview(0).getAuthor2().getPersonIdString());
Assert.assertEquals("Yalp Store", response.getGetResponse().getReview(0).getUserProfile().getName());
Assert.assertEquals("https://lh5.googleusercontent.com/-O1xATtrLivM/AAAAAAAAAAI/AAAAAAAAAAA/AAnnY7pEJJJVH9ZwCTIz_Ve-QLleM9qn7A/photo.jpg", response.getGetResponse().getReview(0).getUserProfile().getImage(0).getImageUrl());
Assert.assertEquals("117839429276925272251", response.getGetResponse().getReview(0).getUserProfile().getPersonId());
Assert.assertEquals("person-117839429276925272251", response.getGetResponse().getReview(0).getUserProfile().getPersonIdString());

List<Request> requests = ((MockOkHttpClientAdapter) api.getClient()).getRequests();
Assert.assertEquals(1, requests.size());
Expand All @@ -464,11 +464,11 @@ public void reviews() throws Exception {
Assert.assertTrue(response.getGetResponse().getReviewCount() > 0);
Assert.assertEquals(5, response.getGetResponse().getReview(0).getStarRating());
Assert.assertEquals("It is awesome app I install and it work success fully", response.getGetResponse().getReview(1).getComment());
Assert.assertEquals("Nitesh Kumar", response.getGetResponse().getReview(0).getAuthor2().getName());
Assert.assertEquals("https://plus.google.com/+NiteshKumar", response.getGetResponse().getReview(0).getAuthor2().getGooglePlusUrl());
Assert.assertEquals("https://lh3.googleusercontent.com/-t-T8LKa60Fc/AAAAAAAAAAI/AAAAAAAAStk/wS6mDBhiWQA/photo.jpg", response.getGetResponse().getReview(0).getAuthor2().getAvatar().getImageUrl());
Assert.assertEquals("104245217570938637686", response.getGetResponse().getReview(0).getAuthor2().getPersonId());
Assert.assertEquals("person-104245217570938637686", response.getGetResponse().getReview(0).getAuthor2().getPersonIdString());
Assert.assertEquals("Nitesh Kumar", response.getGetResponse().getReview(0).getUserProfile().getName());
Assert.assertEquals("https://plus.google.com/+NiteshKumar", response.getGetResponse().getReview(0).getUserProfile().getGooglePlusUrl());
Assert.assertEquals("https://lh3.googleusercontent.com/-t-T8LKa60Fc/AAAAAAAAAAI/AAAAAAAAStk/wS6mDBhiWQA/photo.jpg", response.getGetResponse().getReview(0).getUserProfile().getImage(0).getImageUrl());
Assert.assertEquals("104245217570938637686", response.getGetResponse().getReview(0).getUserProfile().getPersonId());
Assert.assertEquals("person-104245217570938637686", response.getGetResponse().getReview(0).getUserProfile().getPersonIdString());

List<Request> requests = ((MockOkHttpClientAdapter) api.getClient()).getRequests();
Assert.assertEquals(1, requests.size());
Expand All @@ -490,11 +490,11 @@ public void addReview() throws Exception {
Assert.assertTrue(response.hasUserReview());
Assert.assertEquals(5, response.getUserReview().getStarRating());
Assert.assertEquals("Работает!", response.getUserReview().getComment());
Assert.assertEquals("konstantin razdolbaev", response.getUserReview().getAuthor2().getName());
Assert.assertEquals("", response.getUserReview().getAuthor2().getGooglePlusUrl());
Assert.assertEquals("https://lh3.googleusercontent.com/-PkFVwXLKCKk/AAAAAAAAAAI/AAAAAAAAAAA/AKB_U8valX_uc0SKPSZEhVtxDUqYtRwIgQ/photo.jpg", response.getUserReview().getAuthor2().getAvatar().getImageUrl());
Assert.assertEquals("100687909122075437983", response.getUserReview().getAuthor2().getPersonId());
Assert.assertEquals("person-100687909122075437983", response.getUserReview().getAuthor2().getPersonIdString());
Assert.assertEquals("konstantin razdolbaev", response.getUserReview().getUserProfile().getName());
Assert.assertEquals("", response.getUserReview().getUserProfile().getGooglePlusUrl());
Assert.assertEquals("https://lh3.googleusercontent.com/-PkFVwXLKCKk/AAAAAAAAAAI/AAAAAAAAAAA/AKB_U8valX_uc0SKPSZEhVtxDUqYtRwIgQ/photo.jpg", response.getUserReview().getUserProfile().getImage(0).getImageUrl());
Assert.assertEquals("100687909122075437983", response.getUserReview().getUserProfile().getPersonId());
Assert.assertEquals("person-100687909122075437983", response.getUserReview().getUserProfile().getPersonIdString());

List<Request> requests = ((MockOkHttpClientAdapter) api.getClient()).getRequests();
Assert.assertEquals(1, requests.size());
Expand Down Expand Up @@ -677,8 +677,7 @@ public void reportAbuse() throws Exception {
public void userProfile() throws Exception {
UserProfileResponse response = api.userProfile();
Assert.assertTrue(response.hasUserProfile());
Assert.assertEquals("115275627922389268197", response.getUserProfile().getUserId());
Assert.assertEquals(2, response.getUserProfile().getImageCount());
Assert.assertEquals("115275627922389268197", response.getUserProfile().getPersonId());
Assert.assertEquals(4, response.getUserProfile().getImage(0).getImageType());
Assert.assertEquals("https://lh5.googleusercontent.com/-NxRLoKjJ7LM/AAAAAAAAAAI/AAAAAAAAAAA/AGi4gfwqBhB2A69d0pMdvrYAhASD_01wVA/photo.jpg", response.getUserProfile().getImage(0).getImageUrl());
}
Expand Down

0 comments on commit 8815b92

Please sign in to comment.