package com.cusc.nirvana.user.rnr;

import com.cusc.nirvana.user.rnr.fp.LocalRnrFpApplication;
import com.cusc.nirvana.user.rnr.fp.common.util.ChinaMobileSftpUtil;
import com.cusc.nirvana.user.rnr.fp.common.util.SnowflakeUtil;
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 javax.annotation.Resource;

/**
 * @author zx
 * @date 2022/6/9
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = LocalRnrFpApplication.class)
public class T1Test {

	@Resource
	private ChinaMobileSftpUtil sftpUtil;

	@Autowired
	SnowflakeUtil snowflakeConfig;

	@Test
	public void ftpInfo() throws Exception{
		System.out.println(sftpUtil);
		final String s = sftpUtil.uploadFile("/Users/xia/Downloads/xxx.png", "/apps/tmp/t12");
		System.out.println(s);
	}

	@Test
	public void testSnowFlake() throws Exception{
		for (int i = 0; i < 1000; i++) {
			System.out.println(snowflakeConfig.snowflakeId());
			System.out.println("->:"+snowflakeConfig.snowflakeIdStr());
		}
	}
}
