@@ -80,7 +80,7 @@ public async Task CreateHandler_DefaultsAreAppliedAndUserOverridesWin()
8080 } ,
8181 CreateWorker = ( _ , options ) =>
8282 {
83- capturedWorkerOptions = options ;
83+ capturedWorkerOptions = SimulateWorkerPluginConfiguration ( options ) ;
8484 return new FakeLambdaWorker ( _ => Task . CompletedTask ) ;
8585 } ,
8686 } ) ;
@@ -143,7 +143,7 @@ public async Task CreateHandler_DefaultsVersioningBehaviorToAutoUpgrade()
143143 ConnectClientAsync = _ => Task . FromResult < object > ( new object ( ) ) ,
144144 CreateWorker = ( _ , options ) =>
145145 {
146- capturedWorkerOptions = options ;
146+ capturedWorkerOptions = SimulateWorkerPluginConfiguration ( options ) ;
147147 return new FakeLambdaWorker ( _ => Task . CompletedTask ) ;
148148 } ,
149149 } ) ;
@@ -253,7 +253,7 @@ public async Task CreateHandler_ClearsConcurrencyDefaultsWhenTunerSet()
253253 ConnectClientAsync = _ => Task . FromResult < object > ( new object ( ) ) ,
254254 CreateWorker = ( _ , options ) =>
255255 {
256- capturedWorkerOptions = options ;
256+ capturedWorkerOptions = SimulateWorkerPluginConfiguration ( options ) ;
257257 return new FakeLambdaWorker ( _ => Task . CompletedTask ) ;
258258 } ,
259259 } ) ;
@@ -290,12 +290,7 @@ public async Task CreateHandler_ClearsConcurrencyDefaultsWhenPluginSetsTuner()
290290 ConnectClientAsync = _ => Task . FromResult < object > ( new object ( ) ) ,
291291 CreateWorker = ( _ , options ) =>
292292 {
293- foreach ( var plugin in options . Plugins ?? Array . Empty < ITemporalWorkerPlugin > ( ) )
294- {
295- plugin . ConfigureWorker ( options ) ;
296- }
297- options . ApplyPostPluginConfiguration ( ) ;
298- capturedWorkerOptions = options ;
293+ capturedWorkerOptions = SimulateWorkerPluginConfiguration ( options ) ;
299294 return new FakeLambdaWorker ( _ => Task . CompletedTask ) ;
300295 } ,
301296 } ) ;
@@ -327,12 +322,7 @@ public async Task CreateHandler_ReappliesDeploymentVersionAfterPlugins()
327322 ConnectClientAsync = _ => Task . FromResult < object > ( new object ( ) ) ,
328323 CreateWorker = ( _ , options ) =>
329324 {
330- foreach ( var plugin in options . Plugins ?? Array . Empty < ITemporalWorkerPlugin > ( ) )
331- {
332- plugin . ConfigureWorker ( options ) ;
333- }
334- options . ApplyPostPluginConfiguration ( ) ;
335- capturedWorkerOptions = options ;
325+ capturedWorkerOptions = SimulateWorkerPluginConfiguration ( options ) ;
336326 return new FakeLambdaWorker ( _ => Task . CompletedTask ) ;
337327 } ,
338328 } ) ;
@@ -991,6 +981,18 @@ private static ActivityDefinition DummyActivity() =>
991981 0 ,
992982 _ => Task . CompletedTask ) ;
993983
984+ private static TemporalWorkerOptions SimulateWorkerPluginConfiguration (
985+ TemporalWorkerOptions options )
986+ {
987+ var plugins = new List < ITemporalWorkerPlugin > (
988+ options . Plugins ?? Array . Empty < ITemporalWorkerPlugin > ( ) ) ;
989+ foreach ( var plugin in plugins )
990+ {
991+ plugin . ConfigureWorker ( options ) ;
992+ }
993+ return options ;
994+ }
995+
994996 [ Workflow ]
995997 public sealed class WorkflowWithoutVersioningBehavior
996998 {
0 commit comments