From 02863adc1b370a45d30073f92caa9207c6161068 Mon Sep 17 00:00:00 2001 From: Anastasia Repina Date: Wed, 31 Jan 2018 12:34:32 +0300 Subject: [PATCH 1/2] Fixed the test --- .../java/com/github/mobile/tests/issue/IssueFilterTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/androidTest/java/com/github/mobile/tests/issue/IssueFilterTest.java b/app/src/androidTest/java/com/github/mobile/tests/issue/IssueFilterTest.java index f131a79b..f129f194 100644 --- a/app/src/androidTest/java/com/github/mobile/tests/issue/IssueFilterTest.java +++ b/app/src/androidTest/java/com/github/mobile/tests/issue/IssueFilterTest.java @@ -57,9 +57,10 @@ public void testEqualFilter() { assertEquals(filter1.hashCode(), filter2.hashCode()); Milestone milestone = new Milestone().setNumber(3); - filter1.setMilestone(milestone); + com.github.mobile.api.model.Milestone extraMilestone = new com.github.mobile.api.model.Milestone(milestone); + filter1.setMilestone(extraMilestone); assertFalse(filter1.equals(filter2)); - filter2.setMilestone(milestone); + filter2.setMilestone(extraMilestone); assertEquals(filter1, filter2); assertEquals(filter1.hashCode(), filter2.hashCode()); } From cf31ab7e323b515cb0ee791b29cbf19fca2c000c Mon Sep 17 00:00:00 2001 From: Andrey Beryukhov Date: Wed, 7 Feb 2018 22:36:06 +0300 Subject: [PATCH 2/2] Fix crashes found by ui tests --- app/src/main/java/com/github/mobile/api/model/Milestone.java | 3 ++- .../com/github/mobile/ui/issue/EditIssuesFilterActivity.java | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/github/mobile/api/model/Milestone.java b/app/src/main/java/com/github/mobile/api/model/Milestone.java index 4200e2d7..776aade9 100644 --- a/app/src/main/java/com/github/mobile/api/model/Milestone.java +++ b/app/src/main/java/com/github/mobile/api/model/Milestone.java @@ -57,7 +57,8 @@ public Milestone(org.eclipse.egit.github.core.Milestone milestone) { this.state = milestone.getState(); this.title = milestone.getTitle(); this.description = milestone.getDescription(); - this.creator = new User(milestone.getCreator()); + org.eclipse.egit.github.core.User creator = milestone.getCreator(); + this.creator = creator == null ? null : new User(creator); this.open_issues = milestone.getOpenIssues(); this.closed_issues = milestone.getClosedIssues(); this.created_at = milestone.getCreatedAt(); diff --git a/app/src/main/java/com/github/mobile/ui/issue/EditIssuesFilterActivity.java b/app/src/main/java/com/github/mobile/ui/issue/EditIssuesFilterActivity.java index df4b81d5..c6c491eb 100644 --- a/app/src/main/java/com/github/mobile/ui/issue/EditIssuesFilterActivity.java +++ b/app/src/main/java/com/github/mobile/ui/issue/EditIssuesFilterActivity.java @@ -236,9 +236,9 @@ private void updateLabels() { } private void updateMilestone() { - Milestone selected = filter.getMilestone().getOldModel(); + com.github.mobile.api.model.Milestone selected = filter.getMilestone(); if (selected != null) - milestoneText.setText(selected.getTitle()); + milestoneText.setText(selected.getOldModel().getTitle()); else milestoneText.setText(R.string.none); }