@@ -0,0 +1,1032 @@
+package ca.six.aut.service;%0A%0Aimport android.os.Bundle;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.robolectric.Robolectric;%0Aimport org.robolectric.RobolectricTestRunner;%0Aimport org.robolectric.annotation.Config;%0A%0Aimport cn.six.aut.BuildConfig;%0Aimport cn.six.service.PushService;%0A%0Aimport static junit.framework.Assert.assertEquals;%0Aimport static org.mockito.Mockito.verify;%0A%0A/**%0A * Created by songzhw on 2016-09-27%0A */%0A@RunWith(RobolectricTestRunner.class)  // %E4%B8%8D%E7%94%A8%E8%BF%99%E4%B8%AA%EF%BC%8C %E5%B0%B1%E5%9C%A8buildActivity%E6%97%B6%E4%BC%9A%E9%94%99%E7%9A%84%0A@Config(constants = BuildConfig.class) // %E4%BF%AE%E5%A4%8D%E8%AF%B4%E6%89%BE%E4%B8%8D%E5%88%B0AndroidManifest%E7%9A%84warning%0Apublic class PushServiceTest %7B%0A    public PushService service;%0A    private Bundle data;%0A%0A    @Before%0A    public void setUp()%7B%0A        data = new Bundle();%0A        data.putString(%22testKey%22, %22robo-ing%22);%0A%0A        service = Robolectric.setupService(PushService.class);%0A        service.onMessageReceived(%2223%22, data);%0A    %7D%0A%0A    @Test%0A    public void testReceivedMessage_ID()%7B%0A        assertEquals(%2223%22, service.pushID);%0A    %7D%0A%0A%7D%0A

test the service with Robolectric