Skip to content

Commit

Permalink
test: data-test.sql에 추가했던 member 추가 로직 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
amaran-th committed Jan 31, 2024
1 parent ea6c17f commit 7bc268c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ public static Member create(
member.updateName(name);
return member;
}

public static Member newMember() {
return new Member(1313L, "imageUrl", "amaama");
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.emmsale.member.application;

import static com.emmsale.member.MemberFixture.newMember;
import static com.emmsale.tag.TagFixture.IOS;
import static com.emmsale.tag.TagFixture.백엔드;
import static com.emmsale.tag.TagFixture.안드로이드;
Expand Down Expand Up @@ -51,7 +52,7 @@ class InterestTagServiceTest extends ServiceIntegrationTestHelper {
@BeforeEach
void init() {
사용자 = memberRepository.findById(1L).get();
새로운_사용자 = memberRepository.findById(3L).get();
새로운_사용자 = memberRepository.save(newMember());

백엔드 = tagRepository.save(백엔드());
프론트엔드 = tagRepository.save(프론트엔드());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.emmsale.member.application;

import static com.emmsale.member.MemberFixture.newMember;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

Expand All @@ -14,6 +15,7 @@
import com.emmsale.member.exception.MemberExceptionType;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -23,15 +25,17 @@ class MemberActivityCommandServiceTest extends ServiceIntegrationTestHelper {
@Autowired
private MemberActivityCommandService memberActivityCommandService;

@Autowired
private MemberCommandService memberCommandService;

@Autowired
private MemberRepository memberRepository;

@Autowired
private MemberActivityRepository memberActivityRepository;

@BeforeEach
void init() {
memberRepository.save(newMember());
}

@Test
@DisplayName("Activity의 id를 통해서, 사용자의 Activity를 등록할 수 있다.")
void registerActivities() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void findOrCreateMemberTest() {
@DisplayName("사용자를 조회하고 존재하지 않으므로 새로 생성하고 생성한 결과를 반환한다.")
void findOrCreateMemberTestWithNewMember() {
//given
final MemberQueryResponse expectResponse = new MemberQueryResponse(4L, false);
final MemberQueryResponse expectResponse = new MemberQueryResponse(3L, false);

final GithubProfileResponse githubProfileFromGithub = new GithubProfileResponse("0", "name",
"username", "https://imageUrl.com");
Expand Down
5 changes: 0 additions & 5 deletions backend/emm-sale/src/test/resources/data-test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ insert into member(id, name, image_url, open_profile_url, github_id, github_user
values (2, 'member2', 'https://imageurl.com', 'https://openprofileurl.com', 2, 'amaran-th22',
CURRENT_TIMESTAMP(),
CURRENT_TIMESTAMP());
insert into member(id, name, image_url, open_profile_url, github_id, github_username, created_at,
updated_at)
values (3, null, 'https://imageurl.com', 'https://openprofileurl.com', 33, 'amaran-th333',
CURRENT_TIMESTAMP(),
CURRENT_TIMESTAMP());

insert into member_activity(id, activity_id, member_id, created_at, updated_at)
values (1, 1, 1, CURRENT_TIMESTAMP(), CURRENT_TIMESTAMP());
Expand Down

0 comments on commit 7bc268c

Please sign in to comment.