mirror of
https://github.com/Qortal/qortal.git
synced 2025-03-14 03:22:32 +00:00
exclude blocked implementation completion
This commit is contained in:
parent
70f4ff4fb3
commit
69cba78d94
@ -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() )
|
||||
|
@ -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() {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user