Reformat JUnit 5 examples
This commit is contained in:
parent
4bc347acca
commit
e641ca0598
@ -3,9 +3,7 @@ package com.baeldung;
|
|||||||
import org.junit.gen5.api.Test;
|
import org.junit.gen5.api.Test;
|
||||||
|
|
||||||
import static org.junit.gen5.api.Assertions.assertEquals;
|
import static org.junit.gen5.api.Assertions.assertEquals;
|
||||||
import static org.junit.gen5.api.Assumptions.assumeFalse;
|
import static org.junit.gen5.api.Assumptions.*;
|
||||||
import static org.junit.gen5.api.Assumptions.assumeTrue;
|
|
||||||
import static org.junit.gen5.api.Assumptions.assumingThat;
|
|
||||||
|
|
||||||
public class AssumptionTest {
|
public class AssumptionTest {
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@ package com.baeldung;
|
|||||||
|
|
||||||
import org.junit.gen5.api.Test;
|
import org.junit.gen5.api.Test;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import static org.junit.gen5.api.Assertions.assertEquals;
|
import static org.junit.gen5.api.Assertions.assertEquals;
|
||||||
import static org.junit.gen5.api.Assertions.expectThrows;
|
import static org.junit.gen5.api.Assertions.expectThrows;
|
||||||
|
|
||||||
@ -12,7 +10,9 @@ public class ExceptionTest {
|
|||||||
@Test
|
@Test
|
||||||
void shouldThrowException() {
|
void shouldThrowException() {
|
||||||
Throwable exception = expectThrows(UnsupportedOperationException.class,
|
Throwable exception = expectThrows(UnsupportedOperationException.class,
|
||||||
() -> {throw new UnsupportedOperationException("Not supported");});
|
() -> {
|
||||||
|
throw new UnsupportedOperationException("Not supported");
|
||||||
|
});
|
||||||
assertEquals(exception.getMessage(), "Not supported");
|
assertEquals(exception.getMessage(), "Not supported");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,10 @@ package com.baeldung;
|
|||||||
import org.junit.gen5.api.Disabled;
|
import org.junit.gen5.api.Disabled;
|
||||||
import org.junit.gen5.api.Test;
|
import org.junit.gen5.api.Test;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.junit.gen5.api.Assertions.assertAll;
|
import static org.junit.gen5.api.Assertions.*;
|
||||||
import static org.junit.gen5.api.Assertions.assertEquals;
|
|
||||||
import static org.junit.gen5.api.Assertions.assertTrue;
|
|
||||||
|
|
||||||
class FirstTest {
|
class FirstTest {
|
||||||
|
|
||||||
|
@ -11,6 +11,6 @@ public class TaggedTest {
|
|||||||
@Test
|
@Test
|
||||||
@Tag("Method")
|
@Tag("Method")
|
||||||
void testMethod() {
|
void testMethod() {
|
||||||
assertEquals(2+2, 4);
|
assertEquals(2 + 2, 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user