|
@@ -0,0 +1,33 @@
|
|
|
|
+package com.tzld.longarticle.recommend.server;
|
|
|
|
+
|
|
|
|
+import com.tzld.longarticle.recommend.server.model.Content;
|
|
|
|
+import com.tzld.longarticle.recommend.server.service.filter.FilterParam;
|
|
|
|
+import com.tzld.longarticle.recommend.server.service.filter.FilterStrategy;
|
|
|
|
+import org.junit.jupiter.api.Test;
|
|
|
|
+import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+@SpringBootTest(classes = Application.class)
|
|
|
|
+public class FilterStrategyTest {
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ FilterStrategy badStrategy;
|
|
|
|
+ @Test
|
|
|
|
+ public void badStrategyTest() {
|
|
|
|
+ FilterParam param = new FilterParam();
|
|
|
|
+ List<Content> contentList = new ArrayList<>();
|
|
|
|
+ Content content0 = new Content();
|
|
|
|
+ content0.setId("0");
|
|
|
|
+ content0.setTitle("中国第一位小品女皇,因一句台词识破潜伏间谍");
|
|
|
|
+ contentList.add(content0);
|
|
|
|
+ Content content1 = new Content();
|
|
|
|
+ content1.setId("1");
|
|
|
|
+ content1.setTitle("终身未娶拉扯张长大28年,女孩回报方式看哭众人");
|
|
|
|
+ contentList.add(content1);
|
|
|
|
+ param.setContents(contentList);
|
|
|
|
+ badStrategy.filter(param);
|
|
|
|
+ }
|
|
|
|
+}
|