jongyoul commented on code in PR #4532: URL: https://github.com/apache/zeppelin/pull/4532#discussion_r1044995483
########## zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/ParagraphTextParserTest.java: ########## @@ -136,38 +136,32 @@ public void testParagraphTextQuotedPropertyKeyAndValue() { assertEquals("", parseResult.getScriptText()); } - @Rule - public ExpectedException exceptionRule = ExpectedException.none(); @Test public void testParagraphTextUnfinishedConfig() { - exceptionRule.expect(RuntimeException.class); - exceptionRule.expectMessage( + assertThrows(RuntimeException.class, () -> + ParagraphTextParser.parse("%spark.pyspark(pool="), "Problems by parsing paragraph. Not finished interpreter configuration"); - ParagraphTextParser.parse("%spark.pyspark(pool="); } @Test public void testParagraphTextUnfinishedQuote() { - exceptionRule.expect(RuntimeException.class); - exceptionRule.expectMessage( + assertThrows(RuntimeException.class, () -> + ParagraphTextParser.parse("%spark.pyspark(pool=\"2314234) sc.version"), "Problems by parsing paragraph. Not finished interpreter configuration"); - ParagraphTextParser.parse("%spark.pyspark(pool=\"2314234) sc.version"); } @Test public void testParagraphTextUnclosedBackslash() { - exceptionRule.expect(RuntimeException.class); - exceptionRule.expectMessage( + assertThrows(RuntimeException.class, () -> + ParagraphTextParser.parse("%spark.pyspark(pool=\\"), "Problems by parsing paragraph. Unfinished escape sequence"); - ParagraphTextParser.parse("%spark.pyspark(pool=\\"); } @Test public void testParagraphTextEmptyKey() { - exceptionRule.expect(RuntimeException.class); - exceptionRule.expectMessage( - "Problems by parsing paragraph. Local property key is empty"); - ParagraphTextParser.parse("%spark.pyspark(pool=123, ,)"); + assertThrows((RuntimeException.class), () -> + ParagraphTextParser.parse("%spark.pyspark(pool=123, ,)"), + "Problems by parsing paragraph. Local property key is empty"); Review Comment: The same with the above. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@zeppelin.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org