AYUDA! No sé como resolver este error. [INFO] Scanning for projects… [INFO] [INFO] ----------------------< com.platzi:e-reservation &g...

David Alejandro García Graterón

David Alejandro García Graterón

Pregunta
student
hace 6 años

AYUDA! No sé como resolver este error.

[INFO] Scanning for projects…

[INFO]

[INFO] ----------------------< com.platzi:e-reservation >----------------------

[INFO] Building e-reservation 0.0.1-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO]

[INFO] — maven-clean-plugin:3.1.0:clean (default-clean) @ e-reservation —

[INFO] Deleting C:\Users\Carlos\Documents\workspace-spring-tool-suite-4-4.2.1.RELEASE\e-reservation\target

[INFO]

[INFO] — maven-resources-plugin:3.1.0:resources (default-resources) @ e-reservation —

[INFO] Using ‘UTF-8’ encoding to copy filtered resources.

[INFO] Copying 2 resources

[INFO] Copying 0 resource

[INFO]

[INFO] — maven-compiler-plugin:3.8.1:compile (default-compile) @ e-reservation —

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 3 source files to C:\Users\Carlos\Documents\workspace-spring-tool-suite-4-4.2.1.RELEASE\e-reservation\target\classes

[INFO]

[INFO] — maven-resources-plugin:3.1.0:testResources (default-testResources) @ e-reservation —

[INFO] Using ‘UTF-8’ encoding to copy filtered resources.

[INFO] skip non existing resourceDirectory C:\Users\Carlos\Documents\workspace-spring-tool-suite-4-4.2.1.RELEASE\e-reservation\src\test\resources

[INFO]

[INFO] — maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ e-reservation —

[INFO] Changes detected - recompiling the module!

[INFO] Compiling 1 source file to C:\Users\Carlos\Documents\workspace-spring-tool-suite-4-4.2.1.RELEASE\e-reservation\target\test-classes

[INFO]

[INFO] — maven-surefire-plugin:2.22.2:test (default-test) @ e-reservation —

[INFO]

[INFO] -------------------------------------------------------

[INFO] T E S T S

[INFO] -------------------------------------------------------

[INFO] Running com.platzi.EReservationApplicationTests

12:39:12.775 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class com.platzi.EReservationApplicationTests]

12:39:12.783 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]

12:39:12.795 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]

12:39:12.825 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [com.platzi.EReservationApplicationTests] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]

12:39:12.843 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [com.platzi.EReservationApplicationTests], using SpringBootContextLoader

12:39:12.849 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.platzi.EReservationApplicationTests]: class path resource [com/platzi/EReservationApplicationTests-context.xml] does not exist

12:39:12.849 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.platzi.EReservationApplicationTests]: class path resource [com/platzi/EReservationApplicationTestsContext.groovy] does not exist

12:39:12.849 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [com.platzi.EReservationApplicationTests]: no resource found for suffixes {-context.xml, Context.groovy}.

12:39:12.851 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [com.platzi.EReservationApplicationTests]: EReservationApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.

12:39:12.948 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an ‘annotation declaring class’ for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.platzi.EReservationApplicationTests]

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.528 s <<< FAILURE! - in com.platzi.EReservationApplicationTests

[ERROR] initializationError(com.platzi.EReservationApplicationTests) Time elapsed: 0.008 s <<< ERROR!

java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test

[INFO]

[INFO] Results:

[INFO]

[ERROR] Errors:

[ERROR] EReservationApplicationTests.initializationError » IllegalState Unable to find…

[INFO]

[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

[INFO]

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 9.080 s

[INFO] Finished at: 2019-05-19T12:39:13-04:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project e-reservation: There are test failures.

[ERROR]

[ERROR] Please refer to C:\Users\Carlos\Documents\workspace-spring-tool-suite-4-4.2.1.RELEASE\e-reservation\target\surefire-reports for the individual test results.

[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.

[ERROR] -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

2 respuestas
para escribir tu comentario
    Cesar David Ramírez Dimaté

    Cesar David Ramírez Dimaté

    student
    hace 5 años

    Es importante empezar a saber cómo leer los errores de compilación ya que copiar toda la trama es innecesario.

    [ERROR] initializationError(com.platzi.EReservationApplicationTests) Time elapsed: 0.008 s <<< ERROR! java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=…) with your test

    Y radica en que el test o el proyecto no fueron creados correctamente al momento de generarlo.

    Unable to find a @SpringBootConfiguration when doing a JpaTest

    Ivan Martínez Martínez

    Ivan Martínez Martínez

    student
    hace 6 años

    Cambia la versión en el pom.xml

    <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.4.RELEASE</version>

Curso de Hibernate y Java Spring

Curso de Hibernate y Java Spring

Crear aplicaciones intuitivas comienza con un desarrollo ágil y eficiente. ¿Sabías que con Hibernate y Java Spring puedes optimizar procesos entre apps y bases de datos, o evitar acciones repetitivas, como escribir varias veces la mismas líneas de código? Ahora tendrás tiempo para hacer más de lo que te gusta: ¡nunca parar de aprender con Platzi!

Curso de Hibernate y Java Spring
Curso de Hibernate y Java Spring

Curso de Hibernate y Java Spring

Crear aplicaciones intuitivas comienza con un desarrollo ágil y eficiente. ¿Sabías que con Hibernate y Java Spring puedes optimizar procesos entre apps y bases de datos, o evitar acciones repetitivas, como escribir varias veces la mismas líneas de código? Ahora tendrás tiempo para hacer más de lo que te gusta: ¡nunca parar de aprender con Platzi!