mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Backed out changeset 4fe617216293
Reviewed By: fred2028 Differential Revision: D6539205 fbshipit-source-id: c97d4f3dbd457f59968991b043d7106e551effad
This commit is contained in:
committed by
Facebook Github Bot
parent
60dc9bed00
commit
cb49877a25
+2
-7
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user