Skip to content

Commit 329c503

Browse files
committed
add tests to verify
1 parent 95391ba commit 329c503

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

messaging/messaging_test.go

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,63 @@ var validMessages = []struct {
683683
"topic": "test-topic",
684684
},
685685
},
686+
{
687+
name: "AndroidNotificationProxyAllow",
688+
req: &Message{
689+
Android: &AndroidConfig{
690+
Notification: &AndroidNotification{
691+
Proxy: ProxyAllow,
692+
},
693+
},
694+
Topic: "test-topic",
695+
},
696+
want: map[string]interface{}{
697+
"android": map[string]interface{}{
698+
"notification": map[string]interface{}{
699+
"proxy": "ALLOW",
700+
},
701+
},
702+
"topic": "test-topic",
703+
},
704+
},
705+
{
706+
name: "AndroidNotificationProxyDeny",
707+
req: &Message{
708+
Android: &AndroidConfig{
709+
Notification: &AndroidNotification{
710+
Proxy: ProxyDeny,
711+
},
712+
},
713+
Topic: "test-topic",
714+
},
715+
want: map[string]interface{}{
716+
"android": map[string]interface{}{
717+
"notification": map[string]interface{}{
718+
"proxy": "DENY",
719+
},
720+
},
721+
"topic": "test-topic",
722+
},
723+
},
724+
{
725+
name: "AndroidNotificationProxyIfPriorityLowered",
726+
req: &Message{
727+
Android: &AndroidConfig{
728+
Notification: &AndroidNotification{
729+
Proxy: ProxyIfPriorityLowered,
730+
},
731+
},
732+
Topic: "test-topic",
733+
},
734+
want: map[string]interface{}{
735+
"android": map[string]interface{}{
736+
"notification": map[string]interface{}{
737+
"proxy": "IF_PRIORITY_LOWERED",
738+
},
739+
},
740+
"topic": "test-topic",
741+
},
742+
},
686743
}
687744

688745
var invalidMessages = []struct {

0 commit comments

Comments
 (0)