전략편집기 수정, 보조지표 설정 수정

This commit is contained in:
Macbook
2026-05-27 23:59:30 +09:00
parent 8cc0d1c88c
commit 2713b2951d
17 changed files with 210 additions and 46 deletions
@@ -11,6 +11,44 @@ class StrategyDslTimeframeNormalizerTest {
private final ObjectMapper objectMapper = new ObjectMapper();
private final StrategyDslTimeframeNormalizer normalizer = new StrategyDslTimeframeNormalizer(objectMapper);
@Test
void normalize_preserves3mAnd5mWithout1m() throws Exception {
String json = """
{
"type": "TIMEFRAME",
"candleType": "1m",
"candleTypes": ["3m", "5m"],
"children": [{
"type": "CONDITION",
"condition": { "indicatorType": "RSI", "period": 14 }
}]
}
""";
String normalized = normalizer.normalizeJson(json, "테스트");
JsonNode root = objectMapper.readTree(normalized);
assertEquals(2, root.path("candleTypes").size());
assertEquals("3m", root.path("candleTypes").get(0).asText());
assertEquals("5m", root.path("candleTypes").get(1).asText());
assertEquals("3m", root.path("candleType").asText());
}
@Test
void normalize_preservesSingleExplicit3m() throws Exception {
String json = """
{
"type": "TIMEFRAME",
"candleType": "3m",
"children": [{
"type": "CONDITION",
"condition": { "indicatorType": "RSI", "period": 14 }
}]
}
""";
String normalized = normalizer.normalizeJson(json, "테스트");
JsonNode root = objectMapper.readTree(normalized);
assertEquals("3m", root.path("candleType").asText());
}
@Test
void normalize_preservesMultiCandleTypesOnSave() throws Exception {
String json = """