@Override
    public void onReceived() throws InvalidNotificationException {
        if (!mAppLifecycleFacade.isAppVisible()) {
            postNotification(null);
            notifyReceivedBackgroundToJS();
        } else {
            notifyReceivedToJS();
        }
    }
@Test
    public void onReceived_validDataForBackgroundApp_postNotificationAndNotifyJs() throws Exception {
        // Arrange

        setUpBackgroundApp();

        // Act

        final PushNotification uut = createUUT();
        uut.onReceived();

        // Assert

        ArgumentCaptor<Notification> notificationCaptor = ArgumentCaptor.forClass(Notification.class);
        verify(mNotificationManager).notify(anyInt(), notificationCaptor.capture());
        verify(mJsIOHelper).sendEventToJS(eq(NOTIFICATION_RECEIVED_BACKGROUND_EVENT_NAME), argThat(new isValidNotification(mNotificationBundle)), eq(mReactContext));
    }