MasterCloudApps-Projects / your-race

Apache License 2.0
4 stars 1 forks source link

Feature get planned races #48

Closed raquetelio closed 2 years ago

raquetelio commented 2 years ago
  1. Contiene el siguiente AC de #26:

    • Any person can get the list of races not celebrated yet. (Añade endpoint: races/planned).
  2. Incluye la restauración de RaceTest.java anterior a la introducción de los Faker, ya que me daba el siguiente error:

2022-10-10 22:41:34.188 INFO 83599 --- [ main] e.c.m.y.rest.AthleteResourceTest : Starting AthleteResourceTest using Java 17.0.1 on tos with PID 83599 (started by rtoscano in /home/rtoscano/master/TFM/your-race/your-race) 2022-10-10 22:41:34.188 INFO 83599 --- [ main] e.c.m.y.rest.AthleteResourceTest : No active profile set, falling back to 1 default profile: "default" 2022-10-10 22:41:34.449 INFO 83599 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode. 2022-10-10 22:41:34.461 INFO 83599 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 11 ms. Found 7 JPA repository interfaces. 2022-10-10 22:41:34.889 INFO 83599 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2022-10-10 22:41:34.893 INFO 83599 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-4 - Starting... 2022-10-10 22:41:34.914 INFO 83599 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-4 - Start completed. 2022-10-10 22:41:34.914 INFO 83599 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL10Dialect 2022-10-10 22:41:35.131 INFO 83599 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2022-10-10 22:41:35.132 INFO 83599 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2022-10-10 22:41:36.300 INFO 83599 --- [ main] o.s.b.t.m.w.SpringBootMockServletContext : Initializing Spring TestDispatcherServlet '' 2022-10-10 22:41:36.301 INFO 83599 --- [ main] o.s.t.web.servlet.TestDispatcherServlet : Initializing Servlet '' 2022-10-10 22:41:36.308 INFO 83599 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 14 endpoint(s) beneath base path '/actuator' 2022-10-10 22:41:36.328 INFO 83599 --- [ main] o.s.t.web.servlet.TestDispatcherServlet : Completed initialization in 27 ms 2022-10-10 22:41:36.371 INFO 83599 --- [ main] e.c.m.y.rest.AthleteResourceTest : Started AthleteResourceTest in 2.225 seconds (JVM running for 44.485) [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.342 s - in es.codeurjc.mastercloudapps.your_race.rest.AthleteResourceTest [INFO] Running es.codeurjc.mastercloudapps.your_race.repos.AthleteRepositoryTest 2022-10-10 22:41:36.953 INFO 83599 --- [ main] o.s.t.c.support.AbstractContextLoader : Could not detect default resource locations for test class [es.codeurjc.mastercloudapps.your_race.AbstractDatabaseTest]: no resource found for suffixes {-context.xml, Context.groovy}. 2022-10-10 22:41:36.953 INFO 83599 --- [ main] t.c.s.AnnotationConfigContextLoaderUtils : Could not detect default configuration classes for test class [es.codeurjc.mastercloudapps.your_race.AbstractDatabaseTest]: AbstractDatabaseTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration. 2022-10-10 22:41:36.958 INFO 83599 --- [ main] .b.t.c.SpringBootTestContextBootstrapper : Found @SpringBootConfiguration es.codeurjc.mastercloudapps.your_race.YourRaceApplication for test class es.codeurjc.mastercloudapps.your_race.repos.AthleteRepositoryTest 2022-10-10 22:41:36.960 INFO 83599 --- [ main] .b.t.c.SpringBootTestContextBootstrapper : Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener] 2022-10-10 22:41:36.961 INFO 83599 --- [ main] .b.t.c.SpringBootTestContextBootstrapper : Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@41040abf, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@2012a36c, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@2f949bf0, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@3cdc43b, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@627d770f, org.springframework.test.context.support.DirtiesContextTestExecutionListener@57c1b1ef, org.springframework.test.context.transaction.TransactionalTestExecutionListener@5c01fbfc, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@3100005b, org.springframework.test.context.event.EventPublishingTestExecutionListener@384cdc7b, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@62d85c54, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@315585e8, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@e64941, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@5e17e222, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@7e0d2f48, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@636a9fa4] 2022-10-10 22:41:36.962 INFO 83599 --- [ main] 🐳 [postgres:14.5] : Creating container for image: postgres:14.5 2022-10-10 22:41:37.086 INFO 83599 --- [ main] 🐳 [postgres:14.5] : Starting container with ID: ffa77770e6783d106dee7830fab72b825b7519f278f139262f0185b0b9b07dd3 2022-10-10 22:41:37.594 INFO 83599 --- [ main] 🐳 [postgres:14.5] : Container postgres:14.5 is starting: ffa77770e6783d106dee7830fab72b825b7519f278f139262f0185b0b9b07dd3 2022-10-10 22:41:39.471 INFO 83599 --- [ main] 🐳 [postgres:14.5] : Container postgres:14.5 started in PT2.509458491S 2022-10-10 22:41:39.480 WARN 83599 --- [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-2 - Failed to validate connection org.postgresql.jdbc.PgConnection@62686d48 (This connection has been closed.). Possibly consider using a shorter maxLifetime value. 2022-10-10 22:41:39.483 WARN 83599 --- [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-2 - Failed to validate connection org.postgresql.jdbc.PgConnection@3925b21f (This connection has been closed.). Possibly consider using a shorter maxLifetime value. 2022-10-10 22:41:39.483 WARN 83599 --- [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-2 - Failed to validate connection org.postgresql.jdbc.PgConnection@18869a5e (This connection has been closed.). Possibly consider using a shorter maxLifetime value. 2022-10-10 22:41:39.484 WARN 83599 --- [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-2 - Failed to validate connection org.postgresql.jdbc.PgConnection@14cb3d57 (This connection has been closed.). Possibly consider using a shorter maxLifetime value. 2022-10-10 22:41:39.486 WARN 83599 --- [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-2 - Failed to validate connection org.postgresql.jdbc.PgConnection@7cedb6af (This connection has been closed.). Possibly consider using a shorter maxLifetime value. 2022-10-10 22:41:39.487 WARN 83599 --- [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-2 - Failed to validate connection org.postgresql.jdbc.PgConnection@684c4667 (This connection has been closed.). Possibly consider using a shorter maxLifetime value. 2022-10-10 22:41:39.488 WARN 83599 --- [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-2 - Failed to validate connection org.postgresql.jdbc.PgConnection@44b4755a (This connection has been closed.). Possibly consider using a shorter maxLifetime value. 2022-10-10 22:41:39.489 WARN 83599 --- [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-2 - Failed to validate connection org.postgresql.jdbc.PgConnection@9d8c91e (This connection has been closed.). Possibly consider using a shorter maxLifetime value. 2022-10-10 22:41:39.490 WARN 83599 --- [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-2 - Failed to validate connection org.postgresql.jdbc.PgConnection@18914e44 (This connection has been closed.). Possibly consider using a shorter maxLifetime value. 2022-10-10 22:41:39.491 WARN 83599 --- [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-2 - Failed to validate connection org.postgresql.jdbc.PgConnection@12e45c4f (This connection has been closed.). Possibly consider using a shorter maxLifetime value. 2022-10-10 22:42:09.483 WARN 83599 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 08001 2022-10-10 22:42:09.484 ERROR 83599 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : HikariPool-2 - Connection is not available, request timed out after 30002ms. 2022-10-10 22:42:09.485 ERROR 83599 --- [ main] o.h.engine.jdbc.spi.SqlExceptionHelper : Connection to localhost:49246 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 33.089 s <<< FAILURE! - in es.codeurjc.mastercloudapps.your_race.repos.AthleteRepositoryTest [ERROR] test Time elapsed: 30.055 s <<< ERROR! org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection at es.codeurjc.mastercloudapps.your_race.repos.AthleteRepositoryTest.test(AthleteRepositoryTest.java:21) Caused by: org.hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection at es.codeurjc.mastercloudapps.your_race.repos.AthleteRepositoryTest.test(AthleteRepositoryTest.java:21) Caused by: java.sql.SQLTransientConnectionException: HikariPool-2 - Connection is not available, request timed out after 30002ms. at es.codeurjc.mastercloudapps.your_race.repos.AthleteRepositoryTest.test(AthleteRepositoryTest.java:21) Caused by: org.postgresql.util.PSQLException: Connection to localhost:49246 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. Caused by: java.net.ConnectException: Connection refused

2022-10-10 22:42:10.102 INFO 83599 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2022-10-10 22:42:10.104 INFO 83599 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2022-10-10 22:42:10.123 INFO 83599 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. 2022-10-10 22:42:10.129 INFO 83599 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2022-10-10 22:42:10.130 INFO 83599 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Shutdown initiated... 2022-10-10 22:42:17.808 INFO 83599 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Shutdown completed. 2022-10-10 22:42:17.826 INFO 83599 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2022-10-10 22:42:17.830 INFO 83599 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-3 - Shutdown initiated... 2022-10-10 22:42:17.838 INFO 83599 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-3 - Shutdown completed. 2022-10-10 22:42:17.850 INFO 83599 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default' 2022-10-10 22:42:17.852 INFO 83599 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-4 - Shutdown initiated... 2022-10-10 22:42:17.855 INFO 83599 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-4 - Shutdown completed. [INFO] [INFO] Results: [INFO] [ERROR] Errors: [ERROR] AthleteRepositoryTest.test:21 » CannotCreateTransaction Could not open JPA Ent... [INFO] [ERROR] Tests run: 15, Failures: 0, Errors: 1, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:37 min [INFO] Finished at: 2022-10-10T22:42:18+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project your-race: There are test failures. [ERROR] [ERROR] Please refer to /home/rtoscano/master/TFM/your-race/your-race/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

raquetelio commented 2 years ago

Cierro PR para seguir trabajando en la rama