spring-guides / gs-gateway

Building a Gateway :: Learn how to configure a gateway

Home Page:https://spring.io/guides/gs/gateway

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't get the test to run

aroc725 opened this issue · comments

commented

I'm unable to get the 'ApplicationTest' class to run successfully. I'm getting the following error message when I try to run it within Eclipse:

java.lang.NoClassDefFoundError: org/junit/platform/engine/TestEngine
at org.junit.platform.launcher.core.ServiceLoaderTestEngineRegistry.loadTestEngines(ServiceLoaderTestEngineRegistry.java:35)
at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:87)
at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:67)
at org.eclipse.jdt.internal.junit5.runner.JUnit5TestLoader.(JUnit5TestLoader.java:34)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createRawTestLoader(RemoteTestRunner.java:371)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.createLoader(RemoteTestRunner.java:366)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.defaultInit(RemoteTestRunner.java:310)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.init(RemoteTestRunner.java:225)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
Caused by: java.lang.ClassNotFoundException: org.junit.platform.engine.TestEngine
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 14 more

Hi @aroc725. I went through the guide today and I could not reproduce this error. There have been many changes to the guide since your original issue was filed and I expect in one of those the issue was fixed.

On first glance, perhaps the issue was related to this question in Stack Overflow. Note that junit-jupiter-engine is a managed dependency from Spring Boot. You could also verify that junit-jupiter-engine is on the classpath by running the command ./mvnw dependency:tree | grep 'jupiter-engine'

I will close the issue for now, but please reply if this is still an issue with the guide.