liaochengjie opened a new pull request, #7741:
URL: https://github.com/apache/shenyu/pull/7741

   Fixes #7703.
   
   Administrator requests to `/namespace/list?name=payments` currently return 
every namespace because the administrator branch ignores `name`. Reuse 
`NamespaceMapper.selectByQuery` so administrators receive the same partial-name 
matching behavior as regular users. Null and empty names still return all 
namespaces available to the current user.
   
   Add regression tests using the real namespace MyBatis mapper and an H2 
database. The tests cover administrator partial matches, unmatched names, 
null/empty names, and regular-user authorization boundaries, including users 
with no assigned namespaces.
   
   ## Validation
   
   The new tests reproduce two failures against the original implementation. 
After the fix, all 8 new test cases and the 3 existing 
`NamespaceServiceImplTest` cases pass.
   
   Validated with Java 17 and the repository Maven Wrapper:
   
   ```shell
   ./mvnw -B -ntp -pl shenyu-admin -am clean verify 
-Dtest=NamespaceListTest,NamespaceServiceImplTest 
-Dsurefire.failIfNoSpecifiedTests=false -Dmaven.javadoc.skip=true 
-Djacoco.skip=true
   ```
   
   All 28 modules in this reactor build passed, including Checkstyle and Apache 
RAT. This command runs the two selected test classes; the full repository test 
suite and Docker-based tests were not run.
   
   Make sure that:
   
   - [x] You have read the [contribution 
guidelines](https://shenyu.apache.org/community/contributor-guide/).
   - [x] You submit test cases (unit or integration tests) that back your 
changes.
   - [ ] Your local test passed `./mvnw clean install 
-Dmaven.javadoc.skip=true`.
   
   The full-build checkbox is intentionally unchecked; the scoped validation 
above passed.
   


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