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:
CalDescent
2023-05-05 12:39:11 +01:00
parent c172a5764b
commit 3775135e0c
3 changed files with 56 additions and 0 deletions

View File

@@ -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());
}
}
}