Skip to content

Commit 854cba5

Browse files
authored
test(functions): fix instrumentation tests (#4249)
* test(functions): fix instrumentation tests * fix java format
1 parent 1aefded commit 854cba5

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414

1515
package com.google.firebase.functions;
1616

17+
import androidx.annotation.NonNull;
1718
import androidx.annotation.Nullable;
19+
import com.google.android.gms.tasks.Task;
20+
import com.google.android.gms.tasks.Tasks;
1821
import com.google.firebase.iid.internal.FirebaseInstanceIdInternal;
22+
import java.io.IOException;
1923

2024
public class TestFirebaseInstanceIdInternal implements FirebaseInstanceIdInternal {
2125
private final String testToken;
@@ -34,4 +38,20 @@ public String getId() {
3438
public String getToken() {
3539
return testToken;
3640
}
41+
42+
@NonNull
43+
@Override
44+
public Task<String> getTokenTask() {
45+
return Tasks.forResult(testToken);
46+
}
47+
48+
@Override
49+
public void deleteToken(@NonNull String s, @NonNull String s1) throws IOException {
50+
// No-op: We're not using this method in our tests
51+
}
52+
53+
@Override
54+
public void addNewTokenListener(NewTokenListener newTokenListener) {
55+
// No-op: We're not using this method in our tests
56+
}
3757
}

0 commit comments

Comments
 (0)