1616
1717package com .google .gcloud .storage ;
1818
19+ import static org .easymock .EasyMock .verify ;
1920import static org .junit .Assert .assertEquals ;
2021import static org .junit .Assert .assertArrayEquals ;
2122import static org .junit .Assert .assertTrue ;
3536import java .util .Arrays ;
3637import java .util .Map ;
3738import java .util .Random ;
38- import static org .easymock .EasyMock .verify ;
3939import org .junit .After ;
4040
41- public class BlobWriterChannelTest {
41+ public class BlobWriteChannelImplTest {
4242
4343 private static final String BUCKET_NAME = "b" ;
4444 private static final String BLOB_NAME = "n" ;
@@ -52,7 +52,7 @@ public class BlobWriterChannelTest {
5252
5353 private StorageOptions optionsMock ;
5454 private StorageRpc storageRpcMock ;
55- private BlobWriterChannelImpl writer ;
55+ private BlobWriteChannelImpl writer ;
5656
5757 @ Before
5858 public void setUp () throws IOException , InterruptedException {
@@ -72,7 +72,7 @@ public void testCreate() {
7272 EasyMock .replay (optionsMock );
7373 EasyMock .expect (storageRpcMock .open (BLOB_INFO .toPb (), EMPTY_RPC_OPTIONS )).andReturn (UPLOAD_ID );
7474 EasyMock .replay (storageRpcMock );
75- writer = new BlobWriterChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
75+ writer = new BlobWriteChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
7676 assertTrue (writer .isOpen ());
7777 }
7878
@@ -82,7 +82,7 @@ public void testWriteWithoutFlush() throws IOException {
8282 EasyMock .replay (optionsMock );
8383 EasyMock .expect (storageRpcMock .open (BLOB_INFO .toPb (), EMPTY_RPC_OPTIONS )).andReturn (UPLOAD_ID );
8484 EasyMock .replay (storageRpcMock );
85- writer = new BlobWriterChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
85+ writer = new BlobWriteChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
8686 assertEquals (MIN_CHUNK_SIZE , writer .write (ByteBuffer .allocate (MIN_CHUNK_SIZE )));
8787 }
8888
@@ -98,7 +98,7 @@ public void testWriteWithFlush() throws IOException {
9898 EasyMock .eq (false ));
9999 EasyMock .expectLastCall ();
100100 EasyMock .replay (storageRpcMock );
101- writer = new BlobWriterChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
101+ writer = new BlobWriteChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
102102 writer .chunkSize (CUSTOM_CHUNK_SIZE );
103103 ByteBuffer buffer = randomBuffer (CUSTOM_CHUNK_SIZE );
104104 assertEquals (CUSTOM_CHUNK_SIZE , writer .write (buffer ));
@@ -117,7 +117,7 @@ public void testWritesAndFlush() throws IOException {
117117 EasyMock .eq (false ));
118118 EasyMock .expectLastCall ();
119119 EasyMock .replay (storageRpcMock );
120- writer = new BlobWriterChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
120+ writer = new BlobWriteChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
121121 ByteBuffer [] buffers = new ByteBuffer [DEFAULT_CHUNK_SIZE / MIN_CHUNK_SIZE ];
122122 for (int i = 0 ; i < buffers .length ; i ++) {
123123 buffers [i ] = randomBuffer (MIN_CHUNK_SIZE );
@@ -142,7 +142,7 @@ public void testCloseWithoutFlush() throws IOException {
142142 EasyMock .eq (BLOB_INFO .toPb ()), EasyMock .eq (0L ), EasyMock .eq (0 ), EasyMock .eq (true ));
143143 EasyMock .expectLastCall ();
144144 EasyMock .replay (storageRpcMock );
145- writer = new BlobWriterChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
145+ writer = new BlobWriteChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
146146 assertTrue (writer .isOpen ());
147147 writer .close ();
148148 assertArrayEquals (new byte [0 ], capturedBuffer .getValue ());
@@ -162,7 +162,7 @@ public void testCloseWithFlush() throws IOException {
162162 EasyMock .eq (true ));
163163 EasyMock .expectLastCall ();
164164 EasyMock .replay (storageRpcMock );
165- writer = new BlobWriterChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
165+ writer = new BlobWriteChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
166166 assertTrue (writer .isOpen ());
167167 writer .write (buffer );
168168 writer .close ();
@@ -182,7 +182,7 @@ public void testWriteClosed() throws IOException {
182182 EasyMock .eq (BLOB_INFO .toPb ()), EasyMock .eq (0L ), EasyMock .eq (0 ), EasyMock .eq (true ));
183183 EasyMock .expectLastCall ();
184184 EasyMock .replay (storageRpcMock );
185- writer = new BlobWriterChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
185+ writer = new BlobWriteChannelImpl (optionsMock , BLOB_INFO , EMPTY_RPC_OPTIONS );
186186 writer .close ();
187187 try {
188188 writer .write (ByteBuffer .allocate (MIN_CHUNK_SIZE ));
0 commit comments