GcsPathValidator implements PathValidator { @Override public void validateInputFilePatternSupported(String filepattern) { getGcsPath(filepattern); verifyPath(filepattern); verifyPathIsAccessible(filepattern, "Could not find file %s"); } private  GcsPathValidator(GcsOptions options); static GcsPathValidator fromOptions(PipelineOptions options); @Override void validateInputFilePatternSupported(String filepattern); @Override void validateOutputFilePrefixSupported(String filePrefix); @Override void validateOutputResourceSupported(ResourceId resourceId); @Override String verifyPath(String path);  }
@Test public void testValidFilePattern() { validator.validateInputFilePatternSupported("gs: }
@Test public void testInvalidFilePattern() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Expected a valid 'gs: validator.validateInputFilePatternSupported("/local/path"); }
@Test public void testFilePatternMissingBucket() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage( "Missing object or bucket in path: 'gs: + "did you mean: 'gs: validator.validateInputFilePatternSupported("gs: }
@Test public void testWhenBucketDoesNotExist() throws Exception { when(mockGcsUtil.bucketAccessible(any(GcsPath.class))).thenReturn(false); expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Could not find file gs: validator.validateInputFilePatternSupported("gs: }