package synapticloop.b2.request;

import org.apache.http.impl.client.HttpClients;
import org.junit.Test;
import synapticloop.b2.BucketType;
import synapticloop.b2.helper.B2TestHelper;
import synapticloop.b2.response.B2AuthorizeAccountResponse;
import synapticloop.b2.response.B2BucketResponse;
import synapticloop.b2.response.B2FileResponse;
import synapticloop.b2.response.B2StartLargeFileResponse;

import java.util.Collections;
import java.util.UUID;

import static org.junit.Assert.*;

public class B2StartLargeFileRequestTest {

	@Test
	public void getResponse() throws Exception {
		B2AuthorizeAccountResponse b2AuthorizeAccountResponse = B2TestHelper.getB2AuthorizeAccountResponse();

		B2BucketResponse privateBucket = B2TestHelper.createRandomPrivateBucket();

		String privateBucketId = privateBucket.getBucketId();
		B2StartLargeFileResponse b2StartLargeFileResponse = new B2StartLargeFileRequest(HttpClients.createDefault(), b2AuthorizeAccountResponse,
				privateBucketId, UUID.randomUUID().toString(), null, Collections.<String, String>emptyMap()).getResponse();
		assertNotNull(b2StartLargeFileResponse.getFileId());

		final B2GetUploadPartUrlRequest b2GetUploadPartUrlRequest = new B2GetUploadPartUrlRequest(HttpClients.createDefault(),
				b2AuthorizeAccountResponse, b2StartLargeFileResponse.getFileId());
		assertNotNull(b2GetUploadPartUrlRequest.getResponse().getUploadUrl());

		final B2FileResponse b2FileResponse = new B2CancelLargeFileRequest(HttpClients.createDefault(), b2AuthorizeAccountResponse,
				b2StartLargeFileResponse.getFileId()).getResponse();
		assertEquals(b2StartLargeFileResponse.getFileId(), b2FileResponse.getFileId());

		B2TestHelper.deleteBucket(privateBucketId);
	}
}
@@ -27,16 +27,72 @@
 quest;%0A%0A
+import org.apache.http.impl.client.CloseableHttpClient;%0A
 import o
@@ -131,16 +131,16 @@
 lients;%0A
-
 import o
@@ -269,190 +269,9 @@
 nse.
-B2AuthorizeAccountResponse;%0Aimport synapticloop.b2.response.B2BucketResponse;%0Aimport synapticloop.b2.response.B2FileResponse;%0Aimport synapticloop.b2.response.B2StartLargeFileResponse
+*
 ;%0A%0Ai
@@ -694,16 +694,83 @@
 etId();%0A
+%09%09final CloseableHttpClient client = HttpClients.createDefault();%0A%0A
 %09%09B2Star
@@ -847,35 +847,14 @@
 est(
-HttpClients.createDefault()
+client
 , b2
@@ -1143,35 +1143,14 @@
 est(
-HttpClients.createDefault()
+client
 ,%0A%09%09
@@ -1302,20 +1302,25 @@
 final B2
-File
+ListParts
 Response
@@ -1322,20 +1322,25 @@
 ponse b2
-File
+ListParts
 Response
@@ -1352,58 +1352,250 @@
 w B2
-CancelLargeFileRequest(HttpClients.createDefault()
+ListPartsRequest(client, b2AuthorizeAccountResponse,%0A%09%09%09%09b2StartLargeFileResponse.getFileId()).getResponse();%0A%09%09assertTrue(b2ListPartsResponse.getFiles().isEmpty());%0A%0A%09%09final B2FileResponse b2FileResponse = new B2CancelLargeFileRequest(client
 , b2

Add test.