S3AccessProvider implements DataAccessServiceProvider { @Override public DataAccessor createAccessor(Config<?> initialConfig) { return new S3FileFetcher(initialConfig, false); }  @Override DataAccessor createAccessor(Config<?> initialConfig); @Override String getMode(); static final String MODE; }
@Test public void testNullInitialConfig() { Throwable exception = assertThrows( IllegalArgumentException.class, () -> provider.createAccessor(null)); assertEquals("Invalid S3Config", exception.getMessage()); }
@Test public void testCreateFileFetcherWithInvalidConfig() { Config<?> invalidConfig = createAppConfig(); Throwable exception = assertThrows( IllegalArgumentException.class, () -> provider.createAccessor(invalidConfig) ); assertEquals("Invalid S3Config", exception.getMessage()); }
@Test public void testCreateFileFetcherWithValidConfig() { Config<?> validConfig = createS3Config(); S3FileFetcher s3FileFetcher = (S3FileFetcher) provider.createAccessor(validConfig); assertNotNull(s3FileFetcher); }