@@ -11,6 +11,8 @@ import (
1111 "testing"
1212 "time"
1313
14+ "github.com/nginx/agent/v3/internal/model"
15+
1416 pkg "github.com/nginx/agent/v3/pkg/config"
1517 "github.com/nginx/agent/v3/pkg/id"
1618
@@ -32,14 +34,14 @@ import (
3234)
3335
3436func TestCommandPlugin_Info (t * testing.T ) {
35- commandPlugin := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, Command )
37+ commandPlugin := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, model . Command )
3638 info := commandPlugin .Info ()
3739
3840 assert .Equal (t , "command" , info .Name )
3941}
4042
4143func TestCommandPlugin_Subscriptions (t * testing.T ) {
42- commandPlugin := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, Command )
44+ commandPlugin := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, model . Command )
4345 subscriptions := commandPlugin .Subscriptions ()
4446
4547 assert .Equal (
@@ -60,7 +62,7 @@ func TestCommandPlugin_Init(t *testing.T) {
6062 messagePipe := busfakes .NewFakeMessagePipe ()
6163 fakeCommandService := & commandfakes.FakeCommandService {}
6264
63- commandPlugin := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, Command )
65+ commandPlugin := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, model . Command )
6466 err := commandPlugin .Init (ctx , messagePipe )
6567 require .NoError (t , err )
6668
@@ -79,7 +81,7 @@ func TestCommandPlugin_createConnection(t *testing.T) {
7981 commandService .CreateConnectionReturns (& mpi.CreateConnectionResponse {}, nil )
8082 messagePipe := busfakes .NewFakeMessagePipe ()
8183
82- commandPlugin := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, Command )
84+ commandPlugin := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, model . Command )
8385 err := commandPlugin .Init (ctx , messagePipe )
8486 commandPlugin .commandService = commandService
8587 require .NoError (t , err )
@@ -111,7 +113,7 @@ func TestCommandPlugin_Process(t *testing.T) {
111113 messagePipe := busfakes .NewFakeMessagePipe ()
112114 fakeCommandService := & commandfakes.FakeCommandService {}
113115
114- commandPlugin := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, Command )
116+ commandPlugin := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, model . Command )
115117 err := commandPlugin .Init (ctx , messagePipe )
116118 require .NoError (t , err )
117119 defer commandPlugin .Close (ctx )
@@ -219,7 +221,7 @@ func TestCommandPlugin_monitorSubscribeChannel(t *testing.T) {
219221
220222 agentConfig := types .AgentConfig ()
221223 agentConfig .Features = test .configFeatures
222- commandPlugin := NewCommandPlugin (agentConfig , & grpcfakes.FakeGrpcConnectionInterface {}, Command )
224+ commandPlugin := NewCommandPlugin (agentConfig , & grpcfakes.FakeGrpcConnectionInterface {}, model . Command )
223225 err := commandPlugin .Init (ctx , messagePipe )
224226 require .NoError (tt , err )
225227 defer commandPlugin .Close (ctx )
@@ -319,7 +321,7 @@ func TestCommandPlugin_FeatureDisabled(t *testing.T) {
319321
320322 agentConfig .Features = test .configFeatures
321323
322- commandPlugin := NewCommandPlugin (agentConfig , & grpcfakes.FakeGrpcConnectionInterface {}, Command )
324+ commandPlugin := NewCommandPlugin (agentConfig , & grpcfakes.FakeGrpcConnectionInterface {}, model . Command )
323325 err := commandPlugin .Init (ctx , messagePipe )
324326 commandPlugin .commandService = fakeCommandService
325327 require .NoError (tt , err )
@@ -344,7 +346,7 @@ func TestMonitorSubscribeChannel(t *testing.T) {
344346 logBuf := & bytes.Buffer {}
345347 stub .StubLoggerWith (logBuf )
346348
347- cp := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, Command )
349+ cp := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, model . Command )
348350 cp .subscribeCancel = cncl
349351
350352 message := protos .CreateManagementPlaneRequest ()
@@ -383,7 +385,7 @@ func Test_createDataPlaneResponse(t *testing.T) {
383385 Error : "" ,
384386 },
385387 }
386- commandPlugin := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, Command )
388+ commandPlugin := NewCommandPlugin (types .AgentConfig (), & grpcfakes.FakeGrpcConnectionInterface {}, model . Command )
387389 result := commandPlugin .createDataPlaneResponse (expected .GetMessageMeta ().GetCorrelationId (),
388390 expected .GetCommandResponse ().GetStatus (),
389391 expected .GetCommandResponse ().GetMessage (), expected .GetCommandResponse ().GetError ())
0 commit comments