Skip to content

Commit

Permalink
fix(challenge): 잘못된 테스트 데이터 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
wwingyou committed Jan 28, 2025
1 parent 5ec6999 commit 2caab25
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
2 changes: 0 additions & 2 deletions src/main/java/com/goolbitg/api/security/LogoutFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ public class LogoutFilter extends OncePerRequestFilter {
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
String authorizationHeader = request.getHeader("Authorization");
log.info("Logout filter executed");

if (authorizationHeader != null && authorizationHeader.startsWith("Bearer ")) {
String token = authorizationHeader.substring(7);
Jwt jwt = jwtDecoder.decode(token);
String userId = jwt.getSubject();
if (!userTokenRepository.isLoggedIn(userId)) {
log.info("User logged out");
CommonException ex = AuthException.loggedOut();
response.setStatus(ex.getStatus().value());
response.setContentType("application/json");
Expand Down
24 changes: 12 additions & 12 deletions src/main/resources/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,18 @@ INSERT INTO challenges (

INSERT INTO challenge_records (
challenge_id, user_id, date, status, location
) VALUES ( 2, 'id0001', '2025-01-15', 'SUCCESS', 0 ),
( 2, 'id0001', '2025-01-16', 'SUCCESS', 1 ),
( 2, 'id0001', '2025-01-17', 'FAIL', 2 ),
( 2, 'id0001', '2025-01-21', 'SUCCESS', 0 ),
( 2, 'id0001', '2025-01-22', 'SUCCESS', 1 ),
( 2, 'id0001', '2025-01-23', 'WAIT', 2 ),
( 1, 'id0001', '2025-01-17', 'SUCCESS', 0 ),
( 1, 'id0001', '2025-01-18', 'SUCCESS', 1 ),
( 1, 'id0001', '2025-01-19', 'SUCCESS', 2 ),
( 2, 'id0003', '2025-01-22', 'SUCCESS', 0 ),
( 2, 'id0003', '2025-01-23', 'WAIT', 1 ),
( 2, 'id0003', '2025-01-24', 'WAIT', 2 );
) VALUES ( 2, 'id0001', '2025-01-15', 'SUCCESS', 1 ),
( 2, 'id0001', '2025-01-16', 'SUCCESS', 2 ),
( 2, 'id0001', '2025-01-17', 'FAIL', 3 ),
( 2, 'id0001', '2025-01-21', 'SUCCESS', 1 ),
( 2, 'id0001', '2025-01-22', 'SUCCESS', 2 ),
( 2, 'id0001', '2025-01-23', 'WAIT', 3 ),
( 1, 'id0001', '2025-01-17', 'SUCCESS', 1 ),
( 1, 'id0001', '2025-01-18', 'SUCCESS', 2 ),
( 1, 'id0001', '2025-01-19', 'SUCCESS', 3 ),
( 2, 'id0003', '2025-01-22', 'SUCCESS', 1 ),
( 2, 'id0003', '2025-01-23', 'WAIT', 2 ),
( 2, 'id0003', '2025-01-24', 'WAIT', 3 );

INSERT INTO challenge_stats (
challenge_id, user_id, continue_count, current_continue_count, total_count, enroll_count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ void get_challenge_tripple() throws Exception {
.andExpect(jsonPath("$.check1").value("SUCCESS"))
.andExpect(jsonPath("$.check2").value("WAIT"))
.andExpect(jsonPath("$.check3").value("WAIT"))
.andExpect(jsonPath("$.location").value(1));
.andExpect(jsonPath("$.location").value(2));
}

}

0 comments on commit 2caab25

Please sign in to comment.