Skip to content

Fix(tests): Rename MicroSwitchHelperTests file to .java - #404

Merged
leandrumartin merged 1 commit into
oss-slu:mainfrom
Ankita562:fix/rename-test-file-401
Oct 19, 2025
Merged

Fix(tests): Rename MicroSwitchHelperTests file to .java#404
leandrumartin merged 1 commit into
oss-slu:mainfrom
Ankita562:fix/rename-test-file-401

Conversation

@Ankita562

Copy link
Copy Markdown
Contributor

Pull Request Summary:
This PR fixes the MicroSwitchHelperTests file. The file was not being executed by the build system because it was missing the .java extension, and it also contained a compilation error.

This fix addresses both issues, allowing the test suite to run successfully and validate the MicroSwitchHelper class. The changes were verified by running the ./gradlew test command and confirming that all tests pass.

PR Checklist:-
[x] Closes #401
[x] Tests pass
[x] No documentation changes were required for this fix.

Detailed Description

There were two main issues addressed in this pull request:
1.Incorrect Filename: The test file was named MicroSwitchHelperTests instead of MicroSwitchHelperTests.java. I renamed the file so that the Gradle build system would recognize and compile it.
2.Static Context Error: After renaming the file, a compilation error was revealed: non-static method addEventListener cannot be referenced from a static context. I corrected this on line 56 by changing the static call from MicroSwitchHelper.addEventListener(...) to an instance call using the existing object: microSwitchHelper.addEventListener(...).

With these changes, the build is now successful.

@CLAassistant

CLAassistant commented Oct 18, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Ankita562
Ankita562 force-pushed the fix/rename-test-file-401 branch from dc32698 to 7af9139 Compare October 18, 2025 06:04
@leandrumartin

Copy link
Copy Markdown
Collaborator

Thank you for your contribution!

@leandrumartin
leandrumartin merged commit 4e7f775 into oss-slu:main Oct 19, 2025
5 of 6 checks passed
@Ankita562
Ankita562 deleted the fix/rename-test-file-401 branch October 21, 2025 04:54
@leandrumartin leandrumartin added the hacktoberfest-accepted For accepted and merged PRs for Hacktoberfest label Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted For accepted and merged PRs for Hacktoberfest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix MicroSwitchHelperTests

3 participants