Skip to content

Migrate from GoogleRobolectricTestRunner to RobolectricTestRunner #1596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
import android.content.Context;
import android.content.Intent;
import com.google.firebase.messaging.cpp.MessageWriter;
import com.google.thirdparty.robolectric.GoogleRobolectricTestRunner;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;

@RunWith(GoogleRobolectricTestRunner.class)
@RunWith(RobolectricTestRunner.class)
public final class MessageForwardingServiceTest {
@Mock private Context context;
@Mock private MessageWriter messageWriter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
import android.os.Bundle;
import com.google.firebase.messaging.RemoteMessage;
import com.google.firebase.messaging.RemoteMessageUtil;
import com.google.thirdparty.robolectric.GoogleRobolectricTestRunner;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;

@RunWith(GoogleRobolectricTestRunner.class)
@RunWith(RobolectricTestRunner.class)
public final class ListenerServiceTest {
@Mock private MessageWriter messageWriter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.google.common.io.ByteStreams;
import com.google.firebase.messaging.RemoteMessage;
import com.google.firebase.messaging.RemoteMessageUtil;
import com.google.thirdparty.robolectric.GoogleRobolectricTestRunner;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.ByteBuffer;
Expand All @@ -37,8 +36,9 @@
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;

@RunWith(GoogleRobolectricTestRunner.class)
@RunWith(RobolectricTestRunner.class)
public final class MessageWriterTest {
private static final Path STORAGE_FILE_PATH = Paths.get("/tmp/" + MessageWriter.STORAGE_FILE);

Expand Down
4 changes: 2 additions & 2 deletions testing/templates/JavaTest.java.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.google.firebase.test;

import android.app.Activity;
import com.google.thirdparty.robolectric.GoogleRobolectricTestRunner;
import org.robolectric.RobolectricTestRunner;
import org.junit.Assert;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
Expand All @@ -10,7 +10,7 @@ import org.robolectric.Robolectric;
import org.robolectric.annotation.Config;

/** A test wrapper that wraps around native C++ code that calls RUN_ALL_TESTS(). */
@RunWith(GoogleRobolectricTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(manifest = Config.NONE)
public final class $wrapper_name {
@Test
Expand Down
4 changes: 2 additions & 2 deletions testing/templates/RobolectricTest.java.tmpl
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package com.google.firebase.test.runner;

import com.google.firebase.test.$activity_name;
import com.google.thirdparty.robolectric.GoogleRobolectricTestRunner;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

/** A test wrapper that wraps around native C++ code that calls RUN_ALL_TESTS(). */
@RunWith(GoogleRobolectricTestRunner.class)
@RunWith(RobolectricTestRunner.class)
@Config(manifest = Config.NONE)
public class $wrapper_name {
@Test
Expand Down
Loading