sadv1r / junit-ordered-runner

Custom runner for JUnit that allows the user to specify the order of methods execution within a test class

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
    }
}

About

Custom runner for JUnit that allows the user to specify the order of methods execution within a test class

License:MIT License


Languages

Language:Java 100.0%