This is an automated email from the ASF dual-hosted git repository.

Aias00 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new b315b33f23 fix(admin): preserve optional app auth fields (#7079)
b315b33f23 is described below

commit b315b33f2393fac3ace7c8466209f7725993d1c5
Author: Liming Deng <[email protected]>
AuthorDate: Wed Sep 30 09:52:48 2026 +0800

    fix(admin): preserve optional app auth fields (#7079)
    
    Co-authored-by: moremind <[email protected]>
---
 .../java/org/apache/shenyu/admin/service/impl/AppAuthServiceImpl.java  | 2 +-
 .../test/java/org/apache/shenyu/admin/service/AppAuthServiceTest.java  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/AppAuthServiceImpl.java
 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/AppAuthServiceImpl.java
index 6678d539ce..fab5705e94 100644
--- 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/AppAuthServiceImpl.java
+++ 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/AppAuthServiceImpl.java
@@ -181,7 +181,7 @@ public class AppAuthServiceImpl implements AppAuthService {
     @Transactional(rollbackFor = Exception.class)
     public ShenyuAdminResult updateDetail(final AppAuthDTO appAuthDTO) {
         AppAuthDO appAuthDO = AppAuthTransfer.INSTANCE.mapToEntity(appAuthDTO);
-        appAuthMapper.update(appAuthDO);
+        appAuthMapper.updateSelective(appAuthDO);
         List<AuthParamDTO> authParamDTOList = appAuthDTO.getAuthParamList();
         if (CollectionUtils.isNotEmpty(authParamDTOList)) {
             authParamMapper.deleteByAuthId(appAuthDTO.getId());
diff --git 
a/shenyu-admin/src/test/java/org/apache/shenyu/admin/service/AppAuthServiceTest.java
 
b/shenyu-admin/src/test/java/org/apache/shenyu/admin/service/AppAuthServiceTest.java
index 4db636a453..0d8f736d59 100644
--- 
a/shenyu-admin/src/test/java/org/apache/shenyu/admin/service/AppAuthServiceTest.java
+++ 
b/shenyu-admin/src/test/java/org/apache/shenyu/admin/service/AppAuthServiceTest.java
@@ -68,6 +68,7 @@ import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.BDDMockito.given;
 import static org.mockito.Mockito.doNothing;
+import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -115,6 +116,8 @@ public final class AppAuthServiceTest {
         appAuthDTO.setAuthParamList(authParamDTOList);
         ShenyuAdminResult successResult = 
this.appAuthService.updateDetail(appAuthDTO);
         assertEquals(CommonErrorCode.SUCCESSFUL, 
successResult.getCode().intValue());
+        verify(appAuthMapper).updateSelective(any(AppAuthDO.class));
+        verify(appAuthMapper, never()).update(any(AppAuthDO.class));
     }
 
     @Test

Reply via email to