2929import io .micrometer .core .instrument .observation .DefaultMeterObservationHandler ;
3030import io .micrometer .core .instrument .simple .SimpleMeterRegistry ;
3131import io .micrometer .observation .ObservationRegistry ;
32- import net .minidev .json .JSONArray ;
3332import org .assertj .core .api .InstanceOfAssertFactories ;
3433import org .junit .jupiter .api .Test ;
3534
@@ -128,10 +127,10 @@ void test() throws Exception {
128127 assertThat (nodes ).isNotNull ();
129128 assertThat (nodes .size ()).isEqualTo (35 );
130129
131- JSONArray jsonArray =
130+ List <?> jsonArray =
132131 JsonPathUtils .evaluate (baos .toByteArray (), "$..nodes[?(@.componentType == 'gateway')]" );
133132
134- assertThat (jsonArray . size ()). isEqualTo (3 );
133+ assertThat (jsonArray ). hasSize (3 );
135134
136135 Map <String , Object > gateway1 = (Map <String , Object >) jsonArray .get (0 );
137136
@@ -159,9 +158,6 @@ void test() throws Exception {
159158 this .testSource .receive ();
160159 this .expressionRouterInput .send (MessageBuilder .withPayload ("foo" ).setHeader ("foo" , "fizChannel" ).build ());
161160
162- jsonArray = JsonPathUtils .evaluate (baos .toByteArray (), "$..nodes[?(@.name == 'router.router')]" );
163- String routerJson = jsonArray .toJSONString ();
164-
165161 this .server .rebuild ();
166162 graph = this .server .getGraph ();
167163 baos = new ByteArrayOutputStream ();
@@ -181,13 +177,13 @@ void test() throws Exception {
181177 assertThat (links .size ()).isEqualTo (35 );
182178
183179 jsonArray = JsonPathUtils .evaluate (baos .toByteArray (), "$..nodes[?(@.name == 'router.router')]" );
184- routerJson = jsonArray .toJSONString ();
180+ String routerJson = jsonArray .toString ();
185181 assertThat (routerJson ).contains ("\" sendTimers\" :{\" successes\" :{\" count\" :4" );
186182 jsonArray = JsonPathUtils .evaluate (baos .toByteArray (), "$..nodes[?(@.name == 'toRouter')]" );
187- String toRouterJson = jsonArray .toJSONString ();
183+ String toRouterJson = jsonArray .toString ();
188184 assertThat (toRouterJson ).contains ("\" sendTimers\" :{\" successes\" :{\" count\" :4" );
189185 jsonArray = JsonPathUtils .evaluate (baos .toByteArray (), "$..nodes[?(@.name == 'testSource')]" );
190- String sourceJson = jsonArray .toJSONString ();
186+ String sourceJson = jsonArray .toString ();
191187 assertThat (sourceJson ).contains ("\" receiveCounters\" :{\" successes\" :1,\" failures\" :0" );
192188
193189 // stats refresh without rebuild()
@@ -196,29 +192,29 @@ void test() throws Exception {
196192 objectMapper .enable (SerializationFeature .INDENT_OUTPUT );
197193 objectMapper .writeValue (baos , graph );
198194 jsonArray = JsonPathUtils .evaluate (baos .toByteArray (), "$..nodes[?(@.name == 'testSource')]" );
199- sourceJson = jsonArray .toJSONString ();
195+ sourceJson = jsonArray .toString ();
200196 assertThat (sourceJson ).contains ("\" receiveCounters\" :{\" successes\" :2,\" failures\" :0" );
201197
202198 assertThatIllegalStateException ().isThrownBy (() -> this .testSource .receive ());
203199 baos = new ByteArrayOutputStream ();
204200 objectMapper .enable (SerializationFeature .INDENT_OUTPUT );
205201 objectMapper .writeValue (baos , graph );
206202 jsonArray = JsonPathUtils .evaluate (baos .toByteArray (), "$..nodes[?(@.name == 'testSource')]" );
207- sourceJson = jsonArray .toJSONString ();
203+ sourceJson = jsonArray .toString ();
208204 assertThat (sourceJson ).contains ("\" receiveCounters\" :{\" successes\" :2,\" failures\" :1" );
209205
210206 jsonArray =
211207 JsonPathUtils .evaluate (baos .toByteArray (), "$..nodes[?(@.name == 'expressionRouter.router')]" );
212208
213209 expressionRouter = (Map <String , Object >) jsonArray .get (0 );
214- JSONArray routes = (JSONArray ) expressionRouter .get ("routes" );
210+ List <?> routes = (List <?> ) expressionRouter .get ("routes" );
215211 assertThat (routes ).hasSize (1 );
216212 assertThat (routes .get (0 )).isEqualTo ("fizChannel" );
217213
218214 Object routerNodeId = expressionRouter .get ("nodeId" );
219215
220216 Object fizChannelNodeId =
221- ((JSONArray ) JsonPathUtils .evaluate (baos .toByteArray (),
217+ ((List <?> ) JsonPathUtils .evaluate (baos .toByteArray (),
222218 "$..nodes[?(@.name == 'fizChannel')].nodeId" )).get (0 );
223219
224220 jsonArray =
0 commit comments