Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] Test 리팩터링(#788) #789

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package corea.matching.infrastructure;

import config.ServiceTest;
import org.junit.jupiter.api.Disabled;
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 static org.assertj.core.api.Assertions.assertThat;

@SpringBootTest
@ServiceTest
class GithubReviewClientTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package corea.matching.infrastructure;

import config.ServiceTest;
import corea.matching.infrastructure.dto.GithubUserResponse;
import corea.matching.infrastructure.dto.PullRequestResponse;
import org.junit.jupiter.api.Disabled;
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 static org.assertj.core.api.Assertions.assertThat;

@SpringBootTest
@ServiceTest
@Disabled
class PrivateGithubPullRequestClientTest {

Expand All @@ -29,7 +29,7 @@ void get_private_repository() {

@Test
@DisplayName("레포지토리가 없으면 null 을 반환한다.")
void get_null_if_not_exist_repository(){
void get_null_if_not_exist_repository() {
String repositoryLink = "https://github.com/woowacourse-precourse/java-christmas-6";
String username = "00kang";
PullRequestResponse response = privateGithubPullRequestClient.getPullRequest(repositoryLink, username);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package corea.matching.strategy;

import config.ServiceTest;
import corea.fixture.MemberFixture;
import corea.fixture.RoomFixture;
import corea.matching.domain.Pair;
Expand All @@ -14,13 +15,12 @@
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 DynamicSizeMatchingStrategyTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package corea.matching.strategy;

import config.ServiceTest;
import corea.exception.CoreaException;
import corea.fixture.MemberFixture;
import corea.fixture.RoomFixture;
Expand All @@ -15,16 +16,13 @@
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 java.util.Map;
import java.util.stream.Collectors;

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

@SpringBootTest
@ServiceTest
class ReviewerPreemptiveMatchingStrategyTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package corea.review.infrastructure;

import config.ServiceTest;
import corea.review.dto.GithubPullRequestReview;
import org.junit.jupiter.api.Disabled;
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;

@Disabled
@SpringBootTest
@ServiceTest
class GithubPullRequestCommentClientTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package corea.review.infrastructure;

import config.ServiceTest;
import corea.review.dto.GithubPullRequestReview;
import org.junit.jupiter.api.Disabled;
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;

@Disabled
@SpringBootTest
@ServiceTest
class GithubPullRequestReviewClientTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package corea.review.infrastructure;

import config.ServiceTest;
import corea.exception.CoreaException;
import corea.review.dto.GithubPullRequestReview;
import corea.review.dto.GithubPullRequestReviewInfo;
Expand All @@ -10,13 +11,12 @@
import org.junit.jupiter.params.provider.NullAndEmptySource;
import org.junit.jupiter.params.provider.ValueSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

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

@Disabled
@SpringBootTest
@ServiceTest
class GithubReviewProviderTest {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package corea.review.pullRequest;

import config.ServiceTest;
import corea.fixture.MemberFixture;
import corea.fixture.RoomFixture;
import corea.matching.domain.PullRequestInfo;
Expand All @@ -15,23 +16,16 @@
import corea.review.service.ReviewService;
import corea.room.domain.Room;
import corea.room.repository.RoomRepository;
import io.restassured.RestAssured;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
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 org.springframework.boot.test.web.server.LocalServerPort;

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

@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ServiceTest
class ReviewPullRequestTest {

@LocalServerPort
int port;

@Autowired
private MemberRepository memberRepository;

Expand All @@ -53,11 +47,6 @@ class ReviewPullRequestTest {
@Autowired
private MatchResultService matchResultService;

@BeforeEach
void setUp() {
RestAssured.port = port;
}

@Disabled
@Test
@DisplayName("리뷰어가 리뷰를 작성했을 때, 해당 리뷰의 링크로 업데이트 한다.")
Expand Down
Loading