package com.njcn.gather.tool.parsepqdif.component;

import com.njcn.gather.tool.parsepqdif.pojo.vo.PqdifParseResponse;
import com.njcn.gather.tool.parsepqdif.pojo.vo.PqdifRecognizeResultVO;
import org.junit.jupiter.api.Test;

import java.util.ArrayList;

import static org.junit.jupiter.api.Assertions.assertEquals;

class PqdifSecondParseComponentTest {

    @Test
    void parseRecognizableDataFormatsStartTimeAsStandard24HourText() {
        PqdifParseResponse parseResponse = new PqdifParseResponse();
        parseResponse.setStatus("SUCCESS");
        parseResponse.setObservations(new ArrayList<PqdifParseResponse.ObservationVO>());

        PqdifParseResponse.ObservationVO observation = new PqdifParseResponse.ObservationVO();
        observation.setTimeStartText("2026-06-22T15:04:05.123");
        observation.setChannels(new ArrayList<PqdifParseResponse.ChannelInfoVO>());
        parseResponse.getObservations().add(observation);

        PqdifRecognizeResultVO result = new PqdifSecondParseComponent().parseRecognizableData(parseResponse);

        assertEquals("2026-06-22 15:04:05", result.getObservations().get(0).getStartTime());
    }
}
