Skip to content

Commit 3d75ead

Browse files
committed
test(functions): fix instrumentation tests
1 parent d939e63 commit 3d75ead

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

firebase-functions/src/androidTest/java/com/google/firebase/functions/TestFirebaseInstanceIdInternal.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@
1414

1515
package com.google.firebase.functions;
1616

17+
import androidx.annotation.NonNull;
1718
import androidx.annotation.Nullable;
19+
20+
import com.google.android.gms.tasks.Task;
21+
import com.google.android.gms.tasks.Tasks;
1822
import com.google.firebase.iid.internal.FirebaseInstanceIdInternal;
1923

24+
import java.io.IOException;
25+
2026
public class TestFirebaseInstanceIdInternal implements FirebaseInstanceIdInternal {
2127
private final String testToken;
2228

@@ -34,4 +40,20 @@ public String getId() {
3440
public String getToken() {
3541
return testToken;
3642
}
43+
44+
@NonNull
45+
@Override
46+
public Task<String> getTokenTask() {
47+
return Tasks.forResult(testToken);
48+
}
49+
50+
@Override
51+
public void deleteToken(@NonNull String s, @NonNull String s1) throws IOException {
52+
// No-op: We're not using this method in our tests
53+
}
54+
55+
@Override
56+
public void addNewTokenListener(NewTokenListener newTokenListener) {
57+
// No-op: We're not using this method in our tests
58+
}
3759
}

0 commit comments

Comments
 (0)