@Test
public void testAddsAuthorization() throws Exception {

    mockWebServer.enqueue(new MockResponse().setResponseCode(200).setBody("yay!"));
    HashMap<String, String> headers = new HashMap<>();
    headers.put("Authorization", "Bearer eeeekeeeeek");
    headers.put("other_header", "foo");
    headers.put("other_header2", "bar");
    SimpleUrlConnectionFactory urlFactory = new SimpleUrlConnectionFactory(headers);
    InputStream inputStream = urlFactory.getStream(Uri.parse(baseUrl.toString()));
    Assert.assertEquals(1, mockWebServer.getRequestCount());
    RecordedRequest request = mockWebServer.takeRequest();
    Assert.assertNotNull(request.getHeader("Authorization"));
    Assert.assertNotNull(request.getHeader("other_header"));
    Assert.assertNotNull(request.getHeader("other_header2"));
}