mirror of
https://github.com/Qortal/qortal.git
synced 2025-05-07 18:27:53 +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) {
|
Optional<Boolean> reverse) {
|
||||||
|
|
||||||
// retain only candidates with names
|
// 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
|
// filter by service
|
||||||
if( service.isPresent() )
|
if( service.isPresent() )
|
||||||
|
@ -399,7 +399,7 @@ public class HSQLDBCacheUtilsTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExcludeBlockedPositive() {
|
public void testExcludeBlockedNegative() {
|
||||||
|
|
||||||
ArbitraryResourceData data = new ArbitraryResourceData();
|
ArbitraryResourceData data = new ArbitraryResourceData();
|
||||||
data.name = "Joe";
|
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
|
@Test
|
||||||
public void testIncludeMetadataPositive() {
|
public void testIncludeMetadataPositive() {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user