Skip to content

Commit

Permalink
修复测试问题
Browse files Browse the repository at this point in the history
  • Loading branch information
chengyouling committed Jan 2, 2025
1 parent 284bf61 commit 51c5450
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ public void testCanTransmit() throws Exception {

Assert.assertEquals(obj, wrapper.call());

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());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,17 @@ public void testRunCanTransmit() {
Assert.assertNotNull(ThreadLocalUtils.getRequestTag());
}, null, 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();

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());
}

@Test
Expand Down Expand Up @@ -85,8 +89,10 @@ public void testCallCanTransmit() throws Exception {

Assert.assertEquals(obj, wrapper.call());

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());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ public void testCanTransmit() {

wrapper.run();

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());
}

@Test
Expand Down

0 comments on commit 51c5450

Please sign in to comment.