Skip to content

Generated test methods reduced the visibility of the duplicated methods from inherited class #1182

@testforstephen

Description

@testforstephen

Below are samples.

public class A {
    @BeforeAll
    public static void beforeClass() {
    }

    @BeforeEach
    public void setUp() {
    }
}
public class B extends A {
    @BeforeAll
    static void beforeClass() { // Generated lifecycle method will report error "Cannot reduce the visibility of the inherited method from A".
    }

    @BeforeEach
    void setUp() { // Generated lifecycle method will report error "Cannot reduce the visibility of the inherited method from A".
    }
}

Should check if the inherited class contains the same methods. If they're visible to the subclass, the subclass should not reduce the visibility of these methods. Also add @Override annotation for them.

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