错误异常:java.lang.Exception: Method executeTests should have no parameters

test的方法不能带参数


    @Test
   public void executeTests(String urlname) throws Exception {

      ResultActions result = mockMvc.perform(MockMvcRequestBuilders.get(urlname))
            .andExpect(MockMvcResultMatchers.status().isOk())
            .andDo(MockMvcResultHandlers.print());
      String contentAsString = result.andReturn().getResponse().getContentAsString();

      JResult jResult = JSONObject.parseObject(contentAsString, JResult.class);
      Assert.assertEquals("0",jResult.getCode());

   }
}

}

你可能感兴趣的:(单元测试)