-
Couldn't load subscription status.
- Fork 10
Closed
Labels
good first issuegood first issue for contributorsgood first issue for contributorstestingImprovements to test packsImprovements to test packs
Description
We need to write a couple of unit tests for the module discoverer utility class.
These tests should be fine to just static-mock the internal module finder class.
In addition, since it is a utility class, the test class should implement the UtilityClassTestTemplate at https://github.com/ascopes/java-compiler-testing/blob/main/java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/helpers/UtilityClassTestTemplate.java
For example:
@DisplayName("ModuleDiscoverer tests")
@ExtendWith(MockitoExtension.class)
class ModuleDiscovererTest
implements UtilityClassTestTemplate {
@Mock
MockStatic<ModuleFinder> moduleFinderClass;
@Mock
ModuleFinder moduleFinderInstance;
@BeforeEach
void setUp() {
moduleFinder
.when(() -> ModuleFinder.of(any()))
.thenReturn(moduleFinderInstance);
}
...
}Metadata
Metadata
Assignees
Labels
good first issuegood first issue for contributorsgood first issue for contributorstestingImprovements to test packsImprovements to test packs