Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jberkel committed Dec 19, 2014
1 parent 21b7b74 commit d262428
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Remove duplicates for call log restoring (#479)
* New launcher icons (Shimon Simon)
* Bug fixes (#347 #391 #409)
* Upgraded k9-mail

== 1.5.5 (1531) 07-16-2013

Expand Down
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@
</dependency>

<dependency>
<!-- https://github.com/jberkel/k-9/tree/sms-backup-plus -->
<groupId>com.fsck.k9.mail</groupId>
<artifactId>lib</artifactId>
<type>aar</type>
<version>0.0.1.e3eab38</version>
<version>0.0.1.56c26ee</version>
</dependency>

<dependency>
Expand Down
10 changes: 6 additions & 4 deletions src/test/java/com/zegoggles/smssync/service/RestoreTaskTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import android.content.ContentValues;
import android.content.Context;
import android.net.Uri;
import com.fsck.k9.mail.Message;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.store.imap.ImapStore;
import com.zegoggles.smssync.Consts;
import com.zegoggles.smssync.SmsConsts;
import com.zegoggles.smssync.auth.TokenRefresher;
Expand All @@ -29,7 +29,9 @@
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyBoolean;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;

@RunWith(RobolectricTestRunner.class)
Expand Down Expand Up @@ -77,12 +79,12 @@ public void before() throws MessagingException {
@Test
public void shouldRestoreItems() throws Exception {
Date now = new Date();
List<Message> messages = new ArrayList<Message>();
List<ImapStore.ImapMessage> messages = new ArrayList<ImapStore.ImapMessage>();
ContentValues values = new ContentValues();
values.put(SmsConsts.TYPE, SmsConsts.MESSAGE_TYPE_INBOX);
values.put(SmsConsts.DATE, now.getTime());

Message mockMessage = mock(Message.class);
ImapStore.ImapMessage mockMessage = mock(ImapStore.ImapMessage.class);
when(mockMessage.getFolder()).thenReturn(folder);
when(converter.getDataType(mockMessage)).thenReturn(DataType.SMS);
when(converter.messageToContentValues(mockMessage)).thenReturn(values);
Expand Down

0 comments on commit d262428

Please sign in to comment.