fix: 修复编译和启动错误

- application.yml: 合并重复的 management.health 节点,解决 DuplicateKeyException
- LocalAuthServiceTest.java: 补充 PlatformPrincipal/Set import 和类闭合括号

Signed-off-by: jangrui <admin@jangrui.com>
This commit is contained in:
jangrui 2026-05-15 02:24:48 +08:00
parent 9ff3baf756
commit d09d6172c1
2 changed files with 5 additions and 3 deletions

View file

@ -214,6 +214,8 @@ management:
health:
mail:
enabled: ${MANAGEMENT_HEALTH_MAIL_ENABLED:false}
ldap:
enabled: false
endpoints:
web:
exposure:
@ -221,9 +223,6 @@ management:
endpoint:
health:
show-details: when-authorized
health:
ldap:
enabled: false
metrics:
tags:
application: skillhub

View file

@ -11,6 +11,7 @@ import static org.mockito.Mockito.verify;
import com.iflytek.skillhub.auth.config.LdapProperties;
import com.iflytek.skillhub.auth.exception.AuthFlowException;
import com.iflytek.skillhub.auth.rbac.PlatformPrincipal;
import com.iflytek.skillhub.auth.entity.Role;
import com.iflytek.skillhub.auth.entity.UserRoleBinding;
import com.iflytek.skillhub.auth.ldap.LdapAuthService;
@ -24,6 +25,7 @@ import java.time.Instant;
import java.time.ZoneOffset;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@ -321,4 +323,5 @@ class LocalAuthServiceTest {
.isEqualTo(HttpStatus.UNAUTHORIZED);
verify(ldapAuthService, never()).login(any(), any());
}
}