Skip to content

Commit

Permalink
test: target_id 반환이 없는곳에서 Capture하지 않는다
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb committed Feb 22, 2024
1 parent 74ce243 commit 8bd63a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
if (!isExcludedURI(request)) {
String token = request.getHeader("Authorization");
throwIfCannotValidToken(token);
System.out.println(">>> " + token);
Long targetId = targetIdGetPort.getTargetId(token.split(" ")[1]);
System.out.println(">>> " + targetId);
request.setAttribute("logined", targetId);
}
return true;
Expand Down
44 changes: 4 additions & 40 deletions support/e2e/v1_6.find_galery_preview.hurl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
POST http://nalab-server:8080/v1/oauth/default # Default provider를 통해서 로그인 진행
{
"nickname": "devxb",
"email": "hello@12345"
"nickname": "find_gallery",
"email": "hello@1234567"
}

HTTP 200
Expand Down Expand Up @@ -60,42 +60,6 @@ jsonpath "$.survey_id" exists

[Captures]
survey_id: jsonpath "$.survey_id"
target_id: jsonpath "$.target.id"

##########

GET http://nalab-server:8080/v1/surveys/{{ survey_id }} # 생성된 survey를 조회한다.

HTTP 200
[Asserts]
header "Content-type" == "application/json"

jsonpath "$.survey_id" exists

jsonpath "$.target.id" exists
jsonpath "$.target.nickname" == "devxb"

jsonpath "$.question_count" == 2
jsonpath "$.question.[0].question_id" exists
jsonpath "$.question.[0].type" == "choice"
jsonpath "$.question.[0].form_type" == "tendency"
jsonpath "$.question.[0].title" == "저는 UI, UI, GUI 중에 어떤 분야를 가장 잘하는 것 같나요?"
jsonpath "$.question.[0].order" == 1
jsonpath "$.question.[0].max_selectable_count" == 1
jsonpath "$.question.[0].choices.[0].choice_id" exists
jsonpath "$.question.[0].choices.[0].content" == "UI"
jsonpath "$.question.[0].choices.[0].order" == 1
jsonpath "$.question.[0].choices.[1].choice_id" exists
jsonpath "$.question.[0].choices.[1].content" == "UX"
jsonpath "$.question.[0].choices.[1].order" == 2
jsonpath "$.question.[0].choices.[2].choice_id" exists
jsonpath "$.question.[0].choices.[2].content" == "GUI"
jsonpath "$.question.[0].choices.[2].order" == 3
jsonpath "$.question.[1].question_id" exists
jsonpath "$.question.[1].type" == "short"
jsonpath "$.question.[1].form_type" == "strength"
jsonpath "$.question.[1].title" == "저는 UX, UI, GUI 중에 어떤 분야에 더 강점이 있나요?"
jsonpath "$.question.[1].order" == 2

##########

Expand Down Expand Up @@ -152,8 +116,8 @@ HTTP 200
[Asserts]
header "Content-type" == "application/json"

jsonpath "$.target.target_id" == {{ target_id }}
jsonpath "$.target.nickname" == "devxb"
jsonpath "$.target.target_id" exists
jsonpath "$.target.nickname" == "find_gallery"
jsonpath "$.target.position" == null
jsonpath "$.target.job" == "OTHER"
jsonpath "$.target.image_url" == "empty_image"
Expand Down

0 comments on commit 8bd63a1

Please sign in to comment.