You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2021/04/10 10:03:42 UTC

[jmeter] 06/08: Convert to assertThrows

This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git

commit c8ab6a684cb0556a64f9c82df768b3ca28381cbb
Author: Felix Schumacher <fe...@internetallee.de>
AuthorDate: Sat Apr 10 11:32:49 2021 +0200

    Convert to assertThrows
    
    Relates to #652
---
 .../src/test/java/org/apache/jmeter/save/TestCSVSaveService.java  | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/src/core/src/test/java/org/apache/jmeter/save/TestCSVSaveService.java b/src/core/src/test/java/org/apache/jmeter/save/TestCSVSaveService.java
index 5e53b65..cc7a6c8 100644
--- a/src/core/src/test/java/org/apache/jmeter/save/TestCSVSaveService.java
+++ b/src/core/src/test/java/org/apache/jmeter/save/TestCSVSaveService.java
@@ -18,7 +18,7 @@
 package org.apache.jmeter.save;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -94,11 +94,7 @@ public class TestCSVSaveService extends JMeterTestCase {
 
     @Test
     public void testSplitBadQuote() throws Exception {
-        try {
-            checkSplitString("a\"b",',',new String[]{});
-            fail("Should have generated IOException");
-        } catch (IOException e) {
-        }
+        assertThrows(IOException.class, () -> checkSplitString("a\"b", ',', new String[] {}));
     }
 
     @Test