From d58a0818588d66fdafa56947cf20cf34ded8eb16 Mon Sep 17 00:00:00 2001 From: sahusanket Date: Wed, 17 Jul 2024 19:13:21 +0530 Subject: [PATCH] fix unit tests --- cdap-master/pom.xml | 6 ++++++ .../publisher/MetricsWritersMetricsPublisherTest.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cdap-master/pom.xml b/cdap-master/pom.xml index 0fd4ff5b3222..986669b68f0f 100644 --- a/cdap-master/pom.xml +++ b/cdap-master/pom.xml @@ -223,6 +223,12 @@ org.apache.commons commons-lang3 + + jakarta.servlet + jakarta.servlet-api + 4.0.3 + test + diff --git a/cdap-master/src/test/java/io/cdap/cdap/metrics/publisher/MetricsWritersMetricsPublisherTest.java b/cdap-master/src/test/java/io/cdap/cdap/metrics/publisher/MetricsWritersMetricsPublisherTest.java index 52a7ccaeff32..cfa44258ba2a 100644 --- a/cdap-master/src/test/java/io/cdap/cdap/metrics/publisher/MetricsWritersMetricsPublisherTest.java +++ b/cdap-master/src/test/java/io/cdap/cdap/metrics/publisher/MetricsWritersMetricsPublisherTest.java @@ -88,7 +88,7 @@ public void testPublishFlow() throws Exception { // Ensure if one writer throws exception on write(), rest still get metrics MetricsWriter faultyWriter = writers.get(getWriterName(2)); - doThrow(IOException.class).when(faultyWriter).write(metricValues); + doThrow(RuntimeException.class).when(faultyWriter).write(metricValues); publisher.publish(metricValues); for (Map.Entry entry : writers.entrySet()) { MetricsWriter writer = entry.getValue();