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 ReadOssTestDataHandlerTest {

    @Mock
    private Context context;

    private ReadOssTestDataHandler handler;

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

    @Test
    public void testHandleRequest() {
        ReadOssTestDataRequest request = new ReadOssTestDataRequest("test/");

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

        assertNotNull(response);
        assertEquals(List.of("test/1.jpg", "test/2.jpg"), response.getOssFileList());
    }

}
