Newer
Older
newfiber_standard_algae / newfiber-system / newfiber-system-package / src / test / java / ServiceTest.java
@xiongkai xiongkai on 17 Jun 1 KB 初始化
import com.newfiber.common.core.utils.file.FileUtils;
import com.newfiber.system.NewfiberSystemApplication;
import com.newfiber.system.config.MinioConfig;
import com.newfiber.system.service.ISysFileUploadService;
import java.io.File;
import javax.annotation.Resource;
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;

/**
 * @author : X.K
 * @since : 2023/10/13 上午9:29
 */
//@Slf4j
@SpringBootTest(classes = NewfiberSystemApplication.class)
@RunWith(SpringRunner.class)
public class ServiceTest {

	@Resource
	private ISysFileUploadService sysFileUploadService;
	@Autowired
	private MinioConfig minioConfig;

	@Test
	public void fileTest() throws Exception{
		String url = sysFileUploadService.uploadFile(FileUtils.getMultipartFile(new File("C:\\Users\\Administrator\\Downloads\\step70_20240325135851A071.png")));
		System.out.println(1);
	}
}