Skip to content

Assumptions are broken in JUnit4 when opentest4j is in the classpath with 3.17.1 #1985

@JoergSiebahn

Description

@JoergSiebahn

Summary

#1983 causes assumptions to fail instead of ignoring the test in edge cases.

This only occurs with JUnit4 when opentest4j is in the classpath, e.g. as transitive dependency from other test utilities like Json-Unit.

JUnit4 does not recognize org.opentest4j.TestAbortedException as expected and fails.

Example

I created a test case for Json-Unit.

package net.javacrumbs.jsonunit.test.junit4;

import org.assertj.core.api.Assumptions;
import org.junit.Test;

public class AssumptionsWithAssertJTest {
    @Test
    public void shouldBeIgnoredButFails() {
        Assumptions.assumeThat("Test").isEqualTo("NotEqualToTest");
    }
}

See also lukas-krecan/JsonUnit#276

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions