@Test public void logEvent_sendsEventParams() { metricsLoggerClient = new MetricsLoggerClient( engagementMetricsLoggerInterface, analytics, firebaseApp, firebaseInstallations, clock, developerListenerManager); metricsLoggerClient.logImpression(BANNER_MESSAGE_MODEL); assertThat(analytics.getLoggedEvent().size()).isEqualTo(1); LoggedEvent actual = analytics.getLoggedEvent().get(0); assertThat(actual.origin).isEqualTo(AnalyticsConstants.ORIGIN_FIAM); assertThat(actual.name).isEqualTo(AnalyticsConstants.ANALYTICS_IMPRESSION_EVENT); Bundle actualParams = actual.params; assertThat(actualParams.getString(AnalyticsConstants.PARAM_MESSAGE_ID)) .isEqualTo(CAMPAIGN_ID_STRING); assertThat(actualParams.getString(AnalyticsConstants.PARAM_MESSAGE_NAME)) .isEqualTo(CAMPAIGN_NAME_STRING); int epochSeconds = (int) (NOW / 1000); assertThat(actualParams.getInt(AnalyticsConstants.PARAM_MESSAGE_DEVICE_TIME)) .isEqualTo(epochSeconds); }
void logImpression(InAppMessage message) { if (!isTestCampaign(message)) { firebaseInstallations .getId() .addOnSuccessListener( id -> engagementMetricsLogger.logEvent( createEventEntry(message, id, IMPRESSION_EVENT_TYPE).toByteArray())); logEventAsync( message, AnalyticsConstants.ANALYTICS_IMPRESSION_EVENT, impressionCountsAsConversion(message)); } developerListenerManager.impressionDetected(message); }
MetricsLoggerClient { void logImpression(InAppMessage message) { if (!isTestCampaign(message)) { firebaseInstallations .getId() .addOnSuccessListener( id -> engagementMetricsLogger.logEvent( createEventEntry(message, id, IMPRESSION_EVENT_TYPE).toByteArray())); logEventAsync( message, AnalyticsConstants.ANALYTICS_IMPRESSION_EVENT, impressionCountsAsConversion(message)); } developerListenerManager.impressionDetected(message); } }
MetricsLoggerClient { void logImpression(InAppMessage message) { if (!isTestCampaign(message)) { firebaseInstallations .getId() .addOnSuccessListener( id -> engagementMetricsLogger.logEvent( createEventEntry(message, id, IMPRESSION_EVENT_TYPE).toByteArray())); logEventAsync( message, AnalyticsConstants.ANALYTICS_IMPRESSION_EVENT, impressionCountsAsConversion(message)); } developerListenerManager.impressionDetected(message); } MetricsLoggerClient(
      EngagementMetricsLoggerInterface engagementMetricsLogger,
      AnalyticsConnector analyticsConnector,
      FirebaseApp firebaseApp,
      FirebaseInstallationsApi firebaseInstallations,
      Clock clock,
      DeveloperListenerManager developerListenerManager); }
MetricsLoggerClient { void logImpression(InAppMessage message) { if (!isTestCampaign(message)) { firebaseInstallations .getId() .addOnSuccessListener( id -> engagementMetricsLogger.logEvent( createEventEntry(message, id, IMPRESSION_EVENT_TYPE).toByteArray())); logEventAsync( message, AnalyticsConstants.ANALYTICS_IMPRESSION_EVENT, impressionCountsAsConversion(message)); } developerListenerManager.impressionDetected(message); } MetricsLoggerClient(
      EngagementMetricsLoggerInterface engagementMetricsLogger,
      AnalyticsConnector analyticsConnector,
      FirebaseApp firebaseApp,
      FirebaseInstallationsApi firebaseInstallations,
      Clock clock,
      DeveloperListenerManager developerListenerManager);  }
MetricsLoggerClient { void logImpression(InAppMessage message) { if (!isTestCampaign(message)) { firebaseInstallations .getId() .addOnSuccessListener( id -> engagementMetricsLogger.logEvent( createEventEntry(message, id, IMPRESSION_EVENT_TYPE).toByteArray())); logEventAsync( message, AnalyticsConstants.ANALYTICS_IMPRESSION_EVENT, impressionCountsAsConversion(message)); } developerListenerManager.impressionDetected(message); } MetricsLoggerClient(
      EngagementMetricsLoggerInterface engagementMetricsLogger,
      AnalyticsConnector analyticsConnector,
      FirebaseApp firebaseApp,
      FirebaseInstallationsApi firebaseInstallations,
      Clock clock,
      DeveloperListenerManager developerListenerManager);   }