작성
·
542
0
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.
1. 강의 내용과 관련된 질문을 남겨주세요.
2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.
(자주 하는 질문 링크: https://bit.ly/3fX6ygx)
3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.
(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)
질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.
=========================================
[질문 템플릿]
1. 강의 내용과 관련된 질문인가요? (예/아니오)
2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)
3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)
[질문 내용]
여기에 질문 내용을 남겨주세요.
앞전의 영상까지는 테스트 환경 문제없이 했고 그 전의 강의도 문제 없이 하였습니다.
하지만 해당 강의 첫 부분 부터 회원가입(join0을 실행하면 해다 오류가 나옵니다.
17:08:49.341 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [com.example.test.Sevice.MemberServiceIntTest]: MemberServiceIntTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
17:08:49.463 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration com.example.test.TestApplication for test class com.example.test.Sevice.MemberServiceIntTest
java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
at org.mockito.internal.configuration.plugins.PluginLoader$1.invoke(PluginLoader.java:84)
at jdk.proxy2/jdk.proxy2.$Proxy72.getHandler(Unknown Source)
at org.mockito.internal.util.MockUtil.getMockHandlerOrNull(MockUtil.java:158)
at org.mockito.internal.util.MockUtil.isMock(MockUtil.java:147)
at org.mockito.internal.util.DefaultMockingDetails.isMock(DefaultMockingDetails.java:32)
at org.springframework.boot.test.mock.mockito.MockReset.get(MockReset.java:106)
at org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener.resetMocks(ResetMocksTestExecutionListener.java:85)
at org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener.resetMocks(ResetMocksTestExecutionListener.java:73)
at org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener.beforeTestMethod(ResetMocksTestExecutionListener.java:60)
at org.springframework.test.context.TestContextManager.beforeTestMethod(TestContextManager.java:320)
at org.springframework.test.context.junit.jupiter.SpringExtension.beforeEach(SpringExtension.java:240)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Suppressed: java.lang.IllegalStateException: Could not initialize plugin: interface org.mockito.plugins.MockMaker (alternate: null)
at org.mockito.internal.configuration.plugins.PluginLoader$1.invoke(PluginLoader.java:84)
at jdk.proxy2/jdk.proxy2.$Proxy72.getHandler(Unknown Source)
at org.mockito.internal.util.MockUtil.getMockHandlerOrNull(MockUtil.java:158)
at org.mockito.internal.util.MockUtil.isMock(MockUtil.java:147)
at org.mockito.internal.util.DefaultMockingDetails.isMock(DefaultMockingDetails.java:32)
at org.springframework.boot.test.mock.mockito.MockReset.get(MockReset.java:106)
at org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener.resetMocks(ResetMocksTestExecutionListener.java:85)
at org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener.resetMocks(ResetMocksTestExecutionListener.java:73)
at org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener.afterTestMethod(ResetMocksTestExecutionListener.java:67)
at org.springframework.test.context.TestContextManager.afterTestMethod(TestContextManager.java:487)
at org.springframework.test.context.junit.jupiter.SpringExtension.afterEach(SpringExtension.java:278)
... 2 more
Caused by: java.lang.IllegalStateException: Internal problem occurred, please report it. Mockito is unable to load the default implementation of class that is a part of Mockito distribution. Failed to load interface org.mockito.plugins.MockMaker
at org.mockito.internal.configuration.plugins.DefaultMockitoPlugins.create(DefaultMockitoPlugins.java:105)
at org.mockito.internal.configuration.plugins.DefaultMockitoPlugins.getDefaultPlugin(DefaultMockitoPlugins.java:79)
at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:75)
at org.mockito.internal.configuration.plugins.PluginLoader.loadPlugin(PluginLoader.java:50)
at org.mockito.internal.configuration.plugins.PluginRegistry.<init>(PluginRegistry.java:27)
at org.mockito.internal.configuration.plugins.Plugins.<clinit>(Plugins.java:22)
at org.mockito.internal.MockitoCore.<clinit>(MockitoCore.java:73)
at org.mockito.Mockito.<clinit>(Mockito.java:1683)
at org.springframework.boot.test.mock.mockito.MockReset.get(MockReset.java:105)
at org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener.resetMocks(ResetMocksTestExecutionListener.java:85)
at org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener.resetMocks(ResetMocksTestExecutionListener.java:73)
at org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener.beforeTestMethod(ResetMocksTestExecutionListener.java:60)
at org.springframework.test.context.TestContextManager.beforeTestMethod(TestContextManager.java:320)
at org.springframework.test.context.junit.jupiter.SpringExtension.beforeEach(SpringExtension.java:240)
... 2 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:484)
at org.mockito.internal.configuration.plugins.DefaultMockitoPlugins.create(DefaultMockitoPlugins.java:103)
... 15 more
Caused by: org.mockito.exceptions.base.MockitoInitializationException:
Could not initialize inline Byte Buddy mock maker.
It appears as if your JDK does not supply a working agent attachment mechanism.
Java : 19
JVM vendor name : Oracle Corporation
JVM vendor version : 19.0.1+10-21
JVM name : OpenJDK 64-Bit Server VM
JVM version : 19.0.1+10-21
JVM info : mixed mode, sharing
OS name : Windows 11
OS version : 10.0
at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.<init>(InlineDelegateByteBuddyMockMaker.java:260)
at org.mockito.internal.creation.bytebuddy.InlineByteBuddyMockMaker.<init>(InlineByteBuddyMockMaker.java:23)
... 18 more
Caused by: java.lang.IllegalStateException: Could not self-attach to current VM using external process
at net.bytebuddy.agent.ByteBuddyAgent.installExternal(ByteBuddyAgent.java:706)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:636)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:616)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:568)
at net.bytebuddy.agent.ByteBuddyAgent.install(ByteBuddyAgent.java:545)
at org.mockito.internal.creation.bytebuddy.InlineDelegateByteBuddyMockMaker.<clinit>(InlineDelegateByteBuddyMockMaker.java:133)
... 19 more
Caused by: [CIRCULAR REFERENCE: java.lang.IllegalStateException: Internal problem occurred, please report it. Mockito is unable to load the default implementation of class that is a part of Mockito distribution. Failed to load interface org.mockito.plugins.MockMaker]
커뮤니티 찾아다니면서 혼자 해결할려했으나, 도저히 방법이 ㅇ없어서 질문드립니다 ㅠㅠ
앗 해결하였습니다. 버전 문제로 안됬었습니다..
현재 학습 중이라 IntellJ 에서 기본 설정으로 스프링부트 버전이 3버전이고, 자바 JDK도 19버전이었어서 계속 서치해봤는데 현재까지 스프링부트 버전이 2버전 및 자바 JDK도 11, 1.8을 사용하는 것 같아서 해당 버전으로 그레이들 수정하였고 문제없이 실행되었습니다 ! 감사합니다..