test(app): 测试获取 API密钥功能

- 注释掉 AppEntityServiceImpl 中的 Cacheable 注解
- 在 DifyBackendApplicationTests 中添加测试方法,验证 getApikey 功能
This commit is contained in:
zhuangtianxiang 2025-05-16 18:25:06 +08:00
parent 441816dc54
commit ac6b1cb4ba
2 changed files with 8 additions and 1 deletions

View File

@ -85,7 +85,7 @@ public class AppEntityServiceImpl extends ServiceImpl<AppEntityRepository, AppEn
* @return
*/
@Override
@Cacheable(cacheNames="dify:flow:apikey",key="#appId")
// @Cacheable(cacheNames="dify:flow:apikey",key="#appId")
public String getApikey(String appId){
return appEntityRepository.selectApiKey(appId);
}

View File

@ -15,8 +15,15 @@ class DifyBackendApplicationTests {
private UserRepository userRepository;
@Resource
private BulletinRepository bulletinRepository;
@Resource
private AppEntityService appEntityService;
@Test
void contextLoads() {
// bulletinRepository.selectAll();
}
@Test
void test() {
System.out.println(appEntityService.getApikey("7371ae1b-fa59-4fa2-82e7-f689b183d0cf"));
}
}