Skip to content

Commit

Permalink
test: missionService 테스트 코드 Transactional 삭제 (#386)
Browse files Browse the repository at this point in the history
* test: missionService 테스트 코드 Transactional 삭제

* fix: 미사용 EntityManager 삭제

* fix: 브라우저에서 쿠키 접근 허용 여부
  • Loading branch information
char-yb authored Apr 26, 2024
1 parent 8b02ff9 commit e1a1f37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/depromeet/global/util/CookieUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public HttpHeaders deleteTokenCookies() {
.maxAge(0)
.secure(true)
.sameSite(sameSite)
.httpOnly(false)
.httpOnly(true)
.build();

ResponseCookie refreshTokenCookie =
Expand All @@ -68,7 +68,7 @@ public HttpHeaders deleteTokenCookies() {
.maxAge(0)
.secure(true)
.sameSite(sameSite)
.httpOnly(false)
.httpOnly(true)
.build();

HttpHeaders headers = new HttpHeaders();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.depromeet.domain.mission.dto.response.MissionUpdateResponse;
import com.depromeet.global.security.PrincipalDetails;
import com.depromeet.global.util.MemberUtil;
import jakarta.persistence.EntityManager;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.List;
Expand All @@ -35,7 +34,6 @@
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.transaction.annotation.Transactional;

@SpringBootTest
@ActiveProfiles("test")
Expand All @@ -45,7 +43,6 @@ class MissionServiceTest {
@Autowired private MissionRepository missionRepository;
@Autowired private MemberRepository memberRepository;
@Autowired private DatabaseCleaner databaseCleaner;
@Autowired private EntityManager entityManager;
@Autowired private MemberUtil memberUtil;

@BeforeEach
Expand Down Expand Up @@ -108,7 +105,6 @@ void setUp() {
}

@Test
@Transactional
void 미션_리스트를_조회한다() {
// given
LocalDateTime startedAt = LocalDateTime.now();
Expand All @@ -125,7 +121,7 @@ void setUp() {
LocalTime.of(21, 0)))
.forEach(
request ->
entityManager.persist(
missionRepository.save(
Mission.createMission(
request.name(),
request.content(),
Expand Down

0 comments on commit e1a1f37

Please sign in to comment.