Skip to content

Instantly share code, notes, and snippets.

@heitorcolangelo
Created August 4, 2016 16:50
Show Gist options
  • Save heitorcolangelo/b5b88d44c981d1d58d8575552eb36009 to your computer and use it in GitHub Desktop.
Save heitorcolangelo/b5b88d44c981d1d58d8575552eb36009 to your computer and use it in GitHub Desktop.
MainActivityTest - configuring MockWebServer
@RunWith(AndroidJUnit4.class)
public class MainActivityTest {
private MockWebServer server;
@Rule
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
@Before
public void setUp() throws Exception {
server = new MockWebServer();
server.start();
}
@After
public void tearDown() throws IOException {
server.shutdown();
}
}
@adeoye233
Copy link

its pretty cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment