实现对密保问题的设置和加密存储

This commit is contained in:
F嘉阳
2018-02-25 16:08:16 +08:00
parent 904daf9e2f
commit ccec7045ed
8 changed files with 263 additions and 20 deletions

View File

@@ -0,0 +1,36 @@
package com.fjy.spring.controller;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import javax.transaction.Transactional;
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
public class DataControllerTest {
@Autowired
private MockMvc mvc;
/**
* 使用此单元测试前要注销拦截器,否则测试不通过
* @throws Exception
*/
@Test
@Transactional
public void adduserque() throws Exception{
mvc.perform(MockMvcRequestBuilders.post("/home/adduserque")
.param("coluserid","53")
.param("question","您母亲的姓名是?")
.param("answer","YHM"))
.andExpect(MockMvcResultMatchers.content().string("true"));
}
}