Skip to content

UI. Private nested classes should be hidden #864

Closed
@alisevych

Description

@alisevych

Description

Private nested classes should be hidden from member list.
Currently they are shown and tests can be generated for they non-private methods.

To Reproduce

Steps to reproduce the behavior:

  1. IntelliJ IDEA with one of the latest UTBot plugin builds installed.
  2. Open/create a Java project
  3. Add the following class:
public class A {

    private class Inner {

        private int x;

        public int giveFive() {
            return 5;
        }
    }

    public boolean foo(Inner in) {
        return (in.x > 0);
    }
}

Expected behavior

Private members should not be available for test generation.

Actual behavior

Private class is shown in Member list.
When it is chosen and there are public/package-private methods - tests are generation using reflection.

Visual proofs (screenshots, logs, images)

image

Environment

IntelliJ IDEA 2022.1.4
UTBot plugin version

Additional context

As discussed with @volivan239 @EgorkaKulikov all public and package-private nested classes are shown in Member list - even if they do not have methods. It is made the same as for case when we display all classes in a package.

Metadata

Metadata

Assignees

Labels

comp-uiImprovements of plugin UI appearence and functionalityctg-bugIssue is a bug

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions