작성
·
288
0
안녕하세요 영한님 강의 너무 감사하게 잘보고 있습니다.
강의를 너무 잘보고 있던 와중에 Junit 테스트 중 에러가 발생하여 몇일째 해결을 못하고 있어서 이렇게 문의 드립니다 ㅠㅠ
영상 강의 중 회원테스트 강의에 MemberServiceTest 를 Junit으로 테스트시 오류메세지가 올라옵니다
이해가 잘 가지 않는 부분이 MemoryMemberRepositoryTest는 Junit으로 테스트시 문제가 없었으나
MemberServiceTest만 오류가 발생합니다 또한 내부의 내용을 전부 지운 후 메서드 이름만 있는 상태에서 실행해도
다음과 같은 에러가 올라옵니다
내용은 다음과 같습니다
********************************************************************************************
Internal Error occurred.
org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-jupiter' failed to discover tests
at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:189)
at org.junit.platform.launcher.core.DefaultLauncher.discoverRoot(DefaultLauncher.java:168)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:132)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: org.junit.platform.commons.JUnitException: MethodSelector [className = 'hello.hellospring.Service.MemberServiceTest', methodName = 'join', methodParameterTypes = ''] resolution failed
at org.junit.platform.launcher.listeners.discovery.AbortOnFailureLauncherDiscoveryListener.selectorProcessed(AbortOnFailureLauncherDiscoveryListener.java:39)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:102)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.run(EngineDiscoveryRequestResolution.java:82)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolver.resolve(EngineDiscoveryRequestResolver.java:113)
at org.junit.jupiter.engine.discovery.DiscoverySelectorResolver.resolveSelectors(DiscoverySelectorResolver.java:45)
at org.junit.jupiter.engine.JupiterTestEngine.discover(JupiterTestEngine.java:69)
at org.junit.platform.launcher.core.DefaultLauncher.discoverEngineRoot(DefaultLauncher.java:181)
... 6 more
Caused by: org.junit.platform.commons.PreconditionViolationException: Could not load class with name: hello.hellospring.Service.MemberServiceTest
at org.junit.platform.engine.discovery.MethodSelector.lambda$lazyLoadJavaClass$0(MethodSelector.java:157)
at org.junit.platform.commons.function.Try$Failure.getOrThrow(Try.java:335)
at org.junit.platform.engine.discovery.MethodSelector.lazyLoadJavaClass(MethodSelector.java:156)
at org.junit.platform.engine.discovery.MethodSelector.getJavaClass(MethodSelector.java:135)
at org.junit.jupiter.engine.discovery.MethodSelectorResolver.resolve(MethodSelectorResolver.java:69)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.lambda$resolve$2(EngineDiscoveryRequestResolution.java:146)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1632)
at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:127)
at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:502)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:488)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:543)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:185)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolve(EngineDiscoveryRequestResolution.java:125)
at org.junit.platform.engine.support.discovery.EngineDiscoveryRequestResolution.resolveCompletely(EngineDiscoveryRequestResolution.java:91)
... 11 more
Caused by: java.lang.ClassNotFoundException: hello.hellospring.Service.MemberServiceTest
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at org.junit.platform.commons.util.ReflectionUtils.lambda$tryToLoadClass$9(ReflectionUtils.java:790)
at org.junit.platform.commons.function.Try.lambda$call$0(Try.java:57)
at org.junit.platform.commons.function.Try.of(Try.java:93)
at org.junit.platform.commons.function.Try.call(Try.java:57)
at org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass(ReflectionUtils.java:753)
at org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass(ReflectionUtils.java:709)
... 27 more
Process finished with exit code -2
********************************************************************************************
구글링도 하고 영상강의도 몇번이나 재시청 해봤지만 문제를 해결 하지 못하여 이렇게 질문드립니다.
감사합니다