use of com.google.firebase.analytics.connector.AnalyticsConnector.AnalyticsConnectorListener in project firebase-android-sdk by firebase.
the class ProxyAnalyticsConnectorTest method registerListener_whenConnectorLoadsAfterRegistration_shouldPropagateRegistrationAndEventNames.
@Test
public void registerListener_whenConnectorLoadsAfterRegistration_shouldPropagateRegistrationAndEventNames() {
TestDeferred<AnalyticsConnector> testDeferred = new TestDeferred<>();
ProxyAnalyticsConnector proxy = new ProxyAnalyticsConnector(testDeferred);
AnalyticsConnectorListener listener = (i, bundle) -> {
};
AnalyticsConnectorHandle handle = proxy.registerAnalyticsConnectorListener("fiam", listener);
handle.registerEventNames(Collections.singleton("hello"));
testDeferred.provide(mockConnector);
verify(mockConnector).registerAnalyticsConnectorListener("fiam", listener);
verify(mockHandle, times(1)).registerEventNames(Collections.singleton("hello"));
}
use of com.google.firebase.analytics.connector.AnalyticsConnector.AnalyticsConnectorListener in project firebase-android-sdk by firebase.
the class ProxyAnalyticsConnectorTest method registerListener_whenConnectorLoadsAfterUnRegistration_shouldNotPropagateRegistrationAndEventNames.
@Test
public void registerListener_whenConnectorLoadsAfterUnRegistration_shouldNotPropagateRegistrationAndEventNames() {
TestDeferred<AnalyticsConnector> testDeferred = new TestDeferred<>();
ProxyAnalyticsConnector proxy = new ProxyAnalyticsConnector(testDeferred);
AnalyticsConnectorListener listener = (i, bundle) -> {
};
AnalyticsConnectorHandle handle = proxy.registerAnalyticsConnectorListener("fiam", listener);
handle.unregister();
handle.registerEventNames(Collections.singleton("hello"));
testDeferred.provide(mockConnector);
verify(mockConnector, never()).registerAnalyticsConnectorListener("fiam", listener);
verify(mockHandle, never()).registerEventNames(Collections.singleton("hello"));
}
Aggregations