@Test
  public void testPutChunkToFile() throws Exception {
    // Test file names
    String chunkFileName = "15_0_index";
    File outputFile = new File(tempDir, chunkFileName);
    byte[] data = "test data".getBytes();

    // Create temporary input file with test data
    File tempInputFile = new File(tempDir, "input-chunk.txt");
    try (FileOutputStream fos = new FileOutputStream(tempInputFile)) {
        fos.write(data);
    }

    // Ensure directory structure exists
    assertTrue("Failed to create test directory",
        outputFile.getParentFile().exists() || outputFile.getParentFile().mkdirs());

    // Write data using DataInputStream
    try (DataInputStream fis = new DataInputStream(Files.newInputStream(tempInputFile.toPath()))) {
        fileStore.writeStoreFileChunkToDisk(outputFile.getAbsolutePath(), new StoreFileChunk(fis, data.length));
    }

    // Verify written data matches original
    byte[] readData = new byte[data.length];
    // Allow some time for file system operations to complete
    Thread.sleep(20);
    try (FileInputStream fis = new FileInputStream(outputFile)) {
        assertEquals("Incorrect number of bytes read", data.length, fis.read(readData));
    }
    assertArrayEquals("Data mismatch", data, readData);
  }
Tests writing a chunk of data to a file.
Verifies:
- File is created successfully
- Data is written correctly
- Content can be read back and matches original

@throws Exception if any file operations fail
ambry-store/src/test/java/com/github/ambry/store/FileStoreTest.java