@@ -966,43 +966,4 @@ public void testDelete_networkError() throws Exception {
966
966
entry .isRegistered ());
967
967
}
968
968
}
969
-
970
- @ Test
971
- public void testAppIdCheck () {
972
- // valid appid
973
- assertTrue (Utils .isValidAppIdFormat ("1:123456789:android:abcdef" ));
974
- assertTrue (Utils .isValidAppIdFormat ("1:515438998704:android:e78ec19738058349" ));
975
- assertTrue (Utils .isValidAppIdFormat ("1:208472424340:android:a243f98a00873753" ));
976
- assertTrue (Utils .isValidAppIdFormat ("1:755541669657:ios:4d6d5a5ce71e9d30" ));
977
- assertTrue (Utils .isValidAppIdFormat ("1:1086610230652:ios:852c7f6ee799ff89" ));
978
- assertTrue (Utils .isValidAppIdFormat ("1:35006771263:web:32b6f4a5b95acd2c" ));
979
- // invalid appid
980
- assertFalse (Utils .isValidAppIdFormat ("abc.abc.abc" ));
981
- assertFalse (
982
- Utils .isValidAppIdFormat (
983
- "com.google.firebase.samples.messaging.advanced" )); // using pakage name as App ID
984
- }
985
-
986
- @ Test
987
- public void testApiKeyCheck () {
988
- // valid ApiKey
989
- assertTrue (Utils .isValidApiKeyFormat ("AIzaSyabcdefghijklmnopqrstuvwxyz1234567" ));
990
- assertTrue (Utils .isValidApiKeyFormat ("AIzaSyA4UrcGxgwQFTfaI3no3t7Lt1sjmdnP5sQ" ));
991
- assertTrue (Utils .isValidApiKeyFormat ("AIzaSyA5_iVawFQ8ABuTZNUdcwERLJv_a_p4wtM" ));
992
- assertTrue (Utils .isValidApiKeyFormat ("AIzaSyANUvH9H9BsUccjsu2pCmEkOPjjaXeDQgY" ));
993
- assertTrue (Utils .isValidApiKeyFormat ("AIzaSyASWm6HmTMdYWpgMnjRBjxcQ9CKctWmLd4" ));
994
- assertTrue (Utils .isValidApiKeyFormat ("AIzaSyAdOS2zB6NCsk1pCdZ4-P6GBdi_UUPwX7c" ));
995
- assertTrue (Utils .isValidApiKeyFormat ("AIzaSyAnLA7NfeLquW1tJFpx_eQCxoX-oo6YyIs" ));
996
- // invalid ApiKey
997
- assertFalse (
998
- Utils .isValidApiKeyFormat ("BIzaSyabcdefghijklmnopqrstuvwxyz1234567" )); // wrong prefix
999
- assertFalse (Utils .isValidApiKeyFormat ("AIzaSyabcdefghijklmnopqrstuvwxyz" )); // wrong length
1000
- assertFalse (Utils .isValidApiKeyFormat ("AIzaSyabcdefghijklmno:qrstuvwxyzabcdefg" )); // wrong char
1001
- assertFalse (Utils .isValidApiKeyFormat ("AIzaSyabcdefghijklmno qrstuvwxyzabcdefg" )); // wrong char
1002
- assertFalse (
1003
- Utils .isValidApiKeyFormat (
1004
- "AAAAdpB7anM:APA91bFFK03DIT8y3l5uymwbKcUDJdYqTRSP9Qcxg8SU5kKPalEpObdx0C0xv8gQttdWlL"
1005
- + "W4hLvvHA0JoDKA6Lrvbi-edUjFCPY_WJkuvHxFwGWXjnj4yI4sPQ27mXuSVIyAbgX4aTK0QY"
1006
- + "pIKq2j1NBi7ZU75gunQg" )); // using FCM server key as API key.
1007
- }
1008
969
}
0 commit comments