package com.foxx.androidcast.ota;

/*********************************************************************
 * OtaApkInstallerTest.java
 * Created at: Wed 20 May 2026 14:31:55 +0200
 * Updated at: Wed 20 May 2026 15:17:13 +0200 by Anton Afanasyeu <a.afanasieff@gmail.com>
 * Commit: 5d8e82d2e60a21fff3138d2a394ee4e8b4c6dcb8
 * class OtaApkInstallerTest
 * Contributors:
 *    - Anton Afanasyeu <a.afanasieff@gmail.com> (2 commits, 30 lines)
 *    - Cursor Agent (project assistant)
 * Digest: SHA256	b1481b527a3260dc7ca23ab29438b116ee140107b969e3eb279c6dd6122051f8
**********************************************************************/
import static org.junit.Assert.assertEquals;

import org.junit.Test;

import java.io.File;
import java.io.FileOutputStream;
import java.nio.charset.StandardCharsets;

public class OtaApkInstallerTest {
    @Test
    public void sha256Hex_knownVector() throws Exception {
        File f = File.createTempFile("ota-test", ".bin");
        try (FileOutputStream fos = new FileOutputStream(f)) {
            fos.write("hello".getBytes(StandardCharsets.UTF_8));
        }
        assertEquals(
                "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824",
                OtaApkInstaller.sha256Hex(f));
        f.delete();
    }
}
