실시간 차트 보조지표 탭 문제 수정

This commit is contained in:
Macbook
2026-05-28 01:26:53 +09:00
parent 4f6694b206
commit 98dfb3613c
19 changed files with 801 additions and 182 deletions
@@ -0,0 +1,34 @@
package com.goldenchart.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class StrategyDslTimeframeNormalizerAlignTest {
private final StrategyDslTimeframeNormalizer normalizer =
new StrategyDslTimeframeNormalizer(new ObjectMapper());
@Test
void alignSell_copiesBuyCandleTypesToSell() throws Exception {
String buy = """
{
"type": "TIMEFRAME",
"candleType": "5m",
"candleTypes": ["5m"],
"children": [{ "type": "CONDITION", "condition": { "indicatorType": "RSI" } }]
}
""";
String sell = """
{
"type": "TIMEFRAME",
"candleType": "1m",
"children": [{ "type": "CONDITION", "condition": { "indicatorType": "RSI" } }]
}
""";
String aligned = normalizer.alignSellStartTimeframeToBuy(buy, sell);
assertTrue(aligned.contains("\"5m\""));
assertFalse(aligned.contains("\"candleType\":\"1m\""));
}
}