[
https://issues.apache.org/jira/browse/BEAM-9567?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17108746#comment-17108746
]
Kenneth Knowles commented on BEAM-9567:
---------------------------------------
In practice, our tests use Mockito to directly create a mock GcsUtil:
https://github.com/apache/beam/blob/c2f0d282337f3ae0196a7717712396a5a41fdde1/sdks/java/extensions/google-cloud-platform-core/src/test/java/org/apache/beam/sdk/extensions/gcp/util/GcsUtilTest.java#L150
What you are describing, I think, would be more typically known as a "fake": a
functional but not full scale version of the API for a service. Fakes are
usually better for testing than mocks.
> GCS needs to be testable
> ------------------------
>
> Key: BEAM-9567
> URL: https://issues.apache.org/jira/browse/BEAM-9567
> Project: Beam
> Issue Type: Improvement
> Components: io-java-gcp
> Reporter: LCID Fire
> Priority: Minor
>
> Currently AFAIK, there is no way of testing `saveAsTextFile` on GCS without
> actually connecting.
> For testing it would be good to have a way of using a mock GCS implementation.
> Wonder whether `LocalStorageHelper` might be a base for a FileSystem
> implementation.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)