@@ -33,6 +33,7 @@ import (
3333 "github.com/thunder-id/thunderid/tests/mocks/entitymock"
3434 "github.com/thunder-id/thunderid/tests/mocks/inboundclientmock"
3535 "github.com/thunder-id/thunderid/tests/mocks/oumock"
36+ "github.com/thunder-id/thunderid/tests/mocks/rolemock"
3637)
3738
3839func setupAgentConfig (t * testing.T , agentStore string , declarativeEnabled bool ) {
@@ -100,12 +101,13 @@ func (suite *InitializeTestSuite) TestInitialize_DeclarativeMode_EntityLoadError
100101 mockEntity := entitymock .NewEntityServiceInterfaceMock (suite .T ())
101102 mockInbound := inboundclientmock .NewInboundClientServiceInterfaceMock (suite .T ())
102103 mockOU := oumock .NewOrganizationUnitServiceInterfaceMock (suite .T ())
104+ mockRole := rolemock .NewRoleServiceInterfaceMock (suite .T ())
103105
104106 mockEntity .On ("LoadDeclarativeResources" , mock .Anything ).
105107 Return (errors .New ("entity load error" )).Once ()
106108
107109 mux := http .NewServeMux ()
108- svc , exporter , err := Initialize (mux , mockEntity , mockInbound , mockOU )
110+ svc , exporter , err := Initialize (mux , mockEntity , mockInbound , mockOU , mockRole )
109111
110112 suite .Error (err )
111113 suite .Equal ("entity load error" , err .Error ())
@@ -125,13 +127,14 @@ func (suite *InitializeTestSuite) TestInitialize_InboundLoadError_AllDeclarative
125127 mockEntity := entitymock .NewEntityServiceInterfaceMock (suite .T ())
126128 mockInbound := inboundclientmock .NewInboundClientServiceInterfaceMock (suite .T ())
127129 mockOU := oumock .NewOrganizationUnitServiceInterfaceMock (suite .T ())
130+ mockRole := rolemock .NewRoleServiceInterfaceMock (suite .T ())
128131
129132 mockEntity .On ("LoadDeclarativeResources" , mock .Anything ).Return (nil ).Once ()
130133 mockInbound .On ("LoadDeclarativeResources" , mock .Anything , mock .Anything ).
131134 Return (errors .New ("inbound load error" )).Once ()
132135
133136 mux := http .NewServeMux ()
134- svc , exporter , err := Initialize (mux , mockEntity , mockInbound , mockOU )
137+ svc , exporter , err := Initialize (mux , mockEntity , mockInbound , mockOU , mockRole )
135138
136139 suite .Error (err )
137140 suite .Equal ("inbound load error" , err .Error ())
@@ -149,12 +152,13 @@ func (suite *InitializeTestSuite) TestInitialize_DeclarativeMode_Success() {
149152 mockEntity := entitymock .NewEntityServiceInterfaceMock (suite .T ())
150153 mockInbound := inboundclientmock .NewInboundClientServiceInterfaceMock (suite .T ())
151154 mockOU := oumock .NewOrganizationUnitServiceInterfaceMock (suite .T ())
155+ mockRole := rolemock .NewRoleServiceInterfaceMock (suite .T ())
152156
153157 mockEntity .On ("LoadDeclarativeResources" , mock .Anything ).Return (nil ).Once ()
154158 mockInbound .On ("LoadDeclarativeResources" , mock .Anything , mock .Anything ).Return (nil ).Once ()
155159
156160 mux := http .NewServeMux ()
157- svc , exporter , err := Initialize (mux , mockEntity , mockInbound , mockOU )
161+ svc , exporter , err := Initialize (mux , mockEntity , mockInbound , mockOU , mockRole )
158162
159163 suite .NoError (err )
160164 suite .NotNil (svc )
@@ -169,12 +173,13 @@ func (suite *InitializeTestSuite) TestInitialize_CompositeMode_EntityLoadError()
169173 mockEntity := entitymock .NewEntityServiceInterfaceMock (suite .T ())
170174 mockInbound := inboundclientmock .NewInboundClientServiceInterfaceMock (suite .T ())
171175 mockOU := oumock .NewOrganizationUnitServiceInterfaceMock (suite .T ())
176+ mockRole := rolemock .NewRoleServiceInterfaceMock (suite .T ())
172177
173178 mockEntity .On ("LoadDeclarativeResources" , mock .Anything ).
174179 Return (errors .New ("entity composite load error" )).Once ()
175180
176181 mux := http .NewServeMux ()
177- svc , exporter , err := Initialize (mux , mockEntity , mockInbound , mockOU )
182+ svc , exporter , err := Initialize (mux , mockEntity , mockInbound , mockOU , mockRole )
178183
179184 suite .Error (err )
180185 suite .Equal ("entity composite load error" , err .Error ())
@@ -189,9 +194,10 @@ func (suite *InitializeTestSuite) TestInitialize_MutableMode_SkipsDeclarativeLoa
189194 mockEntity := entitymock .NewEntityServiceInterfaceMock (suite .T ())
190195 mockInbound := inboundclientmock .NewInboundClientServiceInterfaceMock (suite .T ())
191196 mockOU := oumock .NewOrganizationUnitServiceInterfaceMock (suite .T ())
197+ mockRole := rolemock .NewRoleServiceInterfaceMock (suite .T ())
192198
193199 mux := http .NewServeMux ()
194- svc , exporter , err := Initialize (mux , mockEntity , mockInbound , mockOU )
200+ svc , exporter , err := Initialize (mux , mockEntity , mockInbound , mockOU , mockRole )
195201
196202 suite .NoError (err )
197203 suite .NotNil (svc )
0 commit comments