package com.yaoyicloud.ai.pipeline.fc;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.util.List;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

import com.aliyun.fc.runtime.Context;

@RunWith(MockitoJUnitRunner.class)
public class PreProcessHandlerTest {

    @Mock
    private Context context;

    private PreProcessHandler handler;

    @Before
    public void setUp() {
        handler = new PreProcessHandler();
    }

    @Test
    public void testHandleRequest() {
        TaskContentMsgsWithFeature request = new TaskContentMsgsWithFeature(
            List.of(new TaskContentMsgs.Message("appId1", "taskId1", "userId1", List.of("ossFile1", "ossFile2"))),
            "indexField",
            List.of("base64_0", "base64_1"));

        TaskContentMsgs response = handler.handleRequest(request, context);

        assertNotNull(response);
        assertEquals(1, response.getItems().size());
    }

}
