-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MM-1280 - Added new geo reporting logic
- Loading branch information
1 parent
e05a246
commit 3b6d7c5
Showing
51 changed files
with
1,867 additions
and
1,038 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 0 additions & 99 deletions
99
...ndroid-sdk/src/androidTest/java/org/infobip/mobile/messaging/BundleMessageMapperTest.java
This file was deleted.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
...g-android-sdk/src/androidTest/java/org/infobip/mobile/messaging/FCMMessageMapperTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package org.infobip.mobile.messaging; | ||
|
||
import android.os.Bundle; | ||
|
||
import junit.framework.TestCase; | ||
|
||
import org.infobip.mobile.messaging.dal.bundle.FCMMessageMapper; | ||
|
||
/** | ||
* @author sslavin | ||
* @since 29/12/2016. | ||
*/ | ||
|
||
public class FCMMessageMapperTest extends TestCase { | ||
|
||
public void test_message_should_be_possible_to_construct_message_from_bundle() throws Exception { | ||
Bundle bundle = new Bundle(); | ||
bundle.putString("gcm.notification.messageId", "SomeMessageId"); | ||
bundle.putString("gcm.notification.title", "SomeMessageTitle"); | ||
bundle.putString("gcm.notification.body", "SomeMessageBody"); | ||
bundle.putString("gcm.notification.sound", "SomeMessageSound"); | ||
bundle.putString("gcm.notification.sound2", "SomeMessageSound"); | ||
bundle.putString("gcm.notification.vibrate", "true"); | ||
bundle.putString("gcm.notification.icon", "SomeMessageIcon"); | ||
bundle.putString("gcm.notification.silent", "false"); | ||
bundle.putString("gcm.notification.category", "SomeMessageCategory"); | ||
bundle.putString("from", "SomeMessageFrom"); | ||
bundle.putLong("received_timestamp", 1234L); | ||
bundle.putLong("seen_timestamp", 5678L); | ||
bundle.putString("internalData", "{}"); | ||
bundle.putString("customPayload", "{}"); | ||
bundle.putString("destination", "SomeDestination"); | ||
bundle.putString("status", "SUCCESS"); | ||
bundle.putString("status_message", "SomeStatusMessage"); | ||
|
||
Message message = FCMMessageMapper.fromCloudBundle(bundle); | ||
|
||
assertEquals("SomeMessageId", message.getMessageId()); | ||
assertEquals("SomeMessageTitle", message.getTitle()); | ||
assertEquals("SomeMessageBody", message.getBody()); | ||
assertEquals("SomeMessageSound", message.getSound()); | ||
assertEquals(true, message.isVibrate()); | ||
assertEquals("SomeMessageIcon", message.getIcon()); | ||
assertEquals(false, message.isSilent()); | ||
assertEquals("SomeMessageCategory", message.getCategory()); | ||
assertEquals("SomeMessageFrom", message.getFrom()); | ||
assertEquals(1234L, message.getReceivedTimestamp()); | ||
assertEquals(5678L, message.getSeenTimestamp()); | ||
assertEquals(0, message.getCustomPayload().length()); | ||
assertTrue(message.getGeo() == null || message.getGeo().getAreasList() == null); | ||
assertEquals("SomeDestination", message.getDestination()); | ||
assertEquals(Message.Status.SUCCESS, message.getStatus()); | ||
assertEquals("SomeStatusMessage", message.getStatusMessage()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.