File tree Expand file tree Collapse file tree 2 files changed +15
-19
lines changed
biojava-genome/src/test/java/org/biojava/nbio/genome/io/fastq Expand file tree Collapse file tree 2 files changed +15
-19
lines changed Original file line number Diff line number Diff line change 2020 */
2121package org .biojava .nbio .genome .io .fastq ;
2222
23-
2423import org .junit .Assert ;
2524import org .junit .Test ;
2625
26+ import org .junit .function .ThrowingRunnable ;
27+
2728/**
2829 * Unit test for FastqBuilder.
2930 */
@@ -60,15 +61,12 @@ public void testConstructorFastq()
6061 @ Test
6162 public void testConstructorNullFastq ()
6263 {
63- try
64- {
65- new FastqBuilder (null );
66- Assert .fail ("builder(null) expected IllegalArgumentException" );
67- }
68- catch (IllegalArgumentException e )
69- {
70- // expected
71- }
64+ Assert .assertThrows (IllegalArgumentException .class , new ThrowingRunnable () {
65+ @ Override
66+ public void run () {
67+ new FastqBuilder (null );
68+ }
69+ });
7270 }
7371
7472 @ Test
Original file line number Diff line number Diff line change 2323import org .junit .Assert ;
2424import org .junit .Test ;
2525
26+ import org .junit .function .ThrowingRunnable ;
2627
2728/**
2829 * Unit test for Fastq.
@@ -114,15 +115,12 @@ public void testBuilder()
114115 @ Test
115116 public void testBuilderNullFastq ()
116117 {
117- try
118- {
119- Fastq .builder (null );
120- Assert .fail ("builder(null) expected IllegalArgumentException" );
121- }
122- catch (IllegalArgumentException e )
123- {
124- // expected
125- }
118+ Assert .assertThrows (IllegalArgumentException .class , new ThrowingRunnable () {
119+ @ Override
120+ public void run () {
121+ Fastq .builder (null );
122+ }
123+ });
126124 }
127125
128126 @ Test
You can’t perform that action at this time.
0 commit comments