chore(java): write tests for most of the JavaIconProvider #146
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.
Warning
This PR depends on #145 getting merged before
Description
This PR introduces the following changes:
getVisibilityIconForTesting
method in theJavaIconProvider
class to allow accessing thegetVisibilityIcon
method for unit testing purposes.JavaIconProvider
class to cover various scenarios for icon provision, including:PsiClass
or the file is not a Java fileMotivation and Context
The main goal of this PR is to improve the testability of the
JavaIconProvider
class in the Catppuccin JetBrains Icons plugin. The previous implementation did not provide a way to directly test thegetVisibilityIcon
method, which is an important part of the icon provision logic.By adding the internal
getVisibilityIconForTesting
method and creating a comprehensive set of unit tests, we can ensure that the visibility icon provision works as expected, which will improve the overall reliability and maintainability of the plugin.How Has This Been Tested?
This PR includes a new test suite for the
JavaIconProvider
class, which covers the various scenarios mentioned in the description. The tests ensure that the visibility icon provision logic works as expected for different access modifiers.Checklist