HttpServletResponse mockedResponse = mockitoTestSuite.getMockedResponse();
NullPointerException nullPointerException = new NullPointerException();
+ private DelegatingServletInputStream dsi;
@Test
public void loginIfAuthNullTest() {
HttpServletResponse response = mock(HttpServletResponse.class);
HttpSession session = mock(HttpSession.class);
String json = "{\"loginId\":\"test\", \"password\":\"xyz\"}";
- when(request.getInputStream()).thenReturn(
- new DelegatingServletInputStream(new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8))));
+ dsi = new DelegatingServletInputStream(new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8)));
+ when(request.getInputStream()).thenReturn(dsi);
when(request.getReader()).thenReturn(new BufferedReader(new StringReader(json)));
when(request.getContentType()).thenReturn("application/json");
when(request.getCharacterEncoding()).thenReturn("UTF-8");