22 lines
659 B
Go
22 lines
659 B
Go
package agent
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
agentpb "git.ipao.vip/rogee/go-sip/gen/agent"
|
|
)
|
|
|
|
func TestRecordingClientRejectsMissingAuthorizedDispatcherSession(t *testing.T) {
|
|
client := RecordingClient{}
|
|
if _, err := client.RequestUpload(context.Background(), &agentpb.AssetDescriptor{}, "upload-1"); err == nil {
|
|
t.Fatal("unconfigured Agent requested an OSS upload token")
|
|
}
|
|
if err := client.ReportEnded(context.Background()); err == nil {
|
|
t.Fatal("unconfigured Agent claimed a confirmed call end")
|
|
}
|
|
if _, err := client.ReportFinal(context.Background(), []byte(`{}`), nil); err == nil {
|
|
t.Fatal("unconfigured Agent sent a final result")
|
|
}
|
|
}
|