Conversation
`mvn test` failed on a fresh clone. The one live test could not start the context: `application-test.yaml` had no `cloudflare.r2.*` keys, and IoTServerAppApplicationTests never activated the test profile anyway, so it was loading production config and looking for keys that only exist in the deployment environment. The test profile now describes something that actually exists on a clean machine: H2 in memory, the MQTT client mocked, placeholder R2 values. It used to point at a Postgres on localhost:5438 and a public MQTT broker, with the broker username and password in the file. Those credentials are still in the history of this repository and should be rotated. With the context starting, five parked test classes come back with no changes beyond uncommenting. 1 failing test becomes 9 passing ones. Six classes stay commented out and the README now says which and why, rather than the previous "the test suite is disabled". They compile and run; 7 assertions drift from what the endpoints return today, and deciding the new expected values is a separate job from getting the build green. Adds MIT.
Committed from Windows without the executable bit, so ./mvnw is a permission error on any Linux or macOS clone, CI included.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mvn testfails on a fresh clone of the current default branch. The one live test cannot start the Spring context:application-test.yamlcarries nocloudflare.r2.*keys, andIoTServerAppApplicationTestsnever activated thetestprofile in the first place, so it loaded production config and looked for keys that only exist in the deployment environment.What changed
application-test.yamlnow describes something that exists on a clean machine: H2 in memory, the MQTT client mocked out, placeholder R2 values. It previously pointed at a Postgres onlocalhost:5438and a public MQTT broker.IoTServerAppApplicationTestsactivates thetestprofile../mvnw verifyon Temurin 17 for every push and pull request. No services, no secrets.Please rotate the MQTT broker credentials. The old
application-test.yamlhad the broker host, username and password in it. Removing them from the current file does not remove them from the history of a public repository.What is deliberately not in this PR
Six test classes stay commented out. They compile and run; 7 assertions have drifted from what the endpoints return today,
LampServicegained two constructor arguments, andMqttListenerServiceTesttests a service that is itself commented out. The README now lists each one and why, instead of the previous "the test suite is disabled". Deciding the new expected values is a separate job from getting the build green, and it is yours to make rather than mine to guess.