package com.ai.trackwalker.capability.uav;

import org.junit.jupiter.api.Test;

import java.util.Map;

import static org.assertj.core.api.Assertions.assertThat;

class SimulatedUavVendorAdapterTest {
    private final SimulatedUavVendorAdapter adapter = new SimulatedUavVendorAdapter();

    @Test
    void exposesFourLayerHealthAndDeviceContract() {
        Map<String, Object> health = adapter.checkConnection(Map.of("id", "connection-simulator"));

        assertThat(health.get("status")).isEqualTo("AVAILABLE");
        assertThat((Iterable<?>) health.get("layers")).hasSize(4);
        assertThat(adapter.synchronizeDevices(Map.of())).hasSize(2);
    }

    @Test
    void dispatchAndCommandReturnAuditableReceipts() {
        Map<String, Object> dispatch = adapter.dispatchMission(Map.of("mission_id", "mission-1"), Map.of("route_id", "route-1"));
        Map<String, Object> command = adapter.executeCommand(Map.of("mission_id", "mission-1"), "MISSION_START", Map.of());

        assertThat(dispatch.get("accepted")).isEqualTo(true);
        assertThat(dispatch.get("vendor_mission_id")).isNotNull();
        assertThat(command.get("vendor_transaction_id")).isNotNull();
    }
}
