public void testStartAppLockServiceOnBootCompletedBroadcast() throws InterruptedException {
    MyMockContext myMockContext = new MyMockContext();

    AppLockBroadcastReceiver receiver = new AppLockBroadcastReceiver();
    receiver.onReceive(myMockContext, new Intent(Intent.ACTION_BOOT_COMPLETED));

    assertTrue(myMockContext.isServiceStarted);
  }
  public void testDoNothingOnAnyBroadcast() throws InterruptedException {
    MyMockContext myMockContext = new MyMockContext();

    AppLockBroadcastReceiver receiver = new AppLockBroadcastReceiver();
    receiver.onReceive(myMockContext, new Intent("testDoNothingOnAnyBroadcast"));

    assertFalse(myMockContext.isActivityStarted);
  }
  public void testOpenPasswordActivityOnRestrictedAppStartedBroadcast()
      throws InterruptedException {
    MyMockContext myMockContext = new MyMockContext();

    AppLockBroadcastReceiver receiver = new AppLockBroadcastReceiver();
    receiver.onReceive(
        myMockContext, new Intent(AppLockBroadcastReceiver.RESTRICTED_APP_STARTED_BROADCAST));

    assertTrue(myMockContext.isActivityStarted);
  }