Skip to content

Commit

Permalink
Migrate to assertThrows
Browse files Browse the repository at this point in the history
  • Loading branch information
henri-tremblay committed Oct 4, 2019
1 parent 7b7692f commit 2468c28
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions main/src/test/java/org/objenesis/ObjenesisTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
*/
package org.objenesis;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.objenesis.instantiator.ObjectInstantiator;
import org.objenesis.strategy.InstantiatorStrategy;

Expand All @@ -28,9 +26,6 @@
*/
public class ObjenesisTest {

@Rule
public ExpectedException expectedException = ExpectedException.none();

@Test
public final void testObjenesis() {
Objenesis o = new ObjenesisStd();
Expand Down Expand Up @@ -70,8 +65,7 @@ public final void testGetInstantiatorOf() {
@Test
public final void testGetInstantiatorOf_primitive() {
Objenesis o = new ObjenesisStd();
expectedException.expect(IllegalArgumentException.class);
o.getInstantiatorOf(long.class);
assertThrows(IllegalArgumentException.class, () -> o.getInstantiatorOf(long.class));
}

@Test
Expand Down

0 comments on commit 2468c28

Please sign in to comment.