@@ -70,14 +57,16 @@
-
-
+
+
-
+
diff --git a/web/src/test/java/SpringTest.java b/web/src/test/java/SpringTest.java
index e2c25e9..6feaa98 100644
--- a/web/src/test/java/SpringTest.java
+++ b/web/src/test/java/SpringTest.java
@@ -43,9 +43,9 @@ import java.util.List;
//让测试运行于Spring环境
@RunWith(SpringJUnit4ClassRunner.class)
@SpringJUnitWebConfig
-@ContextConfiguration(classes = {AppConfig.class,SpringConfig.class})
+@ContextConfiguration(classes = {AppConfig.class, SpringConfig.class})
public class SpringTest {
- private static Logger log = LogManager.getLogger();
+ private static Logger log = LogManager.getLogger();
private MockMvc mockMvc;
@@ -64,14 +64,20 @@ public class SpringTest {
private HibernateTemplate baseDao1;
@Before
- public void setup(){
+ public void setup() {
mockMvc = MockMvcBuilders.webAppContextSetup(wac).build();
}
@Test
public void test() throws Exception {
- ResultActions resultActions = this.mockMvc.perform(MockMvcRequestBuilders.get("/data/table").param("firstResult","0").param("maxResults","10"));
+ ResultActions resultActions = this.mockMvc.perform(MockMvcRequestBuilders.get("/data/table").param("firstResult", "0").param("maxResults", "10").param("typeIds","123").param("typeIds","456"));
+ resultActions.andDo(MockMvcResultHandlers.print()).andReturn();
+ }
+
+ @Test
+ public void test2() throws Exception {
+ ResultActions resultActions = this.mockMvc.perform(MockMvcRequestBuilders.get("/data/R").param("cid","9987062"));
resultActions.andDo(MockMvcResultHandlers.print()).andReturn();
}
diff --git a/web/src/test/java/Test.java b/web/src/test/java/Test.java
index d9caf23..fffe62e 100644
--- a/web/src/test/java/Test.java
+++ b/web/src/test/java/Test.java
@@ -1,3 +1,4 @@
+import db.model.bilibili.DataModel;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -5,6 +6,8 @@ public class Test {
private static Logger log = LogManager.getLogger();
public static void main(String[] args) {
-
+ DataModel dataModel=new DataModel();
+ dataModel.setTypeId(123);
+ log.info("哈哈"+dataModel);
}
}
diff --git a/web/src/test/java/db/model/TaskModel.java b/web/src/test/java/db/model/TaskModel.java
index 20e0822..1e5550c 100644
--- a/web/src/test/java/db/model/TaskModel.java
+++ b/web/src/test/java/db/model/TaskModel.java
@@ -1,7 +1,5 @@
package db.model;
-import db.AbstractModel;
-
import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;
@@ -52,8 +50,4 @@ public class TaskModel extends AbstractModel {
return getId();
}
- @Override
- public String tableNote() {
- return "测试表";
- }
}
diff --git a/web/src/test/java/web/controller/TestController.java b/web/src/test/java/web/controller/TestController.java
index 555ec73..fbed1ca 100644
--- a/web/src/test/java/web/controller/TestController.java
+++ b/web/src/test/java/web/controller/TestController.java
@@ -1,6 +1,6 @@
package web.controller;
-import db.DBAction;
+import db.form.DBAction;
import db.model.TaskModel;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -10,6 +10,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
public class TestController extends BiliController{
+
@Override
public boolean checkAction(DBAction action) {
return true;