package com.moka.gdtauto.service;

import com.moka.gdtauto.GdtAutoApplication;
import com.moka.gdtauto.entity.AdPlan;
import com.moka.gdtauto.entity.AdPlanConf;

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.List;

/**
 * mvn test -Dtest=CreateAdGroupTest#createAdGroup -Dspring.profiles.active=test
 */
@SpringBootTest(classes = GdtAutoApplication.class)
@ActiveProfiles("test")
public class CreateAdGroupTest {
    
    @Autowired
    private AdPlanConfService adPlanConfService;
    @Autowired
    private AdPlanService adPlanService;
    
    @Test
    public void createAdGroup() {
        AdPlan  adPlan = adPlanService.getById(7580);
        Long adPlanConfId = adPlan.getAdPlanConfId();
        AdPlanConf adPlanConf = adPlanConfService.getById(adPlanConfId);
        adPlanConfService.asyncTencentInterface(adPlanConf, List.of(adPlan));
    }
}
