Polish Logging and Tests

Removing debug statements which would have prematurely terminated the
stream, changing to AssertJ, and adding another test.

Issue: gh-3743
This commit is contained in:
Karl Goffin
2018-10-29 23:54:55 -04:00
committed by Josh Cummings
parent 92e68a589a
commit 50d26c9d28
2 changed files with 21 additions and 15 deletions

View File

@@ -175,21 +175,12 @@ public class DefaultMethodSecurityExpressionHandler extends
if (filterTarget instanceof Stream) {
final Stream<?> original = (Stream<?>) filterTarget;
if (debug) {
logger.debug("Filtering stream with " + original.count() + " elements");
}
Stream<?> filtered = original.filter(filterObject -> {
return original.filter(filterObject -> {
rootObject.setFilterObject(filterObject);
return ExpressionUtils.evaluateAsBoolean(filterExpression, ctx);
})
.onClose(original::close);
if (debug) {
logger.debug("Retaining elements: " + filtered.collect(Collectors.toList()));
}
return filtered;
}
throw new IllegalArgumentException(