package com.purui.prims;

import com.purui.prims.headless.server.pojo.MetricLineage;
import com.purui.prims.headless.server.schedule.MetricLineageTask;
import com.purui.prims.headless.server.service.MetricLineageService;
import org.junit.Assert;
import org.junit.jupiter.api.Test;

import static com.purui.prims.common.util.ContextUtils.getBean;

/**
 * 类说明
 *
 * @author charlie
 * @date 2024/7/29
 */
public class LineageTest extends BaseTest {

    @Test
    void saveTest() {
        MetricLineageTask metricLineageTask = getBean(MetricLineageTask.class);
        metricLineageTask.executeTask();
    }

    @Test
    void queryTest() {
        MetricLineageService metricLineageService = getBean(MetricLineageService.class);
        MetricLineage metricLineage = metricLineageService.getLineages(39L);

        Assert.assertNotNull(metricLineage);
        Assert.assertTrue(metricLineage.getChildren().size()>0);
    }
}
