일목균형표 수정

This commit is contained in:
Macbook
2026-05-27 23:36:48 +09:00
parent 9cee6387c3
commit 8cc0d1c88c
73 changed files with 2256 additions and 334 deletions
@@ -0,0 +1,35 @@
package com.goldenchart.service;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class StrategyDslTimeframeNormalizerTest {
private final ObjectMapper objectMapper = new ObjectMapper();
private final StrategyDslTimeframeNormalizer normalizer = new StrategyDslTimeframeNormalizer(objectMapper);
@Test
void normalize_preservesMultiCandleTypesOnSave() throws Exception {
String json = """
{
"type": "TIMEFRAME",
"candleType": "1m",
"candleTypes": ["1m", "3m", "5m"],
"children": [{
"type": "CONDITION",
"condition": { "indicatorType": "RSI", "period": 14 }
}]
}
""";
String normalized = normalizer.normalizeJson(json, "5분봉 테스트 전략");
JsonNode root = objectMapper.readTree(normalized);
assertTrue(root.path("candleTypes").isArray());
assertEquals(3, root.path("candleTypes").size());
assertEquals("1m", root.path("candleTypes").get(0).asText());
assertEquals("3m", root.path("candleTypes").get(1).asText());
assertEquals("5m", root.path("candleTypes").get(2).asText());
}
}