This is an automated email from the ASF dual-hosted git repository. kishoreg pushed a commit to branch pinot-fs-bug-fix in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/pinot-fs-bug-fix by this push: new d9745c9 Adding test case d9745c9 is described below commit d9745c9a0f3f809bdeff7830be2ad92e28782367 Author: kishoreg <g.kish...@gmail.com> AuthorDate: Wed Jul 8 17:43:11 2020 -0700 Adding test case --- .../org/apache/pinot/spi/filesystem/PinotFSFactoryTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pinot-spi/src/test/java/org/apache/pinot/spi/filesystem/PinotFSFactoryTest.java b/pinot-spi/src/test/java/org/apache/pinot/spi/filesystem/PinotFSFactoryTest.java index b8853d7..9490e04 100644 --- a/pinot-spi/src/test/java/org/apache/pinot/spi/filesystem/PinotFSFactoryTest.java +++ b/pinot-spi/src/test/java/org/apache/pinot/spi/filesystem/PinotFSFactoryTest.java @@ -42,18 +42,26 @@ public class PinotFSFactoryTest { public void testCustomizedSegmentFetcherFactory() { Map<String, Object> properties = new HashMap<>(); properties.put("class.file", LocalPinotFS.class.getName()); + properties.put("class.test", TestPinotFS.class.getName()); + properties.put("test.accessKey", "v1"); + properties.put("test.secretKey", "V2"); + properties.put("test.region", "us-east"); PinotFSFactory.init(new PinotConfiguration(properties)); PinotFS testPinotFS = PinotFSFactory.create("test"); Assert.assertTrue(testPinotFS instanceof TestPinotFS); Assert.assertEquals(((TestPinotFS) testPinotFS).getInitCalled(), 1); + Assert.assertEquals(((TestPinotFS) testPinotFS).getConfiguration().getProperty("accessKey"), "v1"); + Assert.assertEquals(((TestPinotFS) testPinotFS).getConfiguration().getProperty("secretKey"), "V2"); + Assert.assertEquals(((TestPinotFS) testPinotFS).getConfiguration().getProperty("region"), "us-east"); Assert.assertTrue(PinotFSFactory.create("file") instanceof LocalPinotFS); } public static class TestPinotFS extends PinotFS { public int initCalled = 0; + private PinotConfiguration _configuration; public int getInitCalled() { return initCalled; @@ -61,9 +69,14 @@ public class PinotFSFactoryTest { @Override public void init(PinotConfiguration configuration) { + _configuration = configuration; initCalled++; } + public PinotConfiguration getConfiguration() { + return _configuration; + } + @Override public boolean mkdir(URI uri) { return true; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org