exclude blocked implementation completion

This commit is contained in:
kennycud 2025-01-11 19:01:13 -08:00
parent 70f4ff4fb3
commit 69cba78d94
2 changed files with 20 additions and 2 deletions

View File

@ -180,7 +180,10 @@ public class HSQLDBCacheUtils {
Optional<Boolean> reverse) {
// retain only candidates with names
Stream<ArbitraryResourceData> stream = candidates.stream().filter(candidate -> candidate.name != null);
Stream<ArbitraryResourceData> stream = candidates.stream().filter(candidate -> candidate.name != null );
if(exclude.isPresent())
stream = stream.filter( candidate -> !exclude.get().get().contains( candidate.name ));
// filter by service
if( service.isPresent() )

View File

@ -399,7 +399,7 @@ public class HSQLDBCacheUtilsTests {
}
@Test
public void testExcludeBlockedPositive() {
public void testExcludeBlockedNegative() {
ArbitraryResourceData data = new ArbitraryResourceData();
data.name = "Joe";
@ -413,6 +413,21 @@ public class HSQLDBCacheUtilsTests {
);
}
@Test
public void testExcludeBlockedPositive() {
ArbitraryResourceData data = new ArbitraryResourceData();
data.name = "Joe";
Supplier<List<String>> supplier = () -> List.of("Joe");
filterListByMap(
List.of(data),
NAME_LEVEL, new HashMap<>(Map.of(EXCLUDE_BLOCKED, supplier)),
0
);
}
@Test
public void testIncludeMetadataPositive() {