feat(harness): add run context and retry core

This commit is contained in:
zhuyongxin
2026-07-21 18:36:19 +08:00
parent 4274f3350b
commit 6b74990f86
47 changed files with 1910 additions and 1 deletions
@@ -0,0 +1,33 @@
package com.superbiz.agent.config;
import org.junit.jupiter.api.Test;
import org.yaml.snakeyaml.Yaml;
import java.io.InputStream;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
class SpringAiRetryConfigurationTest {
@Test
void disablesHiddenSpringAiRetries() {
try (InputStream input = getClass().getClassLoader().getResourceAsStream("application.yml")) {
assertNotNull(input);
Map<String, Object> root = new Yaml().load(input);
Map<String, Object> spring = map(root.get("spring"));
Map<String, Object> ai = map(spring.get("ai"));
Map<String, Object> retry = map(ai.get("retry"));
assertEquals(1, ((Number) retry.get("max-attempts")).intValue());
} catch (Exception e) {
throw new AssertionError("Failed to read application.yml", e);
}
}
@SuppressWarnings("unchecked")
private Map<String, Object> map(Object value) {
return (Map<String, Object>) value;
}
}