3030import org .apache .servicecomb .metrics .core .publish .model .DefaultPublishModel ;
3131import org .apache .servicecomb .swagger .invocation .InvocationType ;
3232import org .apache .servicecomb .swagger .invocation .Response ;
33- import org .junit .jupiter .api .Assertions ;
3433import org .junit .jupiter .api .Test ;
3534import org .mockito .Mockito ;
3635import org .springframework .core .env .Environment ;
4140import io .micrometer .core .instrument .simple .SimpleMeterRegistry ;
4241import io .vertx .core .json .Json ;
4342
43+ import org .skyscreamer .jsonassert .JSONAssert ;
44+
4445public class TestInvocationPublishModelFactory {
4546 EventBus eventBus = new EventBus ();
4647
@@ -60,7 +61,7 @@ public class TestInvocationPublishModelFactory {
6061 Environment environment = Mockito .mock (Environment .class );
6162
6263 @ Test
63- public void createDefaultPublishModel () {
64+ public void createDefaultPublishModel () throws Exception {
6465 Mockito .when (environment .getProperty (METRICS_WINDOW_TIME , int .class , DEFAULT_METRICS_WINDOW_TIME ))
6566 .thenReturn (DEFAULT_METRICS_WINDOW_TIME );
6667 Mockito .when (environment .getProperty (
@@ -170,8 +171,8 @@ public void createDefaultPublishModel() {
170171 }
171172 }
172173 """ ;
173- Assertions .assertEquals (Json .encodePrettily (Json .decodeValue (expect , Object .class )),
174- Json .encodePrettily (model .getConsumer ()));
174+ JSONAssert .assertEquals (Json .encodePrettily (Json .decodeValue (expect , Object .class )),
175+ Json .encodePrettily (model .getConsumer ()), false );
175176
176177 expect = """
177178 {
@@ -269,8 +270,8 @@ public void createDefaultPublishModel() {
269270 }
270271 }
271272 """ ;
272- Assertions .assertEquals (Json .encodePrettily (Json .decodeValue (expect , Object .class )),
273- Json .encodePrettily (model .getProducer ()));
273+ JSONAssert .assertEquals (Json .encodePrettily (Json .decodeValue (expect , Object .class )),
274+ Json .encodePrettily (model .getProducer ()), false );
274275 }
275276
276277 protected void prepareInvocation () {
0 commit comments