diff --git a/sermant-plugins/sermant-router/router-transmit-plugin/src/test/java/io/sermant/router/transmit/wrapper/CallableWrapperTest.java b/sermant-plugins/sermant-router/router-transmit-plugin/src/test/java/io/sermant/router/transmit/wrapper/CallableWrapperTest.java index d003152215..0adda006b9 100644 --- a/sermant-plugins/sermant-router/router-transmit-plugin/src/test/java/io/sermant/router/transmit/wrapper/CallableWrapperTest.java +++ b/sermant-plugins/sermant-router/router-transmit-plugin/src/test/java/io/sermant/router/transmit/wrapper/CallableWrapperTest.java @@ -43,8 +43,10 @@ public void testCanTransmit() throws Exception { return obj; }, new RequestTag(null), new RequestData(null, null, null), false); - Assert.assertNull(ThreadLocalUtils.getRequestData()); - Assert.assertNull(ThreadLocalUtils.getRequestTag()); + Assert.assertTrue(ThreadLocalUtils.getRequestData() == null + || ThreadLocalUtils.getRequestData().getPath() == null); + Assert.assertTrue(ThreadLocalUtils.getRequestTag() == null + || ThreadLocalUtils.getRequestTag().getTag().isEmpty()); Assert.assertEquals(obj, wrapper.call()); diff --git a/sermant-plugins/sermant-router/router-transmit-plugin/src/test/java/io/sermant/router/transmit/wrapper/RunnableAndCallableWrapperTest.java b/sermant-plugins/sermant-router/router-transmit-plugin/src/test/java/io/sermant/router/transmit/wrapper/RunnableAndCallableWrapperTest.java index 20b6f38df5..7b2b9d0cf5 100644 --- a/sermant-plugins/sermant-router/router-transmit-plugin/src/test/java/io/sermant/router/transmit/wrapper/RunnableAndCallableWrapperTest.java +++ b/sermant-plugins/sermant-router/router-transmit-plugin/src/test/java/io/sermant/router/transmit/wrapper/RunnableAndCallableWrapperTest.java @@ -92,8 +92,10 @@ public void testCallCanTransmit() throws Exception { return obj; }, new RequestTag(null), new RequestData(null, null, null), false); - Assert.assertNull(ThreadLocalUtils.getRequestData()); - Assert.assertNull(ThreadLocalUtils.getRequestTag()); + Assert.assertTrue(ThreadLocalUtils.getRequestData() == null + || ThreadLocalUtils.getRequestData().getPath() == null); + Assert.assertTrue(ThreadLocalUtils.getRequestTag() == null + || ThreadLocalUtils.getRequestTag().getTag().isEmpty()); Assert.assertEquals(obj, wrapper.call()); diff --git a/sermant-plugins/sermant-router/router-transmit-plugin/src/test/java/io/sermant/router/transmit/wrapper/RunnableWrapperTest.java b/sermant-plugins/sermant-router/router-transmit-plugin/src/test/java/io/sermant/router/transmit/wrapper/RunnableWrapperTest.java index 6b3d64ca46..2463bf4c75 100644 --- a/sermant-plugins/sermant-router/router-transmit-plugin/src/test/java/io/sermant/router/transmit/wrapper/RunnableWrapperTest.java +++ b/sermant-plugins/sermant-router/router-transmit-plugin/src/test/java/io/sermant/router/transmit/wrapper/RunnableWrapperTest.java @@ -41,8 +41,10 @@ public void testCanTransmit() { || ThreadLocalUtils.getRequestTag().getTag().isEmpty()); }, new RequestTag(null), new RequestData(null, null, null), false); - Assert.assertNull(ThreadLocalUtils.getRequestData()); - Assert.assertNull(ThreadLocalUtils.getRequestTag()); + Assert.assertTrue(ThreadLocalUtils.getRequestData() == null + || ThreadLocalUtils.getRequestData().getPath() == null); + Assert.assertTrue(ThreadLocalUtils.getRequestTag() == null + || ThreadLocalUtils.getRequestTag().getTag().isEmpty()); wrapper.run();