Skip to content

Commit

Permalink
test: 테스트 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsu5582 committed Dec 7, 2024
1 parent b80504e commit 76d4182
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void updateAtReviewDeadline() {

@Test
@DisplayName("예약된 자동 업데이트를 삭제한다.")
void cancel() {
void cancel() throws InterruptedException {
Member manager = memberRepository.save(MemberFixture.MEMBER_ROOM_MANAGER_JOYSON());
LocalDateTime reviewDeadline = LocalDateTime.now()
.plusDays(2);
Expand All @@ -81,6 +81,7 @@ void cancel() {

automaticMatchingScheduler.cancel(room.getId());

Thread.sleep(10);
assertThat(scheduledFuture.isCancelled()).isTrue();

Check failure on line 85 in backend/src/test/java/corea/scheduler/service/AutomaticMatchingSchedulerTest.java

View workflow job for this annotation

GitHub Actions / JUnit Test Report

AutomaticMatchingSchedulerTest.예약된 자동 업데이트를 삭제한다.

org.opentest4j.AssertionFailedError: Expecting value to be true but was false
Raw output
org.opentest4j.AssertionFailedError: 
Expecting value to be true but was false
	at [email protected]/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at [email protected]/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at [email protected]/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at [email protected]/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
	at app//corea.scheduler.service.AutomaticMatchingSchedulerTest.cancel(AutomaticMatchingSchedulerTest.java:85)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
	at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
	at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
assertThat(scheduledTasks.containsKey(room.getId())).isFalse();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void updateAtReviewDeadline() {

@Test
@DisplayName("예약된 자동 업데이트를 삭제한다.")
void cancel() {
void cancel() throws InterruptedException {
Member manager = memberRepository.save(MemberFixture.MEMBER_ROOM_MANAGER_JOYSON());
LocalDateTime reviewDeadline = LocalDateTime.now()
.plusDays(2);
Expand All @@ -69,6 +69,8 @@ void cancel() {

automaticUpdateScheduler.cancel(room.getId());

Thread.sleep(10);

assertThat(scheduledFuture.isCancelled()).isTrue();
assertThat(scheduledTasks.containsKey(room.getId())).isFalse();
}
Expand Down

0 comments on commit 76d4182

Please sign in to comment.