ruthst00 commented on code in PR #6731:
URL: https://github.com/apache/jmeter/pull/6731#discussion_r4069444636


##########
src/protocol/http/src/test/java/org/apache/jmeter/protocol/http/control/TestCacheManagerThreadIteration.java:
##########
@@ -397,4 +397,19 @@ public void 
testCacheManagerWhenThreadIterationIsSameUser() throws Exception {
         assertTrue(this.cacheManager.inCache(url, headers), "After iteration, 
should find valid entry");
     }
 
+    @Test
+    public void testClearCacheReusesThreadLocalInstance() throws Exception {

Review Comment:
   #### `testClearCacheReusesThreadLocalInstance` tests implementation detail, 
not behavior
   
   Testing that the same `InheritableThreadLocal` instance is reused is a 
white-box test of an internal implementation detail. If the implementation 
changes in the future (e.g., to use a different mechanism), this test will 
break even if the behavior is correct. Tests should assert observable behavior 
(cache is empty after clear) rather than internal structure.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to