feat(harness): add run context and retry core
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user