-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
505b80a
commit cd7ecc5
Showing
6 changed files
with
60 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,32 +192,34 @@ class RemoveMemberInfos { | |
@Test | ||
@DisplayName("사용자 정보가 제거된다.") | ||
void removeMemberInfo() { | ||
//given | ||
// given | ||
long performanceId = 1; | ||
String email = "[email protected]"; | ||
String email2 = "[email protected]"; | ||
waitingRoom.enter(email, performanceId); | ||
waitingRoom.enter(email2, performanceId); | ||
|
||
//when | ||
// when | ||
waitingRoom.removeMemberInfo(Set.of(email, email2), performanceId); | ||
|
||
//then | ||
// then | ||
assertThat(waitingRoom.findWaitingMember(email, performanceId)).isEmpty(); | ||
assertThat(waitingRoom.findWaitingMember(email2, performanceId)).isEmpty(); | ||
} | ||
|
||
@Test | ||
@DisplayName("사용자 정보가 대기방에 존재하지 않으면 무시한다.") | ||
void ignore_WhenNotExistsWaitingRoom() { | ||
//given | ||
// given | ||
long performanceId = 1; | ||
String email = "[email protected]"; | ||
|
||
//when | ||
Exception exception = catchException(() -> waitingRoom.removeMemberInfo(Set.of(email), performanceId)); | ||
// when | ||
Exception exception = | ||
catchException( | ||
() -> waitingRoom.removeMemberInfo(Set.of(email), performanceId)); | ||
|
||
//then | ||
// then | ||
assertThat(exception).doesNotThrowAnyException(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,10 @@ | |
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.catchException; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember; | ||
import com.thirdparty.ticketing.global.waitingsystem.ObjectMapperUtils; | ||
import com.thirdparty.ticketing.support.TestContainerStarter; | ||
import java.time.ZonedDateTime; | ||
import java.util.Optional; | ||
import java.util.Set; | ||
|
||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Nested; | ||
|
@@ -19,6 +16,11 @@ | |
import org.springframework.data.redis.core.HashOperations; | ||
import org.springframework.data.redis.core.StringRedisTemplate; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.thirdparty.ticketing.domain.waitingsystem.waiting.WaitingMember; | ||
import com.thirdparty.ticketing.global.waitingsystem.ObjectMapperUtils; | ||
import com.thirdparty.ticketing.support.TestContainerStarter; | ||
|
||
@SpringBootTest | ||
class RedisWaitingRoomTest extends TestContainerStarter { | ||
|
||
|
@@ -215,32 +217,34 @@ class RemoveMemberInfos { | |
@Test | ||
@DisplayName("사용자 정보가 제거된다.") | ||
void removeMemberInfo() { | ||
//given | ||
// given | ||
long performanceId = 1; | ||
String email = "[email protected]"; | ||
String email2 = "[email protected]"; | ||
waitingRoom.enter(email, performanceId); | ||
waitingRoom.enter(email2, performanceId); | ||
|
||
//when | ||
// when | ||
waitingRoom.removeMemberInfo(Set.of(email, email2), performanceId); | ||
|
||
//then | ||
// then | ||
assertThat(waitingRoom.findWaitingMember(email, performanceId)).isEmpty(); | ||
assertThat(waitingRoom.findWaitingMember(email2, performanceId)).isEmpty(); | ||
} | ||
|
||
@Test | ||
@DisplayName("사용자 정보가 대기방에 존재하지 않으면 무시한다.") | ||
void ignore_WhenNotExistsWaitingRoom() { | ||
//given | ||
// given | ||
long performanceId = 1; | ||
String email = "[email protected]"; | ||
|
||
//when | ||
Exception exception = catchException(() -> waitingRoom.removeMemberInfo(Set.of(email), performanceId)); | ||
// when | ||
Exception exception = | ||
catchException( | ||
() -> waitingRoom.removeMemberInfo(Set.of(email), performanceId)); | ||
|
||
//then | ||
// then | ||
assertThat(exception).doesNotThrowAnyException(); | ||
} | ||
} | ||
|