1
1
using System ;
2
- using System . ComponentModel ;
3
2
using System . IO ;
4
3
using System . Net ;
5
- using System . Threading ;
6
4
using System . Threading . Tasks ;
7
5
using DotNet . Testcontainers . Builders ;
8
6
using DotNet . Testcontainers . Configurations ;
9
7
using DotNet . Testcontainers . Images ;
10
8
using DotNet . Testcontainers . Networks ;
11
- using Grpc . Core ;
12
9
using Microsoft . Extensions . Logging ;
13
10
using NLog . Extensions . Logging ;
14
- using NUnit . Framework . Constraints ;
15
11
using Zeebe . Client ;
16
- using Zeebe . Client . Api . Builder ;
17
12
using Zeebe . Client . Impl . Builder ;
18
13
using IContainer = DotNet . Testcontainers . Containers . IContainer ;
19
14
@@ -179,25 +174,7 @@ private IContainer CreateIdentityContainer(INetwork network)
179
174
. WithEnvironment ( "IDENTITY_DATABASE_NAME" , "bitnami_keycloak" )
180
175
. WithEnvironment ( "IDENTITY_DATABASE_USERNAME" , "bn_keycloak" )
181
176
. WithEnvironment ( "IDENTITY_DATABASE_PASSWORD" , "#3]O?4RGj)DE7Z!9SA5" )
182
- . WithEnvironment ( "KEYCLOAK_INIT_OPERATE_SECRET" , "XALaRPl5qwTEItdwCMiPS62nVpKs7dL7" )
183
- . WithEnvironment ( "KEYCLOAK_INIT_OPERATE_ROOT_URL" , "http://localhost:1234/test" )
184
- . WithEnvironment ( "KEYCLOAK_INIT_TASKLIST_SECRET" , "XALaRPl5qwTEItdwCMiPS62nVpKs7dL7" )
185
- . WithEnvironment ( "KEYCLOAK_INIT_TASKLIST_ROOT_URL" , "http://localhost:1234/test" )
186
- . WithEnvironment ( "KEYCLOAK_INIT_OPTIMIZE_SECRET" , "XALaRPl5qwTEItdwCMiPS62nVpKs7dL7" )
187
- . WithEnvironment ( "KEYCLOAK_INIT_OPTIMIZE_ROOT_URL" , "http://localhost:1234/test" )
188
- . WithEnvironment ( "KEYCLOAK_INIT_WEBMODELER_ROOT_URL" , "http://localhost:1234/test" )
189
- . WithEnvironment ( "KEYCLOAK_INIT_CONNECTORS_SECRET" , "XALaRPl5qwTEItdwCMiPS62nVpKs7dL7" )
190
- . WithEnvironment ( "KEYCLOAK_INIT_CONNECTORS_ROOT_URL" , "http://localhost:1234/test" )
191
177
. WithEnvironment ( "KEYCLOAK_INIT_ZEEBE_NAME" , "zeebe" )
192
- . WithEnvironment ( "KEYCLOAK_USERS_0_USERNAME" , "demo" )
193
- . WithEnvironment ( "KEYCLOAK_USERS_0_PASSWORD" , "demo" )
194
- . WithEnvironment ( "KEYCLOAK_USERS_0_FIRST_NAME" , "demo" )
195
- . WithEnvironment ( "KEYCLOAK_USERS_0_EMAIL" , "demo@acme.com" )
196
- . WithEnvironment ( "KEYCLOAK_USERS_0_ROLES_0" , "Identity" )
197
- . WithEnvironment ( "KEYCLOAK_USERS_0_ROLES_1" , "Optimize" )
198
- . WithEnvironment ( "KEYCLOAK_USERS_0_ROLES_2" , "Operate" )
199
- . WithEnvironment ( "KEYCLOAK_USERS_0_ROLES_3" , "Tasklist" )
200
- . WithEnvironment ( "KEYCLOAK_USERS_0_ROLES_4" , "Web Modeler" )
201
178
. WithEnvironment ( "KEYCLOAK_CLIENTS_0_NAME" , "zeebe" )
202
179
. WithEnvironment ( "KEYCLOAK_CLIENTS_0_ID" , "zeebe" )
203
180
. WithEnvironment ( "KEYCLOAK_CLIENTS_0_SECRET" , "sddh123865WUS)(1%!" )
@@ -244,10 +221,6 @@ public IZeebeClient CreateZeebeClient()
244
221
. Build ( ) ;
245
222
}
246
223
247
- private static readonly string ServerCertPath =
248
- Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "Resources" , "server.crt" ) ;
249
-
250
-
251
224
public IZeebeClient CreateAuthenticatedZeebeClient ( )
252
225
{
253
226
var loggerFactory = LoggerFactory ;
@@ -265,7 +238,7 @@ public IZeebeClient CreateAuthenticatedZeebeClient()
265
238
266
239
private async Task AwaitBrokerReadiness ( )
267
240
{
268
- var zeebeClient = ( ZeebeClient ) client ;
241
+ var zeebeClient = withIdentity ? ( ZeebeClient ) CreateAuthenticatedZeebeClient ( ) : ( ZeebeClient ) client ;
269
242
await zeebeClient . Connect ( ) ;
270
243
var topologyErrorLogger = LoggerFactory . CreateLogger < ZeebeIntegrationTestHelper > ( ) ;
271
244
var ready = false ;
@@ -283,15 +256,8 @@ private async Task AwaitBrokerReadiness()
283
256
}
284
257
catch ( Exception e )
285
258
{
286
- if ( e is RpcException rpcException && rpcException . StatusCode == StatusCode . Unauthenticated )
287
- {
288
- ready = true ;
289
- }
290
- else
291
- {
292
- // retry
293
- topologyErrorLogger . LogError ( e , "Exception in sending topology" ) ;
294
- }
259
+ topologyErrorLogger . LogError ( e , "Exception in sending topology" ) ;
260
+ // retry
295
261
}
296
262
297
263
continueLoop = ! ready && maxCount > retries ++ ;
0 commit comments