package com.ycwl.basic.image.watermark.operator;

import com.ycwl.basic.image.watermark.entity.WatermarkInfo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.io.File;


@SpringBootTest
@RunWith(SpringRunner.class)
public class WatermarkOperatorTest {
    @Test
    public void testProcess() throws Exception {
        WatermarkInfo info = new WatermarkInfo();
        info.setOriginalFile(new File("e2d32de7-6e85-4e07-b42f-477347073539.jpg"));
        info.setQrcodeFile(new File("cxzh_t.jpg"));
        info.setScenicLine("川西竹海一日游！");
        info.setDatetimeLine("2XXX年XX月XX日 留念");
        info.setWatermarkedFile(new File("test2.png"));
        IOperator operator = new NormalWatermarkOperator();
        operator.process(info);
        info.setWatermarkedFile(new File("test1.png"));
        operator = new LeicaWatermarkOperator();
        operator.process(info);
    }

}