@Test
public void startUploadTest() throws IOException {

  CloseableHttpResponse response = EasyMock.createNiceMock(CloseableHttpResponse.class);
  StatusLine status = EasyMock.createNiceMock(StatusLine.class);
  EasyMock.expect(response.getStatusLine()).andReturn(status).anyTimes();
  EasyMock.expect(status.getStatusCode()).andReturn(HttpStatus.SC_OK).anyTimes();
  EasyMock.replay(response, status);
  Capture<HttpPost> capturedPost = Capture.newInstance();
  EasyMock.expect(httpClient.execute(EasyMock.capture(capturedPost))).andReturn(response).anyTimes();
  EasyMock.replay(httpClient);
  // Check if correct url was invoked
  service.startUpload(httpClient, bucket, mpId, fileExtension, file, size, contentType, token);
  Assert.assertEquals("https://www.googleapis.com/upload/storage/v1/b/bucket/o?uploadType=resumable&name=mpId.flac",
          capturedPost.getValue().getURI().toString());
}