ScribeRequest extends Request<Void> { @Override protected Map<String,String> getParams() { JSONArray jsonArray = mEventSerializer.serializeAsJson(mEvents); Map<String,String> params = new HashMap<String, String>(); params.put("log", jsonArray.toString()); return params; } ScribeRequest(@NonNull String url,
            @NonNull List<BaseEvent> events,
            @NonNull EventSerializer eventSerializer,
            @NonNull Listener listener); @NonNull @Deprecated @VisibleForTesting List<BaseEvent> getEvents();  }
@Test public void getParams_returnJsonSerializedEventsInMap() throws Exception { JSONArray mockJsonArray = mock(JSONArray.class); when(mockJsonArray.toString()).thenReturn("jsonArrayToString"); when(mockEventSerializer.serializeAsJson(mockEvents)).thenReturn(mockJsonArray); Map<String, String> params = subject.getParams(); verify(mockEventSerializer).serializeAsJson(mockEvents); assertThat(params.keySet().size()).isEqualTo(1); assertThat(params.get("log")).isEqualTo("jsonArrayToString"); }