showuon commented on pull request #11800:
URL: https://github.com/apache/kafka/pull/11800#issuecomment-1050660740


   > In fact, in the testcases we discussed, `config.unused()` and 
`config.unknown()` will not change after `TestSecurityConfig config` is 
initialized. The following `config.valuesWithPrefixOverride(prefix)` and 
`valuesWithPrefixOverride.get(xxxx)` will not cause the return value of 
`unused()` and `unknown()` to change
   
   Thanks for the explanation. But I don't think it is correct. If we check the 
original test below in `testValuesWithPrefixOverride`
   ```java
          // prefix overrides global
           assertTrue(config.unused().contains("prefix.sasl.mechanism"));
           assertTrue(config.unused().contains("sasl.mechanism"));
           assertEquals("GSSAPI", 
valuesWithPrefixOverride.get("sasl.mechanism"));
           assertFalse(config.unused().contains("sasl.mechanism"));
           assertFalse(config.unused().contains("prefix.sasl.mechanism"));
   ```
   We can see the `unused` was expected to contain those 2 configs. Then after 
`valuesWithPrefixOverride.get("sasl.mechanism")`, they are used now, that is, 
not containing in `unused` set. 
   So, what I mean is that since we've changed the 1st assert into `unknown`:
   ```
   assertTrue(config.unknown().contains("prefix.sasl.mechanism"));
   ```
   Theh, we should change the last assert to assert unknown there:
   ```
   assertFalse(config.unknown().contains("prefix.sasl.mechanism"));
   ```
   Does that make sense?


-- 
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