package com.sptmobile.link import android.content.Intent import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue import org.junit.Test // [unit->REQ-HAZARD-RECEIVER-DOWN] /** * The reboot-survival trigger: [BootReceiver] must re-start [LinkService] * (which hosts the webhook receiver) on the boot broadcasts and ONLY those. * onReceive itself starts a foreground service — untestable on the JVM * (Android framework classes are stubbed) — so the trigger decision is * factored into [BootReceiver.shouldStart], asserted here. */ class BootReceiverTest { @Test fun starts_on_boot_completed() { assertTrue(BootReceiver.shouldStart(Intent.ACTION_BOOT_COMPLETED)) } @Test fun starts_on_oem_quickboot() { assertTrue(BootReceiver.shouldStart(BootReceiver.ACTION_QUICKBOOT_POWERON)) } @Test fun ignores_other_broadcasts() { assertFalse(BootReceiver.shouldStart(null)) assertFalse(BootReceiver.shouldStart(Intent.ACTION_SCREEN_ON)) assertFalse(BootReceiver.shouldStart("com.example.RANDOM")) } }