(minor) Fix broken test

This commit is contained in:
Viktor Lofgren 2023-12-10 14:29:18 +01:00
parent 91dd45cf64
commit 84b4158555
2 changed files with 8 additions and 3 deletions

View File

@ -1,6 +1,7 @@
package nu.marginalia.io.processed;
import nu.marginalia.model.processed.DomainRecord;
import nu.marginalia.model.processed.DomainWithIp;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@ -53,8 +54,11 @@ class DomainRecordParquetFileReaderTest {
writer.write(second);
}
var domainNames = DomainRecordParquetFileReader.getDomainNames(parquetFile);
assertEquals(List.of("www.marginalia.nu", "memex.marginalia.nu"), domainNames);
var domainInfo = DomainRecordParquetFileReader.getBasicDomainInformation(parquetFile);
assertEquals(List.of(
new DomainWithIp("www.marginalia.nu", "127.0.0.1"),
new DomainWithIp("memex.marginalia.nu", "127.0.0.1")),
domainInfo);
var items = DomainRecordParquetFileReader
.stream(parquetFile)

View File

@ -21,6 +21,7 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
import java.util.stream.Collectors;
import static org.junit.jupiter.api.Assertions.*;
@ -95,7 +96,7 @@ class DomainLoaderServiceTest {
// Verify
Set<String> expectedDomains1 = Sets.union(new HashSet<>(domains1), new HashSet<>(domains2));
assertEquals(expectedDomains1, domainService.readBasicDomainInformation(new LoaderInputData(workDir, 2)));
assertEquals(expectedDomains1, domainService.readBasicDomainInformation(new LoaderInputData(workDir, 2)).stream().map(d -> d.domain).collect(Collectors.toSet()));
Set<String> expectedDomains2 = new HashSet<>(linkDomains);
assertEquals(expectedDomains2, domainService.readReferencedDomainNames(new LoaderInputData(workDir, 2)));