package com.izouma.nineth.repo;

import com.izouma.nineth.ApplicationTests;
import com.izouma.nineth.service.AssetService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

import static org.junit.Assert.*;

public class CollectionRepoTest extends ApplicationTests {
    @Autowired
    private CollectionRepo collectionRepo;
    @Autowired
    private AssetService   assetService;
    @Autowired
    private TagRepo        tagRepo;

    @Test
    public void updateCDN() {
        List<List<String>> list = collectionRepo.selectResource(83346L);
        for (int i = 0; i < list.get(0).size(); i++) {
            list.get(0).set(i, assetService.replaceCDN(list.get(0).get(i)));
        }
        collectionRepo.updateCDN(Long.parseLong(list.get(0).get(0)),
                list.get(0).get(1),
                list.get(0).get(2),
                list.get(0).get(3),
                list.get(0).get(4),
                list.get(0).get(5));
    }

    @Test
    public void testTag() {

    }
}