  @Test
  public void testFailGetWithInvalidHeadersStruct() 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);
    OkHttpClient.Builder clientBuilder = mock(OkHttpClient.Builder.class);
    when(clientBuilder.build()).thenReturn(httpClient);
    when(httpClient.newBuilder()).thenReturn(clientBuilder);
    NetworkingModule networkingModule = new NetworkingModule(context, "", httpClient);

    List<JavaOnlyArray> invalidHeaders = Arrays.asList(JavaOnlyArray.of("foo"));

    mockEvents();

    networkingModule.sendRequest(
      "GET",
      "http://somedoman/foo",
      /* requestId */ 0,
      /* headers */ JavaOnlyArray.from(invalidHeaders),
      /* body */ null,
      /* responseType */ "text",
      /* useIncrementalUpdates*/ true,
      /* timeout */ 0,
      /* withCredentials */ false);

    verifyErrorEmit(emitter, 0);
  }