11package io .github .easy4j .opencode ;
22
3- import com .fasterxml .jackson .databind .ObjectMapper ;
3+ import tools .jackson .databind .ObjectMapper ;
4+ import tools .jackson .databind .json .JsonMapper ;
45import io .github .easy4j .opencode .api .OpenCodeHttpClient ;
56import io .github .easy4j .opencode .api .OpenCodeSseClient ;
67import io .github .easy4j .opencode .cli .OpenCodeCli ;
@@ -42,7 +43,7 @@ void shouldCreateClientWithHttpConfigOnly() {
4243 OpenCodeHttpClientConfig httpConfig = new OpenCodeHttpClientConfig ();
4344 httpConfig .setBaseUrl (server .url ("/" ).toString ().replaceAll ("/$" , "" ));
4445 OpenCodeClientConfig config = new OpenCodeClientConfig ();
45- OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new ObjectMapper (), null );
46+ OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new JsonMapper (), null );
4647 OpenCodeClient client = new OpenCodeClient (config , httpClient , null , null );
4748
4849 assertTrue (client .isHttpEnabled ());
@@ -68,7 +69,7 @@ void shouldCreateClientWithBothSubsystems() {
6869 OpenCodeHttpClientConfig httpConfig = new OpenCodeHttpClientConfig ();
6970 httpConfig .setBaseUrl (server .url ("/" ).toString ().replaceAll ("/$" , "" ));
7071 OpenCodeClientConfig config = new OpenCodeClientConfig ();
71- OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new ObjectMapper (), null );
72+ OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new JsonMapper (), null );
7273 OpenCodeCliExecutor executor = new OpenCodeCliExecutor (config .getCli ());
7374 OpenCodeCli cli = new OpenCodeCli (executor );
7475 OpenCodeClient client = new OpenCodeClient (config , httpClient , null , cli );
@@ -128,7 +129,7 @@ void shouldDelegateHealthToHttpClient() {
128129 .setBody ("{\" healthy\" :true,\" version\" :\" 1.0.0\" }" ));
129130
130131 OpenCodeClientConfig config = new OpenCodeClientConfig ();
131- OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new ObjectMapper (), null );
132+ OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new JsonMapper (), null );
132133 OpenCodeClient client = new OpenCodeClient (config , httpClient , null , null );
133134
134135 var health = client .health ();
@@ -146,7 +147,7 @@ void shouldDelegateListSessions() {
146147 .setBody ("[{\" id\" :\" sess-1\" ,\" title\" :\" test\" }]" ));
147148
148149 OpenCodeClientConfig config = new OpenCodeClientConfig ();
149- OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new ObjectMapper (), null );
150+ OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new JsonMapper (), null );
150151 OpenCodeClient client = new OpenCodeClient (config , httpClient , null , null );
151152
152153 var sessions = client .listSessions ();
@@ -164,7 +165,7 @@ void shouldDelegateListAgents() {
164165 .setBody ("[{\" name\" :\" coder\" }]" ));
165166
166167 OpenCodeClientConfig config = new OpenCodeClientConfig ();
167- OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new ObjectMapper (), null );
168+ OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new JsonMapper (), null );
168169 OpenCodeClient client = new OpenCodeClient (config , httpClient , null , null );
169170
170171 var agents = client .listAgents ();
@@ -182,7 +183,7 @@ void shouldDelegateGetConfig() {
182183 .setBody ("{\" theme\" :\" dark\" }" ));
183184
184185 OpenCodeClientConfig config = new OpenCodeClientConfig ();
185- OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new ObjectMapper (), null );
186+ OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new JsonMapper (), null );
186187 OpenCodeClient client = new OpenCodeClient (config , httpClient , null , null );
187188
188189 var codeConfig = client .getOpenCodeConfig ();
@@ -200,7 +201,7 @@ void shouldDelegateAbort() {
200201 .setBody ("{}" ));
201202
202203 OpenCodeClientConfig config = new OpenCodeClientConfig ();
203- OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new ObjectMapper (), null );
204+ OpenCodeHttpClient httpClient = new OpenCodeHttpClient (httpConfig , new JsonMapper (), null );
204205 OpenCodeClient client = new OpenCodeClient (config , httpClient , null , null );
205206
206207 assertTrue (client .abort ("sess-1" ));
0 commit comments