@@ -24,31 +24,30 @@ import (
2424
2525 "github.com/stretchr/testify/require"
2626
27+ "github.com/elastic/beats/v7/libbeat/management"
2728 "github.com/elastic/beats/v7/libbeat/management/status"
28- "github.com/elastic/elastic-agent-client/v7/pkg/client"
29- "github.com/elastic/elastic-agent-client/v7/pkg/proto"
3029 "github.com/elastic/elastic-agent-libs/config"
3130)
3231
3332type testManager struct {
3433 isUnpriv bool
35- mgmtMode proto .AgentManagedMode
34+ mgmtMode management .AgentManagedMode
3635 isEnabled bool
3736}
3837
3938func (tm testManager ) UpdateStatus (_ status.Status , _ string ) {}
4039func (tm testManager ) Enabled () bool { return tm .isEnabled }
4140func (tm testManager ) Start () error { return nil }
4241func (tm testManager ) Stop () {}
43- func (tm testManager ) AgentInfo () client .AgentInfo {
44- return client .AgentInfo {Unprivileged : tm .isUnpriv , ManagedMode : tm .mgmtMode }
42+ func (tm testManager ) AgentInfo () management .AgentInfo {
43+ return management .AgentInfo {Unprivileged : tm .isUnpriv , ManagedMode : tm .mgmtMode }
4544}
46- func (tm testManager ) SetStopCallback (_ func ()) {}
47- func (tm testManager ) CheckRawConfig (_ * config.C ) error { return nil }
48- func (tm testManager ) RegisterAction (_ client .Action ) {}
49- func (tm testManager ) UnregisterAction (_ client .Action ) {}
50- func (tm testManager ) SetPayload (_ map [string ]interface {}) {}
51- func (tm testManager ) RegisterDiagnosticHook (_ string , _ string , _ string , _ string , _ client .DiagnosticHook ) {
45+ func (tm testManager ) SetStopCallback (_ func ()) {}
46+ func (tm testManager ) CheckRawConfig (_ * config.C ) error { return nil }
47+ func (tm testManager ) RegisterAction (_ management .Action ) {}
48+ func (tm testManager ) UnregisterAction (_ management .Action ) {}
49+ func (tm testManager ) SetPayload (_ map [string ]interface {}) {}
50+ func (tm testManager ) RegisterDiagnosticHook (_ string , _ string , _ string , _ string , _ management .DiagnosticHook ) {
5251}
5352
5453func TestUserAgentString (t * testing.T ) {
@@ -60,25 +59,25 @@ func TestUserAgentString(t *testing.T) {
6059 {
6160 name : "managed-unprivileged" ,
6261 beat : & Beat {Info : Info {Beat : "testbeat" },
63- Manager : testManager {isEnabled : true , isUnpriv : true , mgmtMode : proto .AgentManagedMode_MANAGED }},
62+ Manager : testManager {isEnabled : true , isUnpriv : true , mgmtMode : management .AgentManagedMode_MANAGED }},
6463 expectedComments : []string {"Managed" , "Unprivileged" },
6564 },
6665 {
6766 name : "managed-privileged" ,
6867 beat : & Beat {Info : Info {Beat : "testbeat" },
69- Manager : testManager {isEnabled : true , isUnpriv : false , mgmtMode : proto .AgentManagedMode_MANAGED }},
68+ Manager : testManager {isEnabled : true , isUnpriv : false , mgmtMode : management .AgentManagedMode_MANAGED }},
7069 expectedComments : []string {"Managed" },
7170 },
7271 {
7372 name : "unmanaged-privileged" ,
7473 beat : & Beat {Info : Info {Beat : "testbeat" },
75- Manager : testManager {isEnabled : true , isUnpriv : false , mgmtMode : proto .AgentManagedMode_STANDALONE }},
74+ Manager : testManager {isEnabled : true , isUnpriv : false , mgmtMode : management .AgentManagedMode_STANDALONE }},
7675 expectedComments : []string {"Unmanaged" },
7776 },
7877 {
7978 name : "unmanaged-unprivileged" ,
8079 beat : & Beat {Info : Info {Beat : "testbeat" },
81- Manager : testManager {isEnabled : true , isUnpriv : true , mgmtMode : proto .AgentManagedMode_STANDALONE }},
80+ Manager : testManager {isEnabled : true , isUnpriv : true , mgmtMode : management .AgentManagedMode_STANDALONE }},
8281 expectedComments : []string {"Unmanaged" , "Unprivileged" },
8382 },
8483 {
0 commit comments