Junit4 'assertEquals()' from 'Assert' should be replaced with JUnit5 call to method from 'org.junit.jupiter.api.Assertions'
This commit is contained in:
parent
da30a3efd7
commit
e0bdd5a62d
|
@ -5,12 +5,12 @@ import org.junit.jupiter.api.MethodOrderer;
|
|||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
@TestMethodOrder(MethodOrderer.MethodName.class)
|
||||
public class AlphanumericOrderUnitTest {
|
||||
|
||||
private static StringBuilder output = new StringBuilder("");
|
||||
private static final StringBuilder output = new StringBuilder("");
|
||||
|
||||
@Test
|
||||
void myATest() {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package com.baeldung.junit5.order;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
@TestMethodOrder(CustomOrder.class)
|
||||
public class CustomOrderUnitTest {
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
package com.baeldung.junit5.order;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.DisplayName;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class DefaultOrderUnitTest {
|
||||
|
||||
private static StringBuilder output = new StringBuilder("");
|
||||
private static final StringBuilder output = new StringBuilder();
|
||||
|
||||
@Test
|
||||
@DisplayName("Test A")
|
||||
|
@ -30,7 +30,7 @@ public class DefaultOrderUnitTest {
|
|||
|
||||
@AfterAll
|
||||
public static void assertOutput() {
|
||||
assertEquals(output.toString(), "ABC");
|
||||
assertEquals("ABC", output.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
package com.baeldung.junit5.order;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
||||
import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
@TestMethodOrder(OrderAnnotation.class)
|
||||
public class OrderAnnotationUnitTest {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
package com.baeldung.junit5.order;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
@TestMethodOrder(MethodOrderer.Random.class)
|
||||
public class RandomOrderUnitTest {
|
||||
|
||||
private static StringBuilder output = new StringBuilder("");
|
||||
private static final StringBuilder output = new StringBuilder();
|
||||
|
||||
@Test
|
||||
void myATest() {
|
||||
|
@ -29,7 +29,7 @@ public class RandomOrderUnitTest {
|
|||
|
||||
@AfterAll
|
||||
public static void assertOutput() {
|
||||
assertEquals(output.toString(), "ACB");
|
||||
assertEquals("ACB", output.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue