Backed out changeset 4fe617216293

Reviewed By: fred2028

Differential Revision: D6539205

fbshipit-source-id: c97d4f3dbd457f59968991b043d7106e551effad
This commit is contained in:
Ramanpreet Nara
2017-12-11 18:02:02 -08:00
committed by Facebook Github Bot
parent 60dc9bed00
commit cb49877a25
2 changed files with 30 additions and 42 deletions
@@ -200,10 +200,6 @@ public class NetworkingModuleTest {
@Test
public void testSuccessfulPostRequest() throws Exception {
RCTDeviceEventEmitter emitter = mock(RCTDeviceEventEmitter.class);
ReactApplicationContext context = mock(ReactApplicationContext.class);
when(context.getJSModule(any(Class.class))).thenReturn(emitter);
OkHttpClient httpClient = mock(OkHttpClient.class);
when(httpClient.newCall(any(Request.class))).thenAnswer(new Answer<Object>() {
@Override
@@ -215,13 +211,12 @@ public class NetworkingModuleTest {
OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);
when(clientBuilder.build()).thenReturn(httpClient);
when(httpClient.newBuilder()).thenReturn(clientBuilder);
NetworkingModule networkingModule = new NetworkingModule(context, "", httpClient);
NetworkingModule networkingModule =
new NetworkingModule(mock(ReactApplicationContext.class), "", httpClient);
JavaOnlyMap body = new JavaOnlyMap();
body.putString("string", "This is request body");
mockEvents();
networkingModule.sendRequest(
"POST",
"http://somedomain/bar",