diff --git a/processing/src/main/java/io/druid/query/lookup/LookupSnapshotTaker.java b/processing/src/main/java/io/druid/query/lookup/LookupSnapshotTaker.java index f49f4b7c120..bf9131452b7 100644 --- a/processing/src/main/java/io/druid/query/lookup/LookupSnapshotTaker.java +++ b/processing/src/main/java/io/druid/query/lookup/LookupSnapshotTaker.java @@ -37,7 +37,7 @@ import java.util.List; public class LookupSnapshotTaker { private static final Logger LOGGER = new Logger(LookupSnapshotTaker.class); - private static final String PERSIST_FILE_NAME = "lookupSnapshot.json"; + protected static final String PERSIST_FILE_NAME = "lookupSnapshot.json"; private final ObjectMapper objectMapper; private final File persistDirectory; diff --git a/processing/src/test/java/io/druid/query/lookup/LookupSnapshotTakerTest.java b/processing/src/test/java/io/druid/query/lookup/LookupSnapshotTakerTest.java index b4e3df29671..08e7d9d6d61 100644 --- a/processing/src/test/java/io/druid/query/lookup/LookupSnapshotTakerTest.java +++ b/processing/src/test/java/io/druid/query/lookup/LookupSnapshotTakerTest.java @@ -73,7 +73,10 @@ public class LookupSnapshotTakerTest public void testIOExceptionDuringLookupPersist() throws IOException { File directory = temporaryFolder.newFolder(); - directory.setReadOnly(); + File snapshotFile = new File(directory, LookupSnapshotTaker.PERSIST_FILE_NAME); + Assert.assertFalse(snapshotFile.exists()); + Assert.assertTrue(snapshotFile.createNewFile()); + Assert.assertTrue(snapshotFile.setReadOnly()); LookupSnapshotTaker lookupSnapshotTaker = new LookupSnapshotTaker(mapper, directory.getAbsolutePath()); LookupBean lookupBean = new LookupBean(); lookupBean.name = "name";