@@ -325,7 +325,7 @@ void shouldUpdateCircuitBreakerConfig() {
325325 .willReturn (aResponse ()
326326 .withStatus (200 )
327327 .withHeader ("Content-Type" , "application/json" )
328- .withBody ("{\" success\" :true,\" data\" :{\" source \" :\" tenant_override \" ,\" error_threshold \" :10, \" violation_threshold \" :5, \" window_seconds \" :300, \" default_timeout_seconds \" :60, \" max_timeout_seconds \" :600, \" enable_auto_recovery \" :true, \" tenant_id \" : \" tenant_123 \" }}" )));
328+ .withBody ("{\" success\" :true,\" data\" :{\" tenant_id \" :\" tenant_123 \" ,\" message \" :\" Circuit breaker config updated for tenant \" }}" )));
329329
330330 CircuitBreakerConfigUpdate update = CircuitBreakerConfigUpdate .builder ()
331331 .tenantId ("tenant_123" )
@@ -337,13 +337,11 @@ void shouldUpdateCircuitBreakerConfig() {
337337 .enableAutoRecovery (true )
338338 .build ();
339339
340- CircuitBreakerConfig config = axonflow .updateCircuitBreakerConfig (update );
340+ CircuitBreakerConfigUpdateResponse result = axonflow .updateCircuitBreakerConfig (update );
341341
342- assertThat (config ).isNotNull ();
343- assertThat (config .getErrorThreshold ()).isEqualTo (10 );
344- assertThat (config .getViolationThreshold ()).isEqualTo (5 );
345- assertThat (config .isEnableAutoRecovery ()).isTrue ();
346- assertThat (config .getTenantId ()).isEqualTo ("tenant_123" );
342+ assertThat (result ).isNotNull ();
343+ assertThat (result .getTenantId ()).isEqualTo ("tenant_123" );
344+ assertThat (result .getMessage ()).isNotEmpty ();
347345
348346 verify (putRequestedFor (urlEqualTo ("/api/v1/circuit-breaker/config" ))
349347 .withRequestBody (matchingJsonPath ("$.tenant_id" , equalTo ("tenant_123" )))
@@ -358,18 +356,17 @@ void shouldUpdateCircuitBreakerConfigPartial() {
358356 .willReturn (aResponse ()
359357 .withStatus (200 )
360358 .withHeader ("Content-Type" , "application/json" )
361- .withBody ("{\" success\" :true,\" data\" :{\" source \" :\" tenant_override \" ,\" error_threshold \" :20, \" violation_threshold \" :3, \" window_seconds \" :60, \" default_timeout_seconds \" :30, \" max_timeout_seconds \" :300, \" enable_auto_recovery \" :false, \" tenant_id \" : \" tenant_456 \" }}" )));
359+ .withBody ("{\" success\" :true,\" data\" :{\" tenant_id \" :\" tenant_456 \" ,\" message \" :\" Circuit breaker config updated for tenant \" }}" )));
362360
363361 CircuitBreakerConfigUpdate update = CircuitBreakerConfigUpdate .builder ()
364362 .tenantId ("tenant_456" )
365363 .errorThreshold (20 )
366364 .build ();
367365
368- CircuitBreakerConfig config = axonflow .updateCircuitBreakerConfig (update );
366+ CircuitBreakerConfigUpdateResponse result = axonflow .updateCircuitBreakerConfig (update );
369367
370- assertThat (config ).isNotNull ();
371- assertThat (config .getErrorThreshold ()).isEqualTo (20 );
372- assertThat (config .getTenantId ()).isEqualTo ("tenant_456" );
368+ assertThat (result ).isNotNull ();
369+ assertThat (result .getTenantId ()).isEqualTo ("tenant_456" );
373370
374371 verify (putRequestedFor (urlEqualTo ("/api/v1/circuit-breaker/config" ))
375372 .withRequestBody (matchingJsonPath ("$.tenant_id" , equalTo ("tenant_456" )))
@@ -407,18 +404,18 @@ void updateCircuitBreakerConfigAsyncShouldReturnFuture() throws Exception {
407404 .willReturn (aResponse ()
408405 .withStatus (200 )
409406 .withHeader ("Content-Type" , "application/json" )
410- .withBody ("{\" success\" :true,\" data\" :{\" source \" :\" tenant_override \" ,\" error_threshold \" :10, \" violation_threshold \" :5, \" window_seconds \" :300, \" default_timeout_seconds \" :60, \" max_timeout_seconds \" :600, \" enable_auto_recovery \" :true, \" tenant_id \" : \" tenant_async \" }}" )));
407+ .withBody ("{\" success\" :true,\" data\" :{\" tenant_id \" :\" tenant_async \" ,\" message \" :\" Circuit breaker config updated for tenant \" }}" )));
411408
412409 CircuitBreakerConfigUpdate update = CircuitBreakerConfigUpdate .builder ()
413410 .tenantId ("tenant_async" )
414411 .errorThreshold (10 )
415412 .build ();
416413
417- CompletableFuture <CircuitBreakerConfig > future = axonflow .updateCircuitBreakerConfigAsync (update );
418- CircuitBreakerConfig config = future .get ();
414+ CompletableFuture <CircuitBreakerConfigUpdateResponse > future = axonflow .updateCircuitBreakerConfigAsync (update );
415+ CircuitBreakerConfigUpdateResponse result = future .get ();
419416
420- assertThat (config ).isNotNull ();
421- assertThat (config .getTenantId ()).isEqualTo ("tenant_async" );
417+ assertThat (result ).isNotNull ();
418+ assertThat (result .getTenantId ()).isEqualTo ("tenant_async" );
422419 }
423420
424421 @ Test
0 commit comments