title: Failed to execute junit5 tests with dependency management with spring boot gradle plugin
body: <p>In my project based on gradle and kotlin I have some sub module. Build configugration for it module (build.gradle.kts): </p>
  
  <pre><code>plugins {
      java
      kotlin("jvm")
      id("org.springframework.boot") version "2.1.5.RELEASE"
      id("io.spring.dependency-management") version "1.0.7.RELEASE"
  }
  
  dependencies {
  
      compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.31")
      compile("org.springframework.boot:spring-boot-starter-web")
  
      testCompile("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.31")
      testCompile("org.jetbrains.kotlin:kotlin-stdlib:1.3.31")
      testCompile("org.jetbrains.kotlin:kotlin-reflect:1.3.31")
  
      testImplementation("org.junit.jupiter:junit-jupiter-api:5.4.2")
      testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.4.2")
  }
  </code></pre>
  
  <p>I try to run some simple test in this module</p>
  
  <p>Simple class: </p>
  
  <pre><code>class Hello {
      fun hello(): String {
          return "hello"
      }
  }
  </code></pre>
  
  <p>Simple test for it: </p>
  
  <pre><code>class HelloTest {
      @Test
      fun test() {
          Assertions.assertEquals(Hello().hello(), "hello")
      }
  }
  </code></pre>
  
  <p>When i'm trying to run test i get error: </p>
  
  <pre><code>Jun 12, 2019 2:58:31 PM org.junit.platform.launcher.core.DefaultLauncher handleThrowable
  WARNING: TestEngine with ID 'junit-jupiter' failed to execute tests
  java.lang.NoSuchMethodError: org.junit.platform.commons.util.ReflectionUtils.tryToLoadClass(Ljava/lang/String;)Lorg/junit/platform/commons/function/Try;
      at org.junit.jupiter.engine.support.OpenTest4JAndJUnit4AwareThrowableCollector.createAbortedExecutionPredicate(OpenTest4JAndJUnit4AwareThrowableCollector.java:40)
      at org.junit.jupiter.engine.support.OpenTest4JAndJUnit4AwareThrowableCollector.&lt;clinit&gt;(OpenTest4JAndJUnit4AwareThrowableCollector.java:30)
      at org.junit.jupiter.engine.support.JupiterThrowableCollectorFactory.createThrowableCollector(JupiterThrowableCollectorFactory.java:34)
      at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:68)
      at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
      at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
      at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
      at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
      at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
      at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:102)
      at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:82)
      at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:78)
      at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
      at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
      at com.sun.proxy.$Proxy2.stop(Unknown Source)
      at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:132)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
      at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
      at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
      at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
      at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
      at java.lang.Thread.run(Thread.java:748)
  
  FAILURE: Build failed with an exception.
  * What went wrong:
  Execution failed for task ':app:rest:test'.
  &gt; No tests found for given includes: [ua.company.app.Hello](filter.includeTestsMatching)
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  * Get more help at https://help.gradle.org
  BUILD FAILED in 1s
  4 actionable tasks: 2 executed, 2 up-to-date
  No tests found for given includes: [ua.company.app.Hello](filter.includeTestsMatching)
  </code></pre>
  
  <p>But if remove <strong>id("io.spring.dependency-management") version "1.0.7.RELEASE"</strong> from my build config and will use version of spring boot like this <strong>compile("org.springframework.boot:spring-boot-starter-web:2.1.5.RELEASE")</strong> test runs correctly. </p>
  
  <p>Spring dependency management brokes my junit5 tests. Please can anyone explain why this is happening and how to solve the problem? Thanks!</p>