Skip to content

Commit

Permalink
Migrate from GoogleRobolectricTestRunner to RobolectricTestRunner (#1596
Browse files Browse the repository at this point in the history
)

GoogleRobolectricTestRunner is internal to Google and is obsolete.
Migrate all references to RobolectricTestRunner.
  • Loading branch information
hoisie authored May 24, 2024
1 parent 62eac55 commit df09d59
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
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

0 comments on commit df09d59

Please sign in to comment.