Skip to content

Add MIG-019: detect Properties-based config (#38) - #44

Closed
Contributerr27 wants to merge 3 commits into
seleniumboot:mainfrom
Contributerr27:feat/mig-019-properties
Closed

Contributerr27 wants to merge 3 commits into
seleniumboot:mainfrom
Contributerr27:feat/mig-019-properties

Conversation

@Contributerr27

Copy link
Copy Markdown
Contributor

What & why

Closes #38.

Many Selenium projects keep their URL, browser and timeouts in a config.properties loaded through java.util.Properties. MIG-019 flags that so the values can be moved to selenium-boot.yml.

Detection, all MANUAL findings:

  • Properties.load(...) calls where the receiver is a variable declared as Properties
  • new FileInputStream("....properties")
  • getResourceAsStream("....properties")

How tested

  • New detectsPropertiesBasedConfig test: a fixture with Properties.load(new FileInputStream("config.properties")) plus a getResourceAsStream("/env.properties") yields exactly 3 MIG-019 findings.
  • New plainTestClassGivesNoPropertiesFinding test: a plain test class yields none.
  • Rule label added in Report.ruleLabel; mvn test: all 71 tests pass.

Detect Properties.load(...) calls and FileInputStream / getResourceAsStream usages pointing at .properties files as MANUAL findings; that configuration moves to selenium-boot.yml.

Closes seleniumboot#38
@shossain786

Copy link
Copy Markdown
Contributor

Closing as a duplicate of your own #41, which covers the same issue (#38) and also handles fields, parameters and a fixture. Let's continue there. One PR per issue, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect config loaded from .properties files (MIG-019)

2 participants