Skip to content

Commit

Permalink
test: 트랜잭션 전파 레벨 때문에 테스트가 불가능하여 기존 서비스를 상속하는 테스트 서비스 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
70825 committed Aug 3, 2023
1 parent f793c27 commit 05394df
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class MemberServiceTest {

@Autowired
private MemberService memberService;
private TestMemberService memberService;

@Autowired
private MemberRepository memberRepository;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.funeat.member.application;

import com.funeat.auth.dto.SignUserDto;
import com.funeat.auth.dto.UserInfoDto;
import com.funeat.member.persistence.MemberRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TestMemberService extends MemberService {

public TestMemberService(final MemberRepository memberRepository) {
super(memberRepository);
}

@Override
@Transactional
public SignUserDto findOrCreateMember(final UserInfoDto userInfoDto) {
return super.findOrCreateMember(userInfoDto);
}
}

0 comments on commit 05394df

Please sign in to comment.