methodName("getEmployeeDetailsById")
を型保証式に置き換えるにはどうすればよいですか?何とかクラスのメソッドに直接リンクします。それは可能ですか?春のjunitでメソッド呼び出しのtypsafeを確認するには?
@RunWith(SpringRunner.class)
@WebMvcTest
public class MyTest {
@Test
public void test() {
mockMvc
.perform(get("/employee/details/9816"))
.andExpect(handler().handlerType(EmployeeController.class))
.andExpect(handler().methodName("getEmployeeDetailsById")); //TODO typesafe?
}
あなたは@GetMappingアノテーションを持っているあなたのコントローラ内のメソッドを見つけることができます