Executei o MVN package e não funcionou. Observe o erro abaixo que apresenta.
SQL State : 08001
Error Code : 0
Message : Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Caused by: org.postgresql.util.PSQLException: Connection to localhost:5432 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 (Connection refused)
[INFO] Running br.com.caelum.clines.api.users.UserFormMapperTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 s - in br.com.caelum.clines.api.users.UserFormMapperTest
[INFO] Running br.com.caelum.clines.api.users.UserViewMapperTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in br.com.caelum.clines.api.users.UserViewMapperTest
[INFO] Running br.com.caelum.clines.shared.domain.FlightTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in br.com.caelum.clines.shared.domain.FlightTest
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] AircraftControllerTest.shouldReturn404WhenNotExistAircraftByCode » IllegalState
[ERROR] AircraftControllerTest.shouldReturnAnAircraftByCode » IllegalState Failed to l...
[ERROR] AircraftRepositoryTest.shouldReturnAircraftByCodeWhenExistsAnAircraftInDB » IllegalState
[ERROR] AircraftRepositoryTest.shouldReturnAnEmptyOptionalWhenNotExistsAircraftByCode » IllegalState
[ERROR] AircraftRepositoryTest.shouldSaveANewAircraft » IllegalState Failed to load Ap...
[ERROR] LocationControllerIntegrationTest.listAllLocationsShouldReturnAnEmptyList » IllegalState
[ERROR] LocationControllerIntegrationTest.listAllLocationsShouldReturnListOfLocations » IllegalState
[ERROR] LocationControllerIntegrationTest.shouldReturnHttpStatus201AndHeaderAttributeLocationWhenValidFormIsInformed » IllegalState
[ERROR] LocationControllerIntegrationTest.shouldReturnLocationById » IllegalState Fail...
[ERROR] LocationControllerIntegrationTest.shouldReturnNotFoundForNotFoundLocation » IllegalState
[ERROR] PromotionalCodeControllerTest.shouldReturnHttpStatus201AndHeaderAttributeLocationWhenValidFormIsInformed » IllegalState
[ERROR] PromotionalCodeControllerTest.shouldReturnHttpStatus409IfCodeAlreadyExists » IllegalState
[ERROR] PromotionalCodeRepositoryTest.shouldSaveNewPromotionalCode » IllegalState Fail...
[ERROR] UserControllerTest.shouldReturn404WhenNotExistUserById » IllegalState Failed t...
[ERROR] UserControllerTest.shouldReturnAnUserById » IllegalState Failed to load Applic...
[INFO]
[ERROR] Tests run: 49, Failures: 0, Errors: 15, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:17 min
[INFO] Finished at: 2025-11-18T00:32:04-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project clines-api: There are test failures.
[ERROR]
[ERROR] Please refer to /mnt/c/1.projetos/agilidade e devops/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
Wesbonf@Devops:/mnt/c/1.projetos/agilidade e devops$