실시간 차트 보조지표 탭 문제 수정
This commit is contained in:
+34
@@ -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\""));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user