hosting-asset-data-migration #79

Merged
hsh-michaelhoennig merged 22 commits from hosting-asset-data-migration into master 2024-07-22 11:30:34 +02:00
3 changed files with 15 additions and 4 deletions
Showing only changes of commit 4b0fe5eb82 - Show all commits

View File

@ -20,15 +20,14 @@ import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader; import java.io.Reader;
import java.io.StringReader; import java.io.StringReader;
import java.io.StringWriter; import java.io.StringWriter;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
@ -69,6 +68,8 @@ public class CsvDataImport extends ContextBasedTest {
@MockBean @MockBean
HttpServletRequest request; HttpServletRequest request;
private static final List<AssertionError> errors = new ArrayList<>();
public List<String[]> readAllLines(Reader reader) throws Exception { public List<String[]> readAllLines(Reader reader) throws Exception {
final var parser = new CSVParserBuilder() final var parser = new CSVParserBuilder()
@ -211,12 +212,17 @@ public class CsvDataImport extends ContextBasedTest {
} }
void logError(final Runnable assertion) { void logError(final Runnable assertion) {
assertion.run();
hsh-michaelhoennig marked this conversation as resolved Outdated

muss raus

muss raus
try { try {
assertion.run(); assertion.run();
} catch (final AssertionError exc) { } catch (final AssertionError exc) {
System.err.println(exc); errors.add(exc);
} }
} }
void logErrors() {
assumeThat(errors).isEmpty();
}
} }
class Columns { class Columns {

View File

@ -310,6 +310,12 @@ public class ImportHostingAssets extends ImportOfficeData {
persistHostingAssetsOfType(IPV4_NUMBER); persistHostingAssetsOfType(IPV4_NUMBER);
} }
@Test
@Order(99999)
void logErrors() {
super.logErrors();
}
private void persistRecursively(final Integer key, final HsBookingItemEntity bi) { private void persistRecursively(final Integer key, final HsBookingItemEntity bi) {
if (bi.getParentItem() != null) { if (bi.getParentItem() != null) {
persistRecursively(key, HsBookingItemEntityValidatorRegistry.validated(bi.getParentItem())); persistRecursively(key, HsBookingItemEntityValidatorRegistry.validated(bi.getParentItem()));

View File

@ -500,7 +500,6 @@ public class ImportOfficeData extends CsvDataImport {
@Test @Test
@Order(2000) @Order(2000)
// @Disabled // FIXME
void verifyAllPartnersHavePersons() { void verifyAllPartnersHavePersons() {
partners.forEach((id, p) -> { partners.forEach((id, p) -> {
final var partnerRel = p.getPartnerRel(); final var partnerRel = p.getPartnerRel();