From 71e00cf1274dd20938de40458c6e23a87917a018 Mon Sep 17 00:00:00 2001 From: MartinWheelerMT Date: Tue, 1 Oct 2024 16:15:42 +0100 Subject: [PATCH] Fix issue with incorrect usage of isEqualTo Fix issue with incorrect usage of isEqualTo when comparing lists in SpecimenBatteryMapperTest. --- .../diagnosticreport/SpecimenBatteryMapperTest.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gp2gp-translator/src/test/java/uk/nhs/adaptors/pss/translator/mapper/diagnosticreport/SpecimenBatteryMapperTest.java b/gp2gp-translator/src/test/java/uk/nhs/adaptors/pss/translator/mapper/diagnosticreport/SpecimenBatteryMapperTest.java index 04559b027..5fa87f994 100644 --- a/gp2gp-translator/src/test/java/uk/nhs/adaptors/pss/translator/mapper/diagnosticreport/SpecimenBatteryMapperTest.java +++ b/gp2gp-translator/src/test/java/uk/nhs/adaptors/pss/translator/mapper/diagnosticreport/SpecimenBatteryMapperTest.java @@ -117,10 +117,13 @@ void When_MappingObservationWithAvailabilityTimeInDiagnosticReport_Expect_MoreTh final var ehrExtract = unmarshallEhrExtractFromEhrCompositionXml(ehrCompositionXml); final var batteryCompoundStatements = getBatteryCompoundStatements(ehrExtract); - assertThat(batteryCompoundStatements).map(r -> r.getId().getFirst().getRoot()) - .isEqualTo(List.of("SPECIMEN_CHILD_BATTERY_COMPOUND_STATEMENT_ID_1", - "SPECIMEN_CHILD_BATTERY_COMPOUND_STATEMENT_ID_2", - "SPECIMEN_CHILD_BATTERY_COMPOUND_STATEMENT_ID_3")); + assertThat(batteryCompoundStatements) + .extracting(batteryCompoundStatement -> batteryCompoundStatement.getId().getFirst().getRoot()) + .containsExactly( + "SPECIMEN_CHILD_BATTERY_COMPOUND_STATEMENT_ID_1", + "SPECIMEN_CHILD_BATTERY_COMPOUND_STATEMENT_ID_2", + "SPECIMEN_CHILD_BATTERY_COMPOUND_STATEMENT_ID_3" + ); } @Test void When_MappingObservationWithAvailabilityTimeInBatteryCompoundStatement_Expect_IssuedUsesThisValue() {