|
|
@@ -0,0 +1,48 @@
|
|
|
+package top.lvzhiqiang;
|
|
|
+
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.junit.Test;
|
|
|
+import org.junit.runner.RunWith;
|
|
|
+import org.springframework.boot.test.context.SpringBootTest;
|
|
|
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
|
+import top.lvzhiqiang.entity.VideoInfoPool;
|
|
|
+import top.lvzhiqiang.mapper.VideoInfoPoolMapper;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.nio.charset.StandardCharsets;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 单元测试类
|
|
|
+ *
|
|
|
+ * @author lvzhiqiang
|
|
|
+ * @since 11:19 2022/5/2
|
|
|
+ */
|
|
|
+@Slf4j
|
|
|
+@RunWith(SpringJUnit4ClassRunner.class)
|
|
|
+@SpringBootTest(properties = {
|
|
|
+ "spring.profiles.active=dev",
|
|
|
+ "logging.level.top.lvzhiqiang=DEBUG"
|
|
|
+}
|
|
|
+)
|
|
|
+public class Test6 {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private VideoInfoPoolMapper videoInfoPoolMapper;
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testGetBusinessDeptSummary() {
|
|
|
+ List<VideoInfoPool> videoInfoPoolList = videoInfoPoolMapper.findAll();
|
|
|
+ byte[] imgUrlDestBytes = new byte[251];
|
|
|
+ for (VideoInfoPool videoInfoPool : videoInfoPoolList) {
|
|
|
+ String imgUrl = videoInfoPool.getImgUrl();
|
|
|
+ byte[] imgUrlBytes = imgUrl.getBytes(StandardCharsets.UTF_8);
|
|
|
+ if (imgUrlBytes.length > 251) {
|
|
|
+ System.out.println(imgUrl);
|
|
|
+ System.arraycopy(imgUrlBytes, 0, imgUrlDestBytes, 0, 251);
|
|
|
+ System.out.println(new String(imgUrlDestBytes, StandardCharsets.UTF_8).replace("�", ""));
|
|
|
+ System.out.println("========================");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|