mirror of
https://github.com/Qortal/qortal.git
synced 2025-07-23 04:36:50 +00:00
Added helper methods to fetch lists of private or public service objects.
These can ultimately be used to help inform the cleanup manager on the best order to delete files when the node runs out of space. Public data should be given priority over private data (unless the node is part of a data market contract for that data - this isn't developed yet).
This commit is contained in:
@@ -29,6 +29,7 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
@@ -503,4 +504,20 @@ public class ArbitraryServiceTests extends Common {
|
||||
assertEquals(ValidationResult.OK, service.validate(filePath));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetPrivateServices() {
|
||||
List<Service> privateServices = Service.privateServices();
|
||||
for (Service service : privateServices) {
|
||||
assertTrue(service.isPrivate());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetPublicServices() {
|
||||
List<Service> publicServices = Service.publicServices();
|
||||
for (Service service : publicServices) {
|
||||
assertFalse(service.isPrivate());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user