From 5b4ecb51e116e37d36b20f7694bf784690ee744e Mon Sep 17 00:00:00 2001 From: Hanna Prinz Date: Fri, 24 Nov 2023 15:33:12 +0100 Subject: [PATCH] Fix failing tests RISDEV-2741 --- .../transformer/EnsuingDecisionTransformer.java | 4 ++-- .../transformer/PendingDecisionTransformer.java | 11 +++++++++++ frontend/src/components/EnsuingDecisions.vue | 17 ++++++++++++++++- frontend/src/domain/ensuingDecision.ts | 2 +- .../active-citations.spec.ts | 10 +++++----- .../categories/ensuing-decisions.spec.ts | 8 ++++---- .../categories/previous-decisions.spec.ts | 8 ++++---- 7 files changed, 43 insertions(+), 17 deletions(-) diff --git a/backend/src/main/java/de/bund/digitalservice/ris/caselaw/adapter/transformer/EnsuingDecisionTransformer.java b/backend/src/main/java/de/bund/digitalservice/ris/caselaw/adapter/transformer/EnsuingDecisionTransformer.java index fd7e14c4c4..7173e960cd 100644 --- a/backend/src/main/java/de/bund/digitalservice/ris/caselaw/adapter/transformer/EnsuingDecisionTransformer.java +++ b/backend/src/main/java/de/bund/digitalservice/ris/caselaw/adapter/transformer/EnsuingDecisionTransformer.java @@ -10,9 +10,9 @@ public static EnsuingDecision transformToDomain(EnsuingDecisionDTO ensuingDecisi .uuid(ensuingDecisionDTO.getId()) .documentNumber(ensuingDecisionDTO.getDocumentNumber()) .referencedDocumentationUnitId( - ensuingDecisionDTO.getReferencedDocumentationUnitId() == null + ensuingDecisionDTO.getReferencedDocumentationUnit() == null ? null - : ensuingDecisionDTO.getReferencedDocumentationUnitId()) + : ensuingDecisionDTO.getReferencedDocumentationUnit().getId()) .court(getCourtFromDTO(ensuingDecisionDTO.getCourt())) .fileNumber(getFileNumber(ensuingDecisionDTO.getFileNumber())) .documentType(getDocumentTypeFromDTO(ensuingDecisionDTO.getDocumentType())) diff --git a/backend/src/main/java/de/bund/digitalservice/ris/caselaw/adapter/transformer/PendingDecisionTransformer.java b/backend/src/main/java/de/bund/digitalservice/ris/caselaw/adapter/transformer/PendingDecisionTransformer.java index d68854d7a5..b75a939607 100644 --- a/backend/src/main/java/de/bund/digitalservice/ris/caselaw/adapter/transformer/PendingDecisionTransformer.java +++ b/backend/src/main/java/de/bund/digitalservice/ris/caselaw/adapter/transformer/PendingDecisionTransformer.java @@ -1,5 +1,6 @@ package de.bund.digitalservice.ris.caselaw.adapter.transformer; +import de.bund.digitalservice.ris.caselaw.adapter.database.jpa.DocumentationUnitDTO; import de.bund.digitalservice.ris.caselaw.adapter.database.jpa.PendingDecisionDTO; import de.bund.digitalservice.ris.caselaw.domain.EnsuingDecision; @@ -8,6 +9,10 @@ public static EnsuingDecision transformToDomain(PendingDecisionDTO pendingDecisi return EnsuingDecision.builder() .uuid(pendingDecisionDTO.getId()) .documentNumber(pendingDecisionDTO.getDocumentNumber()) + .referencedDocumentationUnitId( + pendingDecisionDTO.getReferencedDocumentationUnit() == null + ? null + : pendingDecisionDTO.getReferencedDocumentationUnit().getId()) .court(getCourtFromDTO(pendingDecisionDTO.getCourt())) .fileNumber(getFileNumber(pendingDecisionDTO.getFileNumber())) .documentType(getDocumentTypeFromDTO(pendingDecisionDTO.getDocumentType())) @@ -27,6 +32,12 @@ public static PendingDecisionDTO transformToDTO(EnsuingDecision ensuingDecision) .court(getCourtFromDomain(ensuingDecision.getCourt())) .date(ensuingDecision.getDecisionDate()) .documentNumber(ensuingDecision.getDocumentNumber()) + .referencedDocumentationUnit( + ensuingDecision.getReferencedDocumentationUnitId() == null + ? null + : DocumentationUnitDTO.builder() + .id(ensuingDecision.getReferencedDocumentationUnitId()) + .build()) .documentType(getDocumentTypeFromDomain(ensuingDecision.getDocumentType())) .fileNumber(getFileNumber(ensuingDecision.getFileNumber())) .note(ensuingDecision.getNote()) diff --git a/frontend/src/components/EnsuingDecisions.vue b/frontend/src/components/EnsuingDecisions.vue index 97aa7f1373..605ca65d1f 100644 --- a/frontend/src/components/EnsuingDecisions.vue +++ b/frontend/src/components/EnsuingDecisions.vue @@ -1,5 +1,6 @@