Skip to content

Commit 30f71bb

Browse files
authored
fix broken fiam tests (#1181)
1 parent 08af4ed commit 30f71bb

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

firebase-inappmessaging/src/androidTest/java/com/google/firebase/inappmessaging/FirebaseInAppMessagingFlowableTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
import com.google.firebase.inappmessaging.CommonTypesProto.TriggeringCondition;
5959
import com.google.firebase.inappmessaging.FirebaseInAppMessagingDisplayCallbacks.InAppMessagingDismissType;
6060
import com.google.firebase.inappmessaging.FirebaseInAppMessagingDisplayCallbacks.InAppMessagingErrorReason;
61+
import com.google.firebase.inappmessaging.internal.AbtIntegrationHelper;
6162
import com.google.firebase.inappmessaging.internal.DisplayCallbacksFactory;
6263
import com.google.firebase.inappmessaging.internal.MetricsLoggerClient;
6364
import com.google.firebase.inappmessaging.internal.ProgramaticContextualTriggers;
@@ -167,6 +168,8 @@ public class FirebaseInAppMessagingFlowableTest {
167168
@Mock private FirebaseInstanceId instanceId;
168169
@Mock private TestDeviceHelper testDeviceHelper;
169170
@Mock private Subscriber firebaseEventSubscriber;
171+
@Mock private AbtIntegrationHelper abtIntegrationHelper;
172+
170173
private TestSubscriber<InAppMessage> subscriber;
171174
private FirebaseInAppMessaging instance;
172175
private TestForegroundNotifier foregroundNotifier;
@@ -246,6 +249,7 @@ public void setUp() {
246249
appComponentBuilder =
247250
DaggerTestAppComponent.builder()
248251
.universalComponent(universalComponent)
252+
.testAbTestingModule(new TestAbTestingModule(abtIntegrationHelper))
249253
.testEngagementMetricsLoggerClientModule(
250254
new TestEngagementMetricsLoggerClientModule(app, engagementMetricsLoggerInterface))
251255
.grpcClientModule(new GrpcClientModule(app))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2020 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package com.google.firebase.inappmessaging;
16+
17+
import com.google.firebase.inappmessaging.internal.AbtIntegrationHelper;
18+
import dagger.Module;
19+
import dagger.Provides;
20+
21+
/** Test Provider for ABTesting Module */
22+
@Module
23+
class TestAbTestingModule {
24+
private final AbtIntegrationHelper abtIntegrationHelper;
25+
26+
TestAbTestingModule(AbtIntegrationHelper abtIntegrationHelper) {
27+
this.abtIntegrationHelper = abtIntegrationHelper;
28+
}
29+
30+
@Provides
31+
AbtIntegrationHelper providesAbtIntegrationHelper() {
32+
return this.abtIntegrationHelper;
33+
}
34+
}

firebase-inappmessaging/src/androidTest/java/com/google/firebase/inappmessaging/TestAppComponent.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
// Test modules
2828
TestApiClientModule.class,
2929
TestEngagementMetricsLoggerClientModule.class,
30+
TestAbTestingModule.class,
3031

3132
// Real modules
3233
GrpcClientModule.class

0 commit comments

Comments
 (0)