Correct order

Report a typo

Given the following test class:

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
internal class CalculatorTests {

    @BeforeAll
    fun first() {
        // 1
    }

    @AfterAll
    fun second() {
        // 2
    }
    
    @BeforeEach
    fun third() {
        // 3
    }

    @AfterEach
    fun fourth() {
        // 4
    }

    @Test
    fun fifth() {
        // 5
    }
}

Arrange its methods according to the order of their execution. The first method to execute should be on top and the last one should be at the bottom.

Put the items in the correct order
first() // 1
fifth() // 5
fourth() // 4
second() // 2
third() // 3
___

Create a free account to access the full topic