Skip to content

Latest commit

 

History

History
50 lines (44 loc) · 1.8 KB

README.md

File metadata and controls

50 lines (44 loc) · 1.8 KB

JUnit Ordered Runner

This little project is designed to give the ability to specify the order of methods execution within a test class.

Build Status Quality Gate Coverage Known Vulnerabilities FOSSA Status

Installation

<dependency>
    <groupId>ru.sadv1r.junit</groupId>
    <artifactId>junit-ordered-runner</artifactId>
    <version>${dep.junit-ordered-runner.version}</version>
    <scope>test</scope>
</dependency>

Usage

@RunWith(OrderedRunner.class)
public class YourTest {
    @Test
    @Order(1)
    public void needToBeFirst() {
        // Test code
    }

    @Test
    @Order(3)
    public void needToBeThird() {
        // Test code
    }
    
    @Test
    public void withoutOrder() {
        // Test code
    }

    @Test
    @Order(2)
    public void needToBeSecond() {
        // Test code
    }
}