mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-22 14:42:37 +01:00
Previously ConfigTests constructed Config instances with string-based options, e.g.: Config config = new Config("--appName=My-Bisq"); The advantage here is clarity, but the downside is repetition of the option names without any reference to their corresponding Config.* constants. One solution to the problem would be to format the option strings using constants declared in the Config class, e.g.: Config config = new Config(format("--%s=My-Bisq", APP_NAME)); but this is verbose, cumbersome to read and write and requires repeating he '--' and '=' option syntax. This commit introduces the Opt class and the opt() and configWithOpts() methods to ConfigTests to make testing easier while using constant references and preserving readability. e.g.: Config config = configWithOpts(opt(APP_NAME, "My-Bisq")); In the process of making these changes a bug was discovered in the monitor submodule's P2PNetworkLoad class and that has been fixed here as well. This change also required introducing several option name constants that had not previously been extracted in order to be referenced within ConfigTests. For consistency and completeness, all additional option names that did not previously have a contstant now have one. |
||
---|---|---|
.. | ||
main | ||
test/java/bisq/monitor |