test(retry): fix 48 and 114
com.google.cloud.storage.Storage.create(com.google.cloud.storage.BlobInfo, java.io.InputStream, com.google.cloud.storage.Storage.BlobWriteOption...) is never safe to retry as it does not wrap the inputstream provided to allow it to be safely read multiple times
Fixes
@@ -1477,9 +1477,9 @@ final class RpcMethodMappings {
.build());
a.add(
RpcMethodMapping.newBuilder(48, objects.insert)
- .withApplicable(TestRetryConformance::isPreconditionsProvided)
+ .withApplicable(not(TestRetryConformance::isPreconditionsProvided))
+ .withSetup(defaultSetup.andThen(blobInfoWithGenerationZero))
.withTest(
- blobInfoWithGenerationZero.andThen(
(ctx, c) ->
ctx.map(
state ->
@@ -1487,9 +1487,8 @@ final class RpcMethodMappings {
ctx.getStorage()
.create(
ctx.getState().getBlobInfo(),
- new ByteArrayInputStream(
- c.getHelloWorldUtf8Bytes()),
- BlobWriteOption.generationMatch())))))
+ new ByteArrayInputStream(c.getHelloWorldUtf8Bytes()),
+ BlobWriteOption.generationMatch()))))
.build());
a.add(
RpcMethodMapping.newBuilder(49, objects.insert)
@@ -1717,8 +1716,8 @@ final class RpcMethodMappings {
a.add(
RpcMethodMapping.newBuilder(114, objects.insert)
.withApplicable(not(TestRetryConformance::isPreconditionsProvided))
+ .withSetup(defaultSetup.andThen(blobInfoWithoutGeneration))
.withTest(
- blobInfoWithoutGeneration.andThen(
(ctx, c) ->
ctx.map(
state ->
@@ -1726,8 +1725,7 @@ final class RpcMethodMappings {
ctx.getStorage()
.create(
ctx.getState().getBlobInfo(),
- new ByteArrayInputStream(
- c.getHelloWorldUtf8Bytes()))))))
+ new ByteArrayInputStream(c.getHelloWorldUtf8Bytes())))))
.build());
a.add(
RpcMethodMapping.newBuilder(115, objects.insert)
