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

[20220831] Spring @Mock, @MockBean, @InectMocks #264

Open
JuHyun419 opened this issue Aug 31, 2022 · 0 comments
Open

[20220831] Spring @Mock, @MockBean, @InectMocks #264

JuHyun419 opened this issue Aug 31, 2022 · 0 comments
Labels

Comments

@JuHyun419
Copy link
Owner

@Mock

  • Mock 객체 생성(실제 인스턴스가 아닌 가상의 Mock 인스턴스)

@MockBean

  • 스프링 컨텍스트에 Mock 객체를 등록 -> 스프링 컨테이너가 필요한 경우 사용

@InjectMocks

  • 해당 클래스의 객체가 생성될 때 필요한 Mock 객체들을 탐지한 후 주입하여 인스턴스 생성
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant