Framework/JUnit | Mockito1 Mock HttpServletRequest 테스트 코드 작성시 Mock HttpServletRequest 를 생성하는 방법. srping-test MockHttpServletRequest request = new MockHttpServletRequest(); request.addHeader("x-real-ip","127.0.0.1"); Mockito HttpServletRequest mockedRequest = Mockito.mock(HttpServletRequest.class); JMock Mockery context = new Mockery(); HttpServletRequest mockedRequest = context.mock(HttpServletRequest.class); 참조 : https://stackoverflow.com/quest.. 2022. 9. 28. 이전 1 다음 반응형