yquaziii commented on code in PR #40109:
URL: https://github.com/apache/beam/pull/40109#discussion_r4123077401
##########
sdks/java/core/src/test/java/org/apache/beam/sdk/io/FileSystemsTest.java:
##########
@@ -63,6 +63,38 @@ public class FileSystemsTest {
@Rule public ExpectedException thrown = ExpectedException.none();
private LocalFileSystem localFileSystem = new LocalFileSystem();
+ @Test
+ public void testMatchSingleFileSpecExceptionChaining() throws Exception {
+ java.io.IOException rootCause = new java.io.IOException("403 Forbidden:
Fake GCS Error");
+ MatchResult failedResult = MatchResult.create(MatchResult.Status.ERROR,
rootCause);
+
+ FileSystem mockFileSystem = mock(FileSystem.class);
Review Comment:
ack, Replaced the Mockito usage with a private FakeFileSystem inner class.To
keep the scope of the fix focused, the fake just accepts a predefined
MatchResult and returns it for any match request.
This avoids relying on Mockito while giving us exactly what we need to
simulate the Status.ERROR edge case natively.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]