MCPcopy Create free account
hub / github.com/CyCoreSystems/ari-proxy / TestBridgeAddChannel

Function TestBridgeAddChannel

internal/integration/bridge.go:137–165  ·  view source on GitHub ↗
(t *testing.T, s Server)

Source from the content-addressed store, hash-verified

135}
136
137func TestBridgeAddChannel(t *testing.T, s Server) {
138 key := ari.NewKey(ari.BridgeKey, "bridge1")
139
140 runTest("simple", t, s, func(t *testing.T, m *mock, cl ari.Client) {
141 m.Bridge.On("AddChannel", key, "channel1").Return(nil)
142
143 err := cl.Bridge().AddChannel(key, "channel1")
144 if err != nil {
145 t.Errorf("Unexpected error in remote AddChannel call: %v", err)
146 }
147
148 m.Shutdown()
149
150 m.Bridge.AssertCalled(t, "AddChannel", key, "channel1")
151 })
152
153 runTest("error", t, s, func(t *testing.T, m *mock, cl ari.Client) {
154 m.Bridge.On("AddChannel", key, "channel1").Return(eris.New("unknown error"))
155
156 err := cl.Bridge().AddChannel(key, "channel1")
157 if err == nil {
158 t.Errorf("Expected error to be non-nil")
159 }
160
161 m.Shutdown()
162
163 m.Bridge.AssertCalled(t, "AddChannel", key, "channel1")
164 })
165}
166
167func TestBridgeRemoveChannel(t *testing.T, s Server) {
168 key := ari.NewKey(ari.BridgeKey, "bridge1")

Callers 2

TestBridgeAddChannelFunction · 0.92
TestBridgeAddChannelFunction · 0.92

Calls 4

runTestFunction · 0.85
AddChannelMethod · 0.80
BridgeMethod · 0.80
NewMethod · 0.80

Tested by

no test coverage detected