Skip to content

Commit

Permalink
feat: 날라간 정보 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsu5582 committed Dec 7, 2024
1 parent f246d32 commit b80504e
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public record RoomInfoResponse(
@Schema(description = "매칭 실패 원인 메세지 제공", example = "참여 인원이 부족하여 매칭을 진행할 수 없습니다.")
String message
) {


public static RoomInfoResponse from(Room room) {
return new RoomInfoResponse(
room.getId(),
Expand Down
4 changes: 2 additions & 2 deletions backend/src/test/java/config/TestAsyncConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.core.task.SyncTaskExecutor;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.annotation.EnableAsync;

Expand All @@ -12,6 +12,6 @@ public class TestAsyncConfig {

@Bean
public TaskExecutor taskExecutor() {
return new SyncTaskExecutor();
return new SimpleAsyncTaskExecutor();
}
}
17 changes: 17 additions & 0 deletions backend/src/test/java/config/TestsyncConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package config;

import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.core.task.SyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
import org.springframework.scheduling.annotation.EnableAsync;

@TestConfiguration
@EnableAsync
public class TestsyncConfig {

@Bean
public TaskExecutor taskExecutor() {
return new SyncTaskExecutor();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void manager() {
}

@Test
@Disabled
@DisplayName("방을 만들면 모집 마감 기간에 자동으로 매칭을 실행하도록 저장한다.")
void createAutomaticMatching() {
RefactorRoomResponse createdRoom = getCreatedRoomResponse(managerAccessToken);
Expand All @@ -92,6 +93,7 @@ void createAutomaticMatching() {
}

@Test
@Disabled
@DisplayName("방을 만들면 리뷰 마감 기간에 자동으로 방이 종료되도록 저장한다.")
void createAutomaticUpdate() {
RefactorRoomResponse createdRoom = getCreatedRoomResponse(managerAccessToken);
Expand Down Expand Up @@ -155,6 +157,7 @@ void invalidRoomStatus() {
}

@Test
@Disabled
@DisplayName("방을 수정하면 변경된 모집 마감 기간에 자동으로 매칭을 실행하도록 수정한다.")
void updateAutomaticMatching() {
RoomResponse updatedRoom = getUpdatedRoomResponse(createdRoom.id());
Expand All @@ -165,6 +168,7 @@ void updateAutomaticMatching() {
}

@Test
@Disabled
@DisplayName("방을 수정하면 변경된 리뷰 마감 기간에 자동으로 방이 종료되도록 수정한다.")
void updateAutomaticUpdate() {
RoomResponse updatedRoom = getUpdatedRoomResponse(createdRoom.id());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import config.ServiceTest;
import config.TestAsyncConfig;
import config.TestsyncConfig;
import corea.fixture.MemberFixture;
import corea.fixture.RoomFixture;
import corea.matching.domain.PullRequestInfo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import config.ServiceTest;
import config.TestAsyncConfig;
import config.TestsyncConfig;
import corea.fixture.MemberFixture;
import corea.fixture.RoomFixture;
import corea.matchresult.domain.MatchResult;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package corea.scheduler.service;

import config.ServiceTest;
import config.TestAsyncConfig;
import config.TestsyncConfig;
import corea.alarm.domain.AlarmActionType;
import corea.alarm.domain.ServerToUserAlarm;
import corea.alarm.repository.ServerToUserAlarmRepository;
Expand Down Expand Up @@ -42,7 +42,7 @@
import static org.mockito.Mockito.when;

@ServiceTest
@Import(TestAsyncConfig.class)
@Import(TestsyncConfig.class)
class MatchingExecutorTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package corea.scheduler.service;

import config.ServiceTest;
import config.TestAsyncConfig;
import config.TestsyncConfig;
import corea.fixture.MemberFixture;
import corea.fixture.RoomFixture;
import corea.member.domain.Member;
Expand All @@ -22,7 +22,7 @@
import static org.assertj.core.api.Assertions.assertThat;

@ServiceTest
@Import(TestAsyncConfig.class)
@Import(TestsyncConfig.class)
class UpdateExecutorTest {

@Autowired
Expand Down

0 comments on commit b80504e

Please sign in to comment.