Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
jonan committed Sep 13, 2017
1 parent d7ed877 commit 43e3c8c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

import android.test.AndroidTestCase;

import com.github.mobile.api.model.CommitComment;
import com.github.mobile.core.commit.FullCommit;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

import org.eclipse.egit.github.core.CommitComment;
import org.eclipse.egit.github.core.CommitFile;
import org.eclipse.egit.github.core.RepositoryCommit;

Expand All @@ -40,8 +40,8 @@ public void testSingleLineCommentSingleFile() {
CommitFile file = new CommitFile();
file.setFilename("a.txt");
CommitComment comment = new CommitComment();
comment.setPath(file.getFilename());
comment.setPosition(10);
comment.path = file.getFilename();
comment.position = 10;
commit.setFiles(Collections.singletonList(file));
FullCommit full = new FullCommit(commit, new ArrayList<CommitComment>(
Collections.singletonList(comment)));
Expand Down Expand Up @@ -101,8 +101,8 @@ public void testBothTypesOfComments() {
file.setFilename("a.txt");
commit.setFiles(Collections.singletonList(file));
CommitComment comment1 = new CommitComment();
comment1.setPath(file.getFilename());
comment1.setPosition(10);
comment1.path = file.getFilename();
comment1.position = 10;
CommitComment comment2 = new CommitComment();
FullCommit full = new FullCommit(commit, new ArrayList<CommitComment>(
Arrays.asList(comment1, comment2)));
Expand Down
12 changes: 10 additions & 2 deletions app/src/main/java/com/github/mobile/api/model/Comment.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package com.github.mobile.api.model;

/*
* Copyright 2017 Kavalchuk Viktar
*
Expand All @@ -15,18 +13,28 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.mobile.api.model;

import java.util.Date;

public class Comment {
public Long id;

public String html_url;

public String url;

public String body;

public String body_html;

public String body_text;

public User user;

public Date created_at;

public Date updated_at;

public ReactionSummary reactions;
}
13 changes: 9 additions & 4 deletions app/src/main/java/com/github/mobile/api/model/CommitComment.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
package com.github.mobile.api.model;

/*
* Copyright 2017 Kavalchuk Viktar
*
Expand All @@ -15,13 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.mobile.api.model;

public class CommitComment extends Comment{
public class CommitComment extends Comment {
public String path;

public Integer position;

public Integer line;

public String commit_id;

public CommitComment() {
}

public CommitComment(org.eclipse.egit.github.core.CommitComment comment) {
this.path = comment.getPath();
this.position = comment.getPosition();
Expand All @@ -36,4 +41,4 @@ public CommitComment(org.eclipse.egit.github.core.CommitComment comment) {
super.created_at = comment.getCreatedAt();
super.updated_at = comment.getUpdatedAt();
}
}
}

0 comments on commit 43e3c8c

Please sign in to comment.