Reputation: 1349
Is it possible to create a client written in Java only, which registers just like an android phone client to receive push notifications?
My goal is: I want to create an integration test on my server which tests if a GCM push notification is really being send. I can not mock the sender of the push notification as that is in another part of the system, developed by other people. Mockito will not help me out here alas.
Rob.
Upvotes: 2
Views: 473
Reputation: 3490
You can't use Android APIs in standard Jave as a lot of required libraries are missing.
Although you could write a AndroidTestCase
which registers at the server and waits for a notification to arrive. You just need to wait for x seconds. If the notification did not arrive in the timeout or the registration failes, the test case failed.
Upvotes: 1