private void runInitScriptIfRequired() {
        if (this.initScriptPath != null) {
            try {
                final MountableFile originalInitScript = MountableFile.forClasspathResource(this.initScriptPath);
                // The init script is executed as is by the cqlsh command, so copy it into the container. The name
                // of the script is generic since it's not important to keep the original name.
                copyFileToContainer(originalInitScript, DEFAULT_INIT_SCRIPT_FILENAME);
                new CassandraDatabaseDelegate(this).execute(null, DEFAULT_INIT_SCRIPT_FILENAME, -1, false, false);
            } catch (IllegalArgumentException e) {
                // MountableFile.forClasspathResource will throw an IllegalArgumentException if the resource cannot
                // be found.
                logger().warn("Could not load classpath init script: {}", this.initScriptPath);
                throw new ScriptLoadException(
                    "Could not load classpath init script: " + this.initScriptPath + ". Resource not found.",
                    e
                );
            } catch (ScriptUtils.ScriptStatementFailedException e) {
                logger().error("Error while executing init script: {}", this.initScriptPath, e);
                throw new ScriptUtils.UncategorizedScriptException(
                    "Error while executing init script: " + this.initScriptPath,
                    e
                );
            }
        }
    }
Load init script content and apply it to the database if initScriptPath is set
modules/cassandra/src/main/java/org/testcontainers/cassandra/CassandraContainer.java