MessageCenterResolver extends UrbanAirshipResolver { int markMessagesRead(@NonNull Set<String> messageIds) { ContentValues values = new ContentValues(); values.put(MessageCenterDataManager.MessageTable.COLUMN_NAME_UNREAD, false); return this.updateMessages(messageIds, values); } MessageCenterResolver(Context context);   }
@Test public void testMarkMessagesRead() { Set<String> keys = new HashSet<>(); keys.add("1_message_id"); keys.add("2_message_id"); keys.add("6_message_id"); int updated = resolver.markMessagesRead(keys); assertEquals(keys.size(), updated); for (Message message : resolver.getMessages()) { if (!message.isRead()) { continue; } if (keys.contains(message.getMessageId())) { keys.remove(message.getMessageId()); } else { fail("Unexpected message read: " + message); } } assertEquals(0, keys.size()); assertEquals(10, resolver.getMessages().size()); }