@SpringBootTest @RunWith(SpringRunner.class) @AutoConfigureMockMvc @Transactional public class InterceptorTest { @Autowired private MockMvc mockMvc; @Before public void setUp() throws Exception { } @Test public void testServiceSecret() throws Exception { mockMvc.perform(get("/v1/status/xxx") .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)) .andDo(print()) .andExpect(status().is5xxServerError()); } }
mock mvc contrller test
猜你喜欢
转载自blog.csdn.net/wuzhong8809/article/details/106413071
今日推荐
周排行