package com.agent.management.service;

import org.junit.jupiter.api.Test;

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

class CypherGuardServiceTest {
    private final CypherGuardService guard = new CypherGuardService();

    @Test
    void rejectsProcedureCalls() {
        assertThatThrownBy(() -> guard.validate("CALL db.labels() YIELD label RETURN label"))
                .hasMessageContaining("仅允许查询语句");
        assertThatThrownBy(() -> guard.validate("MATCH (n) CALL custom.write(n) RETURN n"))
                .hasMessageContaining("禁止的关键词");
    }
}
