conflits resolution
This commit is contained in:
parent
789b7267be
commit
1f6c74ecab
|
@ -137,7 +137,10 @@
|
|||
</build>
|
||||
|
||||
<properties>
|
||||
<junit.jupiter.version>5.8.1</junit.jupiter.version>
|
||||
<mockito.junit.jupiter.version>2.23.0</mockito.junit.jupiter.version>
|
||||
<junit.platform.version>1.8.1</junit.platform.version>
|
||||
<junit.vintage.version>5.8.1</junit.vintage.version>
|
||||
<log4j2.version>2.8.2</log4j2.version>
|
||||
<powermock.version>2.0.0</powermock.version>
|
||||
<maven-surefire-plugin.version>2.22.0</maven-surefire-plugin.version>
|
||||
|
|
|
@ -3,11 +3,11 @@ package com.baeldung.junit5.order;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.MethodOrderer.Alphanumeric;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
@TestMethodOrder(Alphanumeric.class)
|
||||
@TestMethodOrder(MethodOrderer.MethodName.class)
|
||||
public class AlphanumericOrderUnitTest {
|
||||
private static StringBuilder output = new StringBuilder("");
|
||||
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
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;
|
||||
|
||||
public class DefaultOrderUnitTest {
|
||||
|
||||
private static StringBuilder output = new StringBuilder("");
|
||||
|
||||
@Test
|
||||
@DisplayName("Test A")
|
||||
public void myATest() {
|
||||
output.append("A");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Test B")
|
||||
public void myBTest() {
|
||||
output.append("B");
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("Test C")
|
||||
public void myCTest() {
|
||||
output.append("C");
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
public static void assertOutput() {
|
||||
assertEquals(output.toString(), "ABC");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
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;
|
||||
|
||||
@TestMethodOrder(MethodOrderer.Random.class)
|
||||
public class RandomOrderUnitTest {
|
||||
|
||||
private static StringBuilder output = new StringBuilder("");
|
||||
|
||||
@Test
|
||||
public void myATest() {
|
||||
output.append("A");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void myBTest() {
|
||||
output.append("B");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void myCTest() {
|
||||
output.append("C");
|
||||
}
|
||||
|
||||
@AfterAll
|
||||
public static void assertOutput() {
|
||||
assertEquals(output.toString(), "ACB");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
junit.jupiter.execution.order.random.seed=100
|
||||
junit.jupiter.testmethod.order.default = org.junit.jupiter.api.MethodOrderer$DisplayName
|
Loading…
Reference in New Issue