Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sarpsahinalp committed Oct 21, 2024
1 parent ec8a350 commit 20b9767
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ public void executeArchitectureTestCase(JavaClasses classes) {
default -> throw new UnsupportedOperationException("Not implemented yet");
}
} catch (AssertionError e) {
assert e.getMessage().split("\n").length > 1;
if (e.getMessage() == null || e.getMessage().split("\n").length < 2) {
throw new SecurityException(localized("security.archunit.illegal.execution", e.getMessage()));
}
throw new SecurityException(localized("security.archunit.illegal.execution", e.getMessage().split("\n")[1]));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ public static ArchRule noClassesShouldImportForbiddenPackages(Set<String> allowe
public boolean test(JavaClass javaClass) {
return allowedPackages.stream().noneMatch(allowedPackage -> javaClass.getPackageName().startsWith(allowedPackage));
}
})
.as("TEST TEST");
});
}

private static ArchRule createNoClassShouldHaveMethodRule(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

import static com.google.common.collect.Iterables.isEmpty;
import static de.tum.cit.ase.ares.api.aop.java.instrumentation.advice.JavaInstrumentationAdviceToolbox.localize;
import static de.tum.cit.ase.ares.api.jupiter.JupiterSecurityExtension.resetSettings;
//</editor-fold>

/**
Expand Down Expand Up @@ -197,10 +196,6 @@ public JavaSecurityTestCaseFactoryAndBuilder(
* </p>
*/
private void createSecurityTestCases() {
//<editor-fold desc="Delete old rules code">
// Reset
//</editor-fold>

//<editor-fold desc="Create fixed rules code">
Set<SecurityPolicy.PackagePermission> allowedPackages = new HashSet<>(resourceAccesses.regardingPackageImports());
// Add default imports needed for the execution
Expand Down

0 comments on commit 20b9767

Please sign in to comment.