-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added optional property to ignore folders for archunit tests #3453
- Loading branch information
1 parent
a0236d3
commit 452f4a9
Showing
5 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...-archunit-test/src/test/java/mercedesbenz/com/sechub/archunit/ArchUnitRuntimeSupport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package mercedesbenz.com.sechub.archunit; | ||
|
||
import java.util.*; | ||
|
||
import com.tngtech.archunit.core.importer.ImportOption; | ||
|
||
class ArchUnitRuntimeSupport { | ||
|
||
public List<ImportOption> createImportOptionsIgnoreFolder() { | ||
List<ImportOption> importOptions = new ArrayList<>(); | ||
|
||
// comma seperated list of folders to ignore e.g. build folders from different | ||
// builds | ||
String folderToIgnore = System.getProperty("sechub.archunit.ignoreFolders"); | ||
if (folderToIgnore == null || folderToIgnore.isBlank()) { | ||
return importOptions; | ||
} | ||
|
||
String[] folders = folderToIgnore.split(","); | ||
for (String folder : folders) { | ||
importOptions.add(location -> !location.contains(folder)); | ||
} | ||
return importOptions; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters