java.lang.IllegalStateException: Configuration error: found multiple declarations of @BootstrapWith on test class [EmployeeRestControllerTest] with values [class org.springframework.test.context.web.WebTestContextBootstrapper, class org.springframework.boot.test.WebAppIntegrationTestContextBootstrapper]

Stack Overflow | socal_javaguy | 8 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Trouble setting up RestAssured framework with Spring Boot

    Stack Overflow | 8 months ago | socal_javaguy
    java.lang.IllegalStateException: Configuration error: found multiple declarations of @BootstrapWith on test class [EmployeeRestControllerTest] with values [class org.springframework.test.context.web.WebTestContextBootstrapper, class org.springframework.boot.test.WebAppIntegrationTestContextBootstrapper]
  2. 0

    java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.getAnnotationAttributes

    Stack Overflow | 10 months ago | OneTwo
    java.lang.IllegalStateException: Could not load TestContextBootstrapper [class org.springframework.test.context.support.DefaultTestContextBootstrapper]. Specify @BootstrapWith's 'value' attribute or make the default bootstrapper class available.
  3. 0

    Could not load TestContextBootstrapper - Spring Unit testing

    Stack Overflow | 2 years ago | Tariq
    java.lang.IllegalStateException: Could not load TestContextBootstrapper [class org.springframework.test.context.support.DefaultTestContextBootstrapper]. Specify @BootstrapWith's 'value' attribute or make the default bootstrapper class available.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    junit4 测试错误? - Spring - 知乎

    zhihu.com | 9 months ago
    java.lang.IllegalStateException: Could not load CacheAwareContextLoaderDelegate [class org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
  6. 0

    Spring testing using @ContextConfiguration or @ContextHierarchy

    javarticles.com | 6 months ago
    java.lang.IllegalStateException: Configuration error: both default locations AND default configuration classes were detected for context configuration [ContextConfigurationAttributes@3f102e87 declaringClass = 'com.javarticles.spring.SpringFailureTest', classes = '{class com.javarticles.spring.SpringFailureTest$Config}', locations = '{classpath:com/javarticles/spring/SpringFailureTest-context.xml}', inheritLocations = true, initializers = '{}', inheritInitializers = true, name = [null], contextLoaderClass = 'org.springframework.test.context.ContextLoader']; configure one or the other, but not both.

    16 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Configuration error: found multiple declarations of @BootstrapWith on test class [EmployeeRestControllerTest] with values [class org.springframework.test.context.web.WebTestContextBootstrapper, class org.springframework.boot.test.WebAppIntegrationTestContextBootstrapper]

      at org.springframework.test.context.BootstrapUtils.resolveTestContextBootstrapper()
    2. Spring TestContext
      SpringJUnit4ClassRunner.<init>
      1. org.springframework.test.context.BootstrapUtils.resolveTestContextBootstrapper(BootstrapUtils.java:123)
      2. org.springframework.test.context.TestContextManager.<init>(TestContextManager.java:105)
      3. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTestContextManager(SpringJUnit4ClassRunner.java:154)
      4. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.<init>(SpringJUnit4ClassRunner.java:145)
      4 frames