11package io .a2a .integrations .microprofile ;
22
33import io .a2a .server .config .A2AConfigProvider ;
4+ import io .a2a .server .util .async .AsyncExecutorProducer ;
45import io .quarkus .test .junit .QuarkusTest ;
56import jakarta .inject .Inject ;
67import org .junit .jupiter .api .Test ;
1617@ QuarkusTest
1718public class MicroProfileConfigProviderTest {
1819
20+ private static final String A2A_EXECUTOR_CORE_POOL_SIZE = "a2a.executor.core-pool-size" ;
21+ private static final String A2A_EXECUTOR_MAX_POOL_SIZE = "a2a.executor.max-pool-size" ;
22+ private static final String A2A_EXECUTOR_KEEP_ALIVE_SECONDS = "a2a.executor.keep-alive-seconds" ;
23+
1924 @ Inject
2025 A2AConfigProvider configProvider ;
2126
@@ -31,37 +36,37 @@ public void testIsMicroProfileConfigProvider() {
3136 public void testGetValueFromMicroProfileConfig () {
3237 // Test that values from application.properties override defaults
3338 // The test application.properties sets a2a.executor.core-pool-size=15
34- String value = configProvider .getValue ("a2a.executor.core-pool-size" );
39+ String value = configProvider .getValue (A2A_EXECUTOR_CORE_POOL_SIZE );
3540 assertEquals ("15" , value , "Should get value from MicroProfile Config (application.properties)" );
3641 }
3742
3843 @ Test
3944 public void testGetValueFallbackToDefaults () {
4045 // Test that values not in application.properties fall back to META-INF/a2a-defaults.properties
4146 // a2a.executor.max-pool-size is not in test application.properties, so should use default
42- String value = configProvider .getValue ("a2a.executor.max-pool-size" );
47+ String value = configProvider .getValue (A2A_EXECUTOR_MAX_POOL_SIZE );
4348 assertEquals ("50" , value , "Should fall back to default value from META-INF/a2a-defaults.properties" );
4449 }
4550
4651 @ Test
4752 public void testGetValueAnotherDefault () {
4853 // Test another default property to ensure fallback works
49- String value = configProvider .getValue ("a2a.executor.keep-alive-seconds" );
54+ String value = configProvider .getValue (A2A_EXECUTOR_KEEP_ALIVE_SECONDS );
5055 assertEquals ("60" , value , "Should fall back to default value" );
5156 }
5257
5358 @ Test
5459 public void testGetOptionalValueFromMicroProfileConfig () {
5560 // Test optional value that exists in application.properties
56- Optional <String > value = configProvider .getOptionalValue ("a2a.executor.core-pool-size" );
61+ Optional <String > value = configProvider .getOptionalValue (A2A_EXECUTOR_CORE_POOL_SIZE );
5762 assertTrue (value .isPresent (), "Optional value should be present" );
5863 assertEquals ("15" , value .get (), "Should get overridden value from MicroProfile Config" );
5964 }
6065
6166 @ Test
6267 public void testGetOptionalValueFallbackToDefaults () {
6368 // Test optional value that falls back to defaults
64- Optional <String > value = configProvider .getOptionalValue ("a2a.executor.max-pool-size" );
69+ Optional <String > value = configProvider .getOptionalValue (A2A_EXECUTOR_MAX_POOL_SIZE );
6570 assertTrue (value .isPresent (), "Optional value should be present from defaults" );
6671 assertEquals ("50" , value .get (), "Should get default value" );
6772 }
0 commit comments