Skip to content

Commit 75417d8

Browse files
authored
change single unit test to deterministic implementation (#4988)
1 parent 86632c9 commit 75417d8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

transports/transport-highway/src/test/java/org/apache/servicecomb/transport/highway/HighwayServerCodecFilterTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import org.junit.Before;
4646
import org.junit.Test;
4747
import org.mockito.Mockito;
48+
import org.skyscreamer.jsonassert.JSONAssert;
4849
import org.springframework.core.env.Environment;
4950

5051
import io.vertx.core.MultiMap;
@@ -146,9 +147,10 @@ public void should_convert_exception_to_response_when_decode_request_failed()
146147
Response response = codecFilter.onFilter(invocation, nextNode).get();
147148

148149
assertThat(response.getStatus()).isEqualTo(INTERNAL_SERVER_ERROR);
149-
assertThat(Json.encode(((InvocationException) response.getResult()).getErrorData()))
150-
.isEqualTo("{\"code\":\"SCB.50000000\",\"message\":\"Unexpected "
151-
+ "exception when processing null. encode request failed\"}");
150+
151+
JSONAssert.assertEquals(Json.encode(((InvocationException) response.getResult()).getErrorData()),
152+
"{\"code\":\"SCB.50000000\",\"message\":\"Unexpected "
153+
+ "exception when processing null. encode request failed\"}", false);
152154
}
153155

154156
private void success_invocation() throws InterruptedException, ExecutionException {

0 commit comments

Comments
 (0)