Skip to content

Commit

Permalink
test: 테스트 어노테이션 및 의존성 주입 방식 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoding-play committed Jul 15, 2024
1 parent 3e4160a commit 3eef529
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions backend/src/test/java/corea/member/domain/MatchingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class MatchingTest {

@Test
@DisplayName("멤버 리스트를 받아서 매칭 결과를 반환한다.")
void matchGroup(){
void matchGroup() {
List<Member> members = List.of(
new Member(1L, "[email protected]"),
new Member(2L, "[email protected]"),
new Member(3L, "[email protected]"),
new Member(4L, "[email protected]")
);
);
int matchingSize = 2;

Map<Long, List<Long>> results = matching.matchGroup(members, matchingSize);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
package corea.member.service;

import config.ServiceTest;
import corea.domain.Member;
import corea.member.repository.MatchedGroupRepository;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;

@SpringBootTest
@ServiceTest
class MatchingServiceTest {

private final MatchingService matchingService;
private final MatchedGroupRepository matchedGroupRepository;
@Autowired
MatchingService matchingService;

@Autowired
public MatchingServiceTest(MatchingService matchingService, MatchedGroupRepository matchedGroupRepository) {
this.matchingService = matchingService;
this.matchedGroupRepository = matchedGroupRepository;
}
MatchedGroupRepository matchedGroupRepository;

@Test
@DisplayName("멤버 리스트를 받아 매칭 결과를 반환한다.")
Expand Down

0 comments on commit 3eef529

Please sign in to comment.