Skip to content

Commit

Permalink
анализ неизвестных модулей
Browse files Browse the repository at this point in the history
  • Loading branch information
artbear committed Dec 17, 2023
1 parent 719cae5 commit c5af8a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
severity = DiagnosticSeverity.MAJOR,
modules = {
ModuleType.CommonModule,
ModuleType.ObjectModule
ModuleType.ObjectModule,
ModuleType.UNKNOWN
},
minutesToFix = 1,
tags = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ void testObjectModuleByDefault() {
assertThat(diagnostics).isEmpty();
}

@Test
void testUnknowModule() {
getModuleDocumentContext(ModuleType.UNKNOWN);
checkByDefault(getDiagnostics(documentContext));
}

@Test
void testConfigure() {
// given
Expand Down Expand Up @@ -111,9 +117,13 @@ void testObjectModuleWithEnabledConfiguration() {
}

private void getObjectModuleDocumentContext() {
getModuleDocumentContext(ModuleType.ObjectModule);
}

private void getModuleDocumentContext(ModuleType moduleType) {
Path testFile = Paths.get(PATH_TO_MODULE_CONTENT).toAbsolutePath();
getDocumentContextFromFile(testFile);
when(documentContext.getModuleType()).thenReturn(ModuleType.ObjectModule);
when(documentContext.getModuleType()).thenReturn(moduleType);
when(documentContext.getMdObject()).thenReturn(Optional.of(module));
}

Expand Down

0 comments on commit c5af8a2

Please sign in to comment.