private void givenRequestBody(String user, String pass) { expectedUser = user; expectedPass = pass; String body = String.format("user=%s&pass=%s", user, pass); Mockito.when(mockRequestContext.getRequestBody()) .thenReturn(new ByteArrayInputStream(body.getBytes(StandardCharsets.UTF_8))); }
private void givenUserLogIn() { Mockito.when(mockRequestContext.getPrincipal()).thenReturn("username"); }