package com.rj.qiwei;

import com.rj.service.IQweiDepartmentService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

import java.util.Map;

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

@SpringBootTest
@ActiveProfiles("test")
public class QweiDepartmentSyncIntegrationTest {

    @Autowired
    private IQweiDepartmentService qweiDepartmentService;

    @Test
    void syncDepartmentsToDb() {
        Map<String, Object> result = qweiDepartmentService.syncFromQiWei();
        Object success = result.get("success");
        assertTrue(Boolean.TRUE.equals(success), "同步失败: " + result);
        System.out.println("qwei department sync result: " + result);
    }
}

