Netflix / archaius

Library for configuration management API
Apache License 2.0
2.46k stars 485 forks source link

ConfigManagerTest.testBasicReplacement is using the Print instead of Assert in Testing #710

Closed Codegass closed 5 months ago

Codegass commented 6 months ago

Description

When I am running the test for ConfigManager, I noticed that the test case in the its test class ConfigManagerTest does not have any Assert from the Junit.

The test case testBasicReplacement is using the println to print out the related information for manual verification. There is no JUnit Assert function in the test case. Based on my understanding, this requires manual checking of the printed information to verify whether the test cases pass or fail.

Suggested Solution

To address this, I suggest refactoring to use AtomicReference for capturing property changes and verifying with Assertions.assertEquals. This ensures automated, precise test validation, aligning with best practices for robust testing.

If this change is considered beneficial, I am willing to implement it and submit a PR for review.