Skip to content

Commit 0b2fea0

Browse files
author
Dhriti Chopra
committed
formatting fixes
1 parent 5eb3623 commit 0b2fea0

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

google-cloud-storage/src/test/java/com/google/cloud/storage/ITMultipartUploadHttpRequestManagerTest.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
3131
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
3232
import com.google.api.client.http.HttpResponseException;
33+
import com.google.api.gax.rpc.FixedHeaderProvider;
3334
import com.google.cloud.storage.FakeHttpServer.HttpRequestHandler;
3435
import com.google.cloud.storage.it.ChecksummedTestContent;
3536
import com.google.cloud.storage.it.runner.StorageITRunner;
@@ -61,7 +62,6 @@
6162
import io.grpc.netty.shaded.io.netty.handler.codec.http.DefaultFullHttpResponse;
6263
import io.grpc.netty.shaded.io.netty.handler.codec.http.FullHttpRequest;
6364
import io.grpc.netty.shaded.io.netty.handler.codec.http.FullHttpResponse;
64-
import com.google.api.gax.rpc.FixedHeaderProvider;
6565
import io.grpc.netty.shaded.io.netty.handler.codec.http.HttpResponseStatus;
6666
import java.nio.ByteBuffer;
6767
import java.nio.charset.StandardCharsets;
@@ -141,12 +141,14 @@ public void sendCreateMultipartUploadRequest_success() throws Exception {
141141
public void createFrom_withExistingUserAgent() throws Exception {
142142
HttpRequestHandler handler =
143143
req -> {
144-
boolean hasCustom = req.headers().getAll("User-Agent").stream()
145-
.anyMatch(agent -> agent.contains("my-custom-agent"));
144+
boolean hasCustom =
145+
req.headers().getAll("User-Agent").stream()
146+
.anyMatch(agent -> agent.contains("my-custom-agent"));
146147
assertThat(hasCustom).isTrue();
147148
// check that it does not also contain the gcloud-java generated header
148-
boolean hasDefault = req.headers().getAll("User-Agent").stream()
149-
.anyMatch(agent -> agent.contains("gcloud-java/"));
149+
boolean hasDefault =
150+
req.headers().getAll("User-Agent").stream()
151+
.anyMatch(agent -> agent.contains("gcloud-java/"));
150152
assertThat(hasDefault).isFalse();
151153

152154
CreateMultipartUploadResponse response =
@@ -166,7 +168,8 @@ public void createFrom_withExistingUserAgent() throws Exception {
166168
try (FakeHttpServer fakeHttpServer = FakeHttpServer.of(handler)) {
167169
HttpStorageOptions options =
168170
fakeHttpServer.getHttpStorageOptions().toBuilder()
169-
.setHeaderProvider(FixedHeaderProvider.create(ImmutableMap.of("User-Agent", "my-custom-agent")))
171+
.setHeaderProvider(
172+
FixedHeaderProvider.create(ImmutableMap.of("User-Agent", "my-custom-agent")))
170173
.build();
171174

172175
MultipartUploadHttpRequestManager multipartUploadHttpRequestManager =
@@ -186,8 +189,9 @@ public void createFrom_withExistingUserAgent() throws Exception {
186189
public void createFrom_withoutExistingUserAgent() throws Exception {
187190
HttpRequestHandler handler =
188191
req -> {
189-
boolean hasDefault = req.headers().getAll("User-Agent").stream()
190-
.anyMatch(agent -> agent.startsWith("gcloud-java/"));
192+
boolean hasDefault =
193+
req.headers().getAll("User-Agent").stream()
194+
.anyMatch(agent -> agent.startsWith("gcloud-java/"));
191195
assertThat(hasDefault).isTrue();
192196

193197
CreateMultipartUploadResponse response =

0 commit comments

Comments
 (0)