Skip to content

Commit

Permalink
test: 세션 관련 테스트 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
greeng00se committed Sep 11, 2023
1 parent 351882a commit 5825bae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ void setUp() {
// given
final RequestLine requestLine = RequestLine.from("GET /login HTTP/1.1");
final String uuid = UUID.randomUUID().toString();
final HttpRequest httpRequest = new HttpRequest(requestLine, new Headers(), new RequestBody());
final Session session = new Session(uuid);
final HttpRequest httpRequest = new HttpRequest(requestLine, new Headers(), new RequestBody());
session.setAttribute("user", new User("gugu", "password", "[email protected]"));
httpRequest.setSession(session);
final HttpResponse httpResponse = new HttpResponse(HttpVersion.HTTP_1_1);
Expand Down Expand Up @@ -99,6 +99,9 @@ void setUp() {
final RequestLine requestLine = RequestLine.from("POST /login HTTP/1.1");
final RequestBody requestBody = RequestBody.from("account=hello&password=world");
final HttpRequest httpRequest = new HttpRequest(requestLine, new Headers(), requestBody);
final String uuid = UUID.randomUUID().toString();
final Session session = new Session(uuid);
httpRequest.setSession(session);
final HttpResponse httpResponse = new HttpResponse(HttpVersion.HTTP_1_1);
InMemoryUserRepository.save(new User("hello", "world", "[email protected]"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.util.Collections;
import org.apache.catalina.RequestAdapter;
import org.apache.catalina.RequestMapper;
import org.apache.catalina.controller.StaticController;
import org.junit.jupiter.api.DisplayNameGeneration;
import org.junit.jupiter.api.DisplayNameGenerator;
Expand All @@ -28,7 +30,7 @@ void index() throws IOException {
"");

final var socket = new StubSocket(httpRequest);
final RequestAdapter requestAdapter = new RequestAdapter(new StaticController());
final RequestAdapter requestAdapter = new RequestAdapter(new RequestMapper(Collections.emptyMap()));
final Http11Processor processor = new Http11Processor(socket, requestAdapter);

// when
Expand Down

0 comments on commit 5825bae

Please sign in to comment.