From 69087ec8daefe1afc3dccc657a869b4b27a63123 Mon Sep 17 00:00:00 2001 From: Philippe Edwards Date: Thu, 14 Dec 2023 10:27:17 +0100 Subject: [PATCH] added a test to check error handling for doc status Signed-off-by: Philippe Edwards --- .../data_exchange/PevfExchangesTest.java | 7 +++++++ ...EVFMarketDocument_2-0_error_doc_status.xml | 20 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 entsoe-cgmes-balances-adjustment/src/test/resources/testPEVFMarketDocument_2-0_error_doc_status.xml diff --git a/entsoe-cgmes-balances-adjustment/src/test/java/com/powsybl/entsoe/cgmes/balances_adjustment/data_exchange/PevfExchangesTest.java b/entsoe-cgmes-balances-adjustment/src/test/java/com/powsybl/entsoe/cgmes/balances_adjustment/data_exchange/PevfExchangesTest.java index fa2828bb..bedb26b5 100644 --- a/entsoe-cgmes-balances-adjustment/src/test/java/com/powsybl/entsoe/cgmes/balances_adjustment/data_exchange/PevfExchangesTest.java +++ b/entsoe-cgmes-balances-adjustment/src/test/java/com/powsybl/entsoe/cgmes/balances_adjustment/data_exchange/PevfExchangesTest.java @@ -11,6 +11,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import java.io.InputStream; import java.time.Instant; import java.time.ZonedDateTime; import java.util.Iterator; @@ -57,6 +58,12 @@ void baseTests() { assertFalse(exchanges.getDomainCodingScheme().isPresent()); } + @Test + void testErrorInCodeStatus() { + InputStream inputStream = getClass().getResourceAsStream("/testPEVFMarketDocument_2-0_error_doc_status.xml"); + assertThrows(RuntimeException.class, () -> DataExchangesXml.parse(inputStream)); + } + @Test void timeSeriesTests() { // Time Series diff --git a/entsoe-cgmes-balances-adjustment/src/test/resources/testPEVFMarketDocument_2-0_error_doc_status.xml b/entsoe-cgmes-balances-adjustment/src/test/resources/testPEVFMarketDocument_2-0_error_doc_status.xml new file mode 100644 index 00000000..4e9df5a6 --- /dev/null +++ b/entsoe-cgmes-balances-adjustment/src/test/resources/testPEVFMarketDocument_2-0_error_doc_status.xml @@ -0,0 +1,20 @@ + + + MarketDocument_MRID + 1 + B19 + A01 + SenderMarket + A32 + ReceiverMarket + A33 + 2020-04-05T14:30:00Z + + 2020-04-05T22:00Z + 2020-04-06T22:00Z + + PEVF CGM Export + + A<>01 + +