Skip to content

Commit

Permalink
[#58] 각 테스트의 독립성을 위해 데이터베이스를 테스트 종료 후 초기화
Browse files Browse the repository at this point in the history
  • Loading branch information
JunRain2 committed Jun 7, 2024
1 parent f6b3b75 commit 3fdd9fb
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import static com.example.memetory.domain.member.MemberFixture.*;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
Expand Down Expand Up @@ -42,9 +44,12 @@ public void setUp() {
databaseCleanup.afterPropertiesSet();
}

databaseCleanup.execute();

member = memberRepository.save(MEMBER());
accessToken = jwtUtil.generateAccessToken(member.getEmail());
}

@AfterEach
public void afterEach() {
databaseCleanup.execute();
}
}

0 comments on commit 3fdd9fb

Please sign in to comment.