@@ -58,4 +58,32 @@ void shouldKeepLegacySseEventQueueAlias() {
5858 config .setSseEventQueueCapacity (17 );
5959 assertEquals (17 , config .getStreamEventQueueCapacity ());
6060 }
61+
62+ @ Test
63+ void aliasesShareCanonicalState () {
64+ OpenCodeHttpClientConfig config = new OpenCodeHttpClientConfig ();
65+ config .setServerUrl ("http://legacy:4096" );
66+ assertEquals ("http://legacy:4096" , config .getBaseUrl ());
67+ config .setBaseUrl ("http://canonical:4096" );
68+ assertEquals ("http://canonical:4096" , config .getServerUrl ());
69+ config .setStreamEventQueueCapacity (23 );
70+ assertEquals (23 , config .getSseEventQueueCapacity ());
71+ config .setSseEventQueueCapacity (31 );
72+ assertEquals (31 , config .getStreamEventQueueCapacity ());
73+ }
74+
75+ @ Test
76+ void jsonBindsBothPropertyNamesAndRoundTrips () throws Exception {
77+ com .fasterxml .jackson .databind .ObjectMapper mapper = new com .fasterxml .jackson .databind .ObjectMapper ();
78+ for (String names : new String []{"serverUrl,sseEventQueueCapacity" , "baseUrl,streamEventQueueCapacity" }) {
79+ String [] properties = names .split ("," );
80+ String json = "{\" " + properties [0 ] + "\" :\" http://json:4096\" ,\" " + properties [1 ] + "\" :37}" ;
81+ OpenCodeHttpClientConfig config = mapper .readValue (json , OpenCodeHttpClientConfig .class );
82+ assertEquals ("http://json:4096" , config .getBaseUrl ());
83+ assertEquals (config .getBaseUrl (), config .getServerUrl ());
84+ assertEquals (37 , config .getStreamEventQueueCapacity ());
85+ assertEquals (37 , config .getSseEventQueueCapacity ());
86+ assertEquals (config , mapper .readValue (mapper .writeValueAsString (config ), OpenCodeHttpClientConfig .class ));
87+ }
88+ }
6189}
0 commit comments