24 lines
597 B
Go
24 lines
597 B
Go
package rpc
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
|
|
agentpb "git.ipao.vip/rogee/go-sip/gen/agent"
|
|
)
|
|
|
|
func TestAgentControlServiceOnlyExposesApprovedMethods(t *testing.T) {
|
|
var got []string
|
|
for _, method := range agentpb.AgentControlService_ServiceDesc.Methods {
|
|
got = append(got, method.MethodName)
|
|
}
|
|
want := []string{
|
|
"GetAgentStatus", "ActivateAgent",
|
|
"ExecuteApproved", "ApplyApprovedTaskControl", "GetLoadedSIP",
|
|
"RequestRecordingUpload", "ReportCallEnded", "ReportCallResult",
|
|
}
|
|
if !reflect.DeepEqual(got, want) {
|
|
t.Fatalf("Agent gRPC method surface = %v, want %v", got, want)
|
|
}
|
|
}
|